// JavaScript Document
theDate = new Date();
timeDate = new Date();
theDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
theMonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
function doDate(){
thisDay = theDays[theDate.getDay()]
thisMonth = theMonths[theDate.getMonth()]
thisYear = theDate.getFullYear();
theDate = theDate.getDate()
strDate = String(theDate)
lastChar = strDate.charAt(strDate.length-1)
suffix = "th"
if(lastChar == "1")
	{suffix = "st"}
	if(theDate == "11")
	{suffix = "th"}
if (lastChar == "2")
	{suffix = "nd"	}
if (lastChar == "3")
	{suffix = "rd"	}
	if(theDate == "13")
	{suffix = "th"}
	if(theDate == "12")
	{suffix = "th"}
sHTML = thisDay + ", " + theDate + suffix  + " " + thisMonth + ", " + thisYear
return sHTML
}

var clockID = 0;
var blink = " "
function doTime() {
if(blink==":"){

blink = " ";
}
else
{
blink = ":";
}
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
   var tDate = new Date();
   if(String(tDate.getMinutes()).length == 1){theMins = '0' + tDate.getMinutes()}else{theMins = tDate.getMinutes()}
   	strDate = String(tDate.getDate())
	lastChar = strDate.charAt(strDate.length-1)
	secondChar = strDate.charAt(strDate.length-2)
	suffix = "th"
	if(lastChar == "1" & !(secondChar=="1"))
		{suffix = "st" }
	if (lastChar == "2" & !(secondChar=="1"))
		{suffix = "nd"	}
	if (lastChar == "3" & !(secondChar=="1"))
		{suffix = "rd"	}	
								  
	document.all.printTime.innerHTML = ""
   									+ tDate.getDate() + suffix + " " 
									+ theMonths[tDate.getMonth()] + " "
                                    + tDate.getHours() + blink
                                    + theMins;
								   
    clockID = setTimeout("doTime()", 1000);
}
