function num_abbrev_str(n)
{
    return n + ["th","st","nd","rd"][!(n%10>3||Math.floor(n%100/10)==1)*n%10]; 
}


function initDate() {
	var dayName = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
	var monName = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
	
	var now = new Date();
	

	var dtString = dayName[now.getDay()] + " " + num_abbrev_str(now.getDate()) + " " + monName[now.getMonth()];
	document.getElementById("dtField").innerHTML = dtString;
}


myPix1 = new Array(
		"images/ph_museum.jpg",
		"images/ph_bridge.jpg",
		"images/ph_valley.jpg",
		"images/ph_pgl.jpg",
		"images/ph_towers.jpg",
		"images/ph_choir.jpg",
		"images/ph_girls.jpg",
		"images/ph_sport.jpg"
	)
	

altText = new Array(
		"The Museum of the Gorge",
		"The Iron Bridge",
		"Ironbridge Gorge",
		"Pupils at PGL",
		"Powerstation Cooling Towers",
		"Choir Practice",
		"Pupils Studying",
		"Sport at School"
	)

creditText = new Array(
		"Image by Jessica Spengler",
		"Image by Mark Jervis",
		"Image by Alain Rolli",
		"Image by Elaine Kenny",
		"Image by Mike Warren",
		"Image by Clare Williams",
		"Image by Geoff Cryer",
		"Image by Geoff Cryer"
	)

	
//	captionText = new Array(
		//"\"A more comprehensive tool than any other product - All for a very sensible cost\"",
		//"'Paramount in Retrospective Network Analysis' Now it's easy to 'Rewind' your network.",
		//"'High-Level Resource Monitoring for your Entire Network' Device and Route Monitoring, Network Mapping, and More..",
		//"Managed email service providing comprehensive protection required to purify business emails from threats.",
		//"A complete traffic shaping solution which gives guaranteed band-width for business critical applications.",
		//"nTaps ensure complete 'Passive' visibility into your Full-Duplex Network Links",
		//"Observer Version 12 new features Guide",
		//"Provides Traffic Prioritisation and Smart Visibility over your internet connection.",
		//"Expand your options with up to 48 Terrabytes. 'Now that's Storage'",
		//"Enterprise Strength VoIP Analysis"

	//)



	function choosePix() {
		if (document.images) {
			randomNum1 = Math.floor((Math.random() * myPix1.length))

			}

			document.getElementById("myPicture1").src = myPix1[randomNum1];
			document.getElementById("myPicture1").alt = altText[randomNum1];
			document.getElementById("imagecredit").innerHTML = creditText[randomNum1];
			//document.getElementById("captionText1").innerHTML = captionText[randomNum1];
}
	


