/* 
A javascript clock formatted: "15th August 2008 12.50.12 BST" 

Created by: Syd Lawrence:: http://www.kidsyd.com/ 
Copyright 2008, 2009 by Syd Lawrence.
*/

	var months = ["January","February","March","April","May","June","July","August", "September", "October", "November", "December" ]		
	function clock() {
		tdate = new Date()
		
		year = tdate.getFullYear()
		
		day = tdate.getDate()
		dayString = "th"
		if (day == 1 || day == 21 || day == 31)
			dayString = "st"
		if (day == 2 || day == 22)
			dayString = "nd"
		if (day == 3 || day == 23)
			dayString = "rd"
		month = tdate.getMonth()
		year = tdate.getFullYear()
		
		hours = tdate.getHours()
		if (hours < 10)
			hours = "0" + hours;
		minutes = tdate.getMinutes()
		if (minutes < 10)
			minutes = "0" + minutes;
		seconds = tdate.getSeconds()
		if (seconds < 10)
			seconds = "0" + seconds;
		string = tdate.toString()
		
		time = day+dayString+" " + months[month] + " " + year + " " + hours + "." + minutes + "." + seconds
		
		
		document.getElementById("clock").innerHTML = time
		setTimeout("clock()", 500);
	}
