

/*  --------------------------------------------------------

    Listener to string multiple functions together at 
    page load.

 -------------------------------------------------------- */

function addLoadListener (func) {
	
	if( typeof window.addEventListener != 'undefined' ) {
		window.addEventListener('load', func, false);
	} else if( typeof document.addEventListener != 'undefined' ) {
		document.addEventListener('load', func, false);
	} else if( typeof window.attachEvent != 'undefined' ) {
		window.attachEvent('onload', func);
	} else {
		var oldfunc = window.onload;
		if( typeof window.onload != 'function' ) {
			window.onload = func;
		} else {
			window.onload = function() {
				oldfunc();
				func();
			};
		}		
	}
	
}

/* Date */
function fWriteDate(){
	var dt = new Date();
	var d = "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|");
	var m = "January|February|March|April|May|June|July|August|September|October|November|December".split("|");
	var t = "|st|nd|rd|th".split("|");
	var c = dt.getDate();
	var e = c%10;
	var f = Math.floor(c/10);
// Add suffix to date (1st, 2nd, 4th, etc.)
if (c==1) suffix=("st");
else if (c==2) suffix=("nd");
else if (c==3) suffix=("rd");
else if (c==21) suffix=("st");
else if (c==22) suffix=("nd");
else if (c==23) suffix=("rd");
else if (c==31) suffix=("st");
else suffix=("th");
	document.write(d[dt.getDay()].bold()+" "+c+""+suffix+" "+m[dt.getMonth()]+" "+dt.getFullYear());
}