var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

	var minutes;
	var hours;
	minutes = tDate.getMinutes().toString();
	hours = tDate.getHours().toString();
	
	
	if(minutes.length == 1){
		minutes = '0'+minutes;	
	}
	if(hours.length == 1){
		hours = '0'+hours;	
	}
   document.getElementById("divClock").innerHTML = "" 
                                   + hours + ":" 
                                   + minutes;
   
   clockID = setTimeout("UpdateClock()", 30000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

