/* Palvelukohtaisia funktioita */


var clockID = 0;

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

   var date = new Date();

   var hours = date.getHours();
   var minutes = date.getMinutes();
   var seconds = date.getSeconds();
   if (minutes < 10)
		minutes = "0"+minutes;
   if (seconds < 10)
		seconds = "0"+seconds;
	document.theClock.theTime.value = "" + hours + ":" + minutes;
                                   
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

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