var isn1=null;
var isn2=false;
today=new Date();
function stopit(){
 if(isn2){
  clearTimeout(isn1);
  }
 isn2 = false;
 }
function startit(){
 stopit();
 isnclock();
 }
function isnclock(){
 var now=new Date();
 var hrs=now.getHours();
 var min=now.getMinutes();
 var sec=now.getSeconds();
 document.clckh.disp.value=""+((hrs>12) ? hrs-12 : hrs); 
 document.clckm.disp.value=((min<10) ? "0" : "")+min;
 document.clcks.disp.value=((sec<10) ? "0" : "")+sec;
 document.clck.disp.value=(hrs>=12) ? "p.m." : "a.m.";
 isn1=setTimeout("isnclock()",1000);
 isn2=true;
 }
// Build an array initializer
function isnArray() {
 argnr=isnArray.arguments.length
 for (var i=0;i<argnr;i++) {
  this[i] = isnArray.arguments[i];
  }
 }
// And months and day arrays
var isnMonths=new isnArray("","01","02","03","04","05","06","07","08","09","10","11","12");
var isnDays= new isnArray("Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy");
var iYear=today.getYear(), app=navigator.appName;
if (app.indexOf('Netscape') != -1) {
  iYear = iYear + 1900;
} else if (app.indexOf('Microsoft') != -1) {
  iYear = iYear;
} else {
  iYear = iYear + 1900;
}
document.write(isnDays[today.getDay()]+", "+today.getDate()+"-"+isnMonths[today.getMonth()+1] +"-" +iYear);