function WorldClock()
{
var thetime=new Date();
var theDate=new Date();
var theDay=new Date();


var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var nday=thetime.getDay();
var nmonth=thetime.getMonth();
var ntoday=thetime.getDate();
//var nyear= thetime.getFullYear() % 1000; //two digits year variable
var nyear=thetime.getYear();// four digits year variable
var AorP=" ";

if (nhours>=12)
    AorP="pm";
else
    AorP="am";

if (nhours>=13)
    nhours-=12;

if (nhours==0)
   nhours=12;

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;

if (nday==0)
  nday="Sunday";
if (nday==1)
  nday="Monday";
if (nday==2)
  nday="Tuesday";
if (nday==3)
  nday="Wednesday";
if (nday==4)
  nday="Thursday";
if (nday==5)
  nday="Friday";
if (nday==6)
  nday="Saturday";

if (nmonth==0)
  nmonth="January";
if (nmonth==1)
  nmonth="February";
if (nmonth==2)
  nmonth="March";
if (nmonth==3)
  nmonth="April";
if (nmonth==4)
  nmonth="May";
if (nmonth==5)
  nmonth="June";
if (nmonth==6)
  nmonth="July";
if (nmonth==7)
  nmonth="August";
if (nmonth==8)
  nmonth="September";
if (nmonth==9)
  nmonth="October";
if (nmonth==10)
  nmonth="November";
if (nmonth==11)
  nmonth="December";

//nmonth+=1;

//format to two digits year
//if(nyear < 10)
//	nyear = "0" + nyear;

//format to four digits year
if (nyear<=99)
  nyear= "19"+nyear;
if ((nyear>99) && (nyear<2000))
 nyear+=1900;

//document.theClock.theTime.value= nday+" "+ntoday+"/"+nmonth+"/"+nyear+" "+nhours+":"+nmins+":"+nsecn+" "+AorP;
document.theClock.theDay.value=nday;
document.theClock.theDate.value=ntoday+" "+nmonth+" "+nyear;
document.theClock.theTime.value=nhours+":"+nmins+":"+nsecn+" "+AorP;



setTimeout('WorldClock()',1000);

} 

  function submitform()
  {
    document.theClock.submit();
  }
 window.onload=WorldClock