function clock() 
{
thisDay=new Date();
hrs=thisDay.getHours();
end=(hrs<12)?'&nbsp;AM':'&nbsp;PM'; //must be on this line, before hrs is modified
hrs=(hrs==0)?12:hrs;
hrs=(hrs>12)?hrs-12:hrs;
min=thisDay.getMinutes();
min=(min<10)?'0'+min:min;
sec=thisDay.getSeconds();
sec=(sec<10)?'0'+sec:sec;
theTime=hrs+':'+min+':'+sec+end;
document.getElementById("tm").innerHTML=theTime;
TO=setTimeout("clock()",1000); //1000 milliseconds => 1 sec;
}



