var dayarray=new Array("Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu")
var montharray=new Array("Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember")

function getthedate()
{
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
 year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var sapa=new String()

if (hours>12)
{
hours=hours
}

if (hours==0)
 hours=12
if (hours<=9)
 hours ="0"+hours
if (minutes<=9)
 minutes="0"+minutes
if (seconds<=9)
 seconds="0"+seconds

		if(hours < 10)
			sapa="Selamat pagi";
		else if(hours < 15)
			sapa="Selamat siang";
		else if(hours < 19)
			sapa="Selamat sore";
		else
			sapa="Selamat malam";

var cdate=dayarray[day]+", "+daym+" "+montharray[month]+" "+year+"&nbsp;-&nbsp;"+hours+":"+minutes+":"+seconds

if (document.all)
 document.all.clock.innerHTML=cdate
else if (document.getElementById)
 document.getElementById("clock").innerHTML=cdate
else
 document.write(cdate)
}

if (!document.all&&!document.getElementById)
 getthedate()

function goforit()
{
if (document.all||document.getElementById)
setInterval("getthedate()",1000)
}

window.onload=goforit
