monthArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
theDate = new Date();
var theYear = theDate.getYear();
theYear  = (theYear<1000)?theYear+1900:theYear;
theDateString = monthArray[theDate.getMonth()] + " " + theDate.getDate() + ", " + theYear;
theHours=theDate.getHours();
theMinutes=theDate.getMinutes();

if (theHours>24)
{
theDayPart="am";
theHours=theHours-24;
}
else if (theHours>12)
{
theDayPart="pm";
theHours=theHours-12;
}
else if (theHours==12)
{
theDayPart="pm";
}
else if (theHours==0)
{
theHours=theHours+12;
theDayPart="am";
}
else if (theHours==24)
{
theHours=theHours-12;
theDayPart="am";
}
else
{
theHours=theHours;
theDayPart="am";
}
if (theMinutes<10)
{
theMinutes="0" + theMinutes;
}
document.write("<table cellpadding='0' cellspacing='0' border='0'>");
document.write ("<tr><td align='right'><b>" + theDateString + "</b></td></tr>");
document.write ("<tr><td align='right'><b>" + theHours + ":" + theMinutes + " " + theDayPart + "</b></td></tr>");
document.write ("</table>");