﻿var clockID = 0;
function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
   var tDate = new Date();

   document.getElementById("showTime").innerHTML="" 
                                   + tDate.getHours() + ":" 
                                   + tDate.getMinutes() + ":" 
                                   + tDate.getSeconds();
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}
function showDayYear()
{
var x = new Array('Chủ nhật',' Thứ 2',' Thứ 3',' Thứ 4',' Thứ 5',' Thứ 6',' Thứ 7');
var d = new Date();
var rtvalue = x[d.getDay()] + ", ngày " +d.getDate();
return rtvalue;
}
