// Java Document
function RealClock()
{
var dt=new Date();
var my_date= dt.getDate();
// Let us identify the format to display the date
// we have to add 'st' if it is 1, 'nd' to be added for 2 and 'rd' for 3 and 'th' for other
// let us find out the last digit of the date number
var last_digit= my_date % 10; // divide by 10 and use the quotient
var format;

if	(last_digit==1) 
	format="st";
else 
if	(last_digit==2)
	format="nd";
else
if	(last_digit==3)
	format="rd";
else
format="th";

if (my_date==11)
	format="th";

if (my_date==12)
	format="th";

if (my_date==13)
	format="th";

my_date=my_date + format;
// End of identifying date format

//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var dayname=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");

//ensure correct for language "1 January, 2008"
var myDate=new Date();
var myHours=myDate.getHours();
var myMinutes=myDate.getMinutes();
var mySeconds=myDate.getSeconds();

// if hours less than zero then pad with a "0"
if (myHours<10)
		myHours="0" + myHours;

// if minutes less than zero then pad with a "0"
if (myMinutes<10)
		myMinutes="0" + myMinutes;

// if seconds less than zero then pad with a "0"
if (mySeconds<10)
		mySeconds="0" + mySeconds;
		
var TODAY = dayname[d.getDay()] + ", " + d.getDate() + format + " " + monthname[d.getMonth()] + " " + d.getFullYear();
var TIME = myHours + ":" + myMinutes + ":" + mySeconds;
//---------------   END LOCALIZEABLE   ---------------

// write date and time
// variable id=basicDateTime (see the location for the clock in the HTML document)
//document.getElementById("basicDateTime").innerHTML=TODAY + TIME;
document.getElementById("basicDate").innerHTML=TODAY;
document.getElementById("basicTime").innerHTML=TIME;

// set clock to update every second
setTimeout("RealClock()", 1000);
}
// start clock 
RealClock();
