/*-------- - - - - - - - - - - - - - - - - - - - - -
Title : 				fazeupdate.js
Author : 				fazespace
URL : 					www.fazespace.com
Description : 			provides last updated date in paragraph appended to footer

Created : 				17th January 2007
- - - - - - - - - - - - - - - - - - - - - ---------*/

function takeYear(theDate) {
var x = theDate.getFullYear(); 
var y = x % 100; 
y += (y < 38) ? 2000 : 1900; 
return y; 
}

function nths(day) {
if (day == 1 || day == 21 || day == 31) return 'st'; 
if (day == 2 || day == 22) return 'nd';
if (day == 3 || day == 23) return 'rd'; 
return 'th';
}

function date() {
if (!document.getElementsByTagName) {
return null;
} else { 
var x = new Date(document.lastModified); 
var Modif = new Date(x.toGMTString());
var days = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
var datetowrite = 'Last updated on ' + days[Modif.getDay()] + ' ' + months[Modif.getMonth()] + ' ' + Modif.getDate() + nths(Modif.getDate()) + ' ' + takeYear(Modif) + '.';
var newPara = document.createElement('p');
var newDate = document.createTextNode(datetowrite);
newPara.appendChild(newDate);
document.getElementById("footer").appendChild(newPara);
}}




function addLoadEvent(func) {
var oldonload = window.onload;
	if (typeof window.onload != 'function') {
	window.onload = func;
	} else {
	window.onload = function() {
	if (oldonload) {
	oldonload();
	}
func();
}}}

addLoadEvent(date);
