// JavaScript Document
var clockID = 0;
var weekday=new Array(7);
weekday[0]="Sun";
weekday[1]="Mon";
weekday[2]="Tue";
weekday[3]="Wed";
weekday[4]="Thu";
weekday[5]="Fri";
weekday[6]="Sat";

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var curDate = new Date();
   
   var hours=""+curDate.getHours();
   if(hours.length<2)
   {
   		hours="0"+hours;
   }
		
   var min=""+curDate.getMinutes();
   if(min.length<2)
   {
   		min="0"+min;
		
   }
		
   var curDateStr=""+ weekday[curDate.getDay()]+", "+ curDate.getDate()+"/"+eval(curDate.getMonth()+1)+"/"+curDate.getFullYear()+", "+hours + ":" 
                                   + min;

   document.theClock.theTime.value = curDateStr;
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 100);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}
