// JavaScript Document
var clockID = 0;

function pad(number) { return (number < 10) ? '0' + number : number; }


function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

   document.getElementById('clockText').innerHTML = 
   								  "<b>Ημ/νια: " + tDate.getDate() + "/" 
								  + (tDate.getMonth()+1) + "/" 
								  + tDate.getFullYear()+"<br>"+
   									"Τοπική: " 
                                   + pad(tDate.getHours()) + ":" 
                                   + pad(tDate.getMinutes()) + "<br>"+"UTC: " 
                                   + pad(tDate.getUTCHours()) + ":" 
                                   + pad(tDate.getUTCMinutes()) + "</b>";
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = 1;
   UpdateClock();
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}
