// JavaScript Documentvar clockID = 0;
function addLeadZero(number){
	if(number<10){
		number = "0"+number;
	}
	return number;
}
function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();
	var hora = addLeadZero(tDate.getHours());
	var minuto = addLeadZero(tDate.getMinutes());
	var segundo = addLeadZero(tDate.getSeconds());
	var dia = addLeadZero(tDate.getDate());
	var mes = addLeadZero(tDate.getMonth());		
   document.getElementById("hora").innerHTML = "" 
                                   + hora + ":" 
                                   + minuto + ":" 
                                   + segundo;
   document.getElementById("data").innerHTML = ""+ dia+"/"+mes+"/"+tDate.getFullYear();
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

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