var y = 2012;
var m = 5;
var mm = 'May';
var d = 21;
var h = 00;
var n = 31;
var s = 20;
var apm = '';
document.write('
');
changeTime();
function changeTime()
{
if(s<59) s++;
else if(n<59) { s=0; n++; }
else if(h<23) { s=0; n=0; h++; }
else if(d=12)
{
h2=h-13;
apm = 'PM';
}
else h2=h;
if(h2==0) h2=12;
n=leadZero(n);
s=leadZero(s);
document.getElementById("dateTime").innerHTML=mm+' '+d+', '+y+' '+h2+':'+n+':'+s+' '+apm;
}
function leadZero(x)
{
if(String(x).length==1) return '0'+x;
else return x;
}