var clockID = 0;

function fjs_viewgaleri(s)
	{
				window.open("t-galerifotodetail.asp?idgalerifoto="+s,"GaleriFoto","scrollbars=1,menubar=1,resizable=1,width=650,height=450");
	}

function fjs_viewfoto(s)
	{
				window.open("t-beritafotodetail.asp?idberitafoto="+s,"FotoBerita","scrollbars=1,menubar=1,resizable=1,width=650,height=450");
	}

function fjs_viewiklan(s)
	{
				window.open("t-beritafotodetail2.asp?idberitafoto="+s,"FotoBerita","scrollbars=1,menubar=1,resizable=1,width=650,height=450");
	}


function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

   document.theClock.theTime.value = "" 
                                   + tDate.getHours() + ":" 
                                   + tDate.getMinutes() + ":" 
                                   + tDate.getSeconds();
   
   clockID = setTimeout("UpdateClock()", 1000);
}

function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

function rbhmenu1()
{
	menu1.style.backgroundColor="green";
}

function rbh1menu1()
{
	menu1.style.backgroundColor="#000000";
}

function rbhmenu2()
{
	menu2.style.backgroundColor="green";
}

function rbh1menu2()
{
	menu2.style.backgroundColor="#000000";
}

function rbhmenu3()
{
	menu3.style.backgroundColor="green";
}

function rbh1menu3()
{
	menu3.style.backgroundColor="#000000";
}

function rbhmenu4()
{
	menu4.style.backgroundColor="green";
}

function rbh1menu4()
{
	menu4.style.backgroundColor="#000000";
}

function rbhmenu5()
{
	menu5.style.backgroundColor="green";
}

function rbh1menu5()
{
	menu5.style.backgroundColor="#000000";
}

function panggil()
{	 
	divmnu2.style.visibility="hidden";
}

function panggil2()
{	 
	divmnu2.style.visibility="visible";
}

	function tulis(){
		document.myform.tanggal.value = Date();
		setTimeout("tulis()",1000);
	}

function buildCal(m, y, cM, cH, cDW, cD, brdr){
var mn=['Januari','Pebruari','Maret','April','Mai','Juni','Juli','Agustus','September','October','November','Desember'];
var dim=[31,0,31,30,31,30,31,31,30,31,30,31];

var oD = new Date(y, m-1, 1); //DD replaced line to fix date bug when current day is 31st
oD.od=oD.getDay()+1; //DD replaced line to fix date bug when current day is 31st

var todaydate=new Date() //DD added
var scanfortoday=(y==todaydate.getFullYear() && m==todaydate.getMonth()+1)? todaydate.getDate() : 0 //DD added

dim[1]=(((oD.getFullYear()%100!=0)&&(oD.getFullYear()%4==0))||(oD.getFullYear()%400==0))?29:28;
var t='<div class="'+cM+'"><table border=0 class="'+cM+'" cols="7" cellpadding="1" border="'+brdr+'" cellspacing="1"><tr align="center">';
t+='<td colspan="7" align="center" class="'+cH+'"><strong>'+mn[m-1]+' - '+y+'</strong></td></tr><tr align="center">';
for(s=0;s<7;s++)t+='<td class="'+cDW+'">'+"MSSRKJS".substr(s,1)+'</td>';
t+='</tr><tr align="center">';
for(i=1;i<=42;i++){
var x=((i-oD.od>=0)&&(i-oD.od<dim[m-1]))? i-oD.od+1 : '&nbsp;';
if (x==scanfortoday) //DD added
x='<span id="today">'+x+'</span>' //DD added
t+='<td class="'+cD+'">'+x+'</td>';
if(((i)%7==0)&&(i<36))t+='</tr><tr align="center">';
}
return t+='</tr></table></div>';
}


