// JavaScript Document
function initialiseHeader()
{
	if (document.images) {
		var picLocation = "";
		groundOff = new Image();
		groundOff.src = "Images/pitch.jpg"
		groundOn = new Image();
		switch(window.document.title) {
			case "Westleigh Cricket Club" :
				groundOn.src = "Images/snelly.jpg";
				picLocation = "Images/snelly2.jpg";
				break;
			case "Contact Us" :
				groundOn.src = "Images/score.jpg";
				picLocation = "Images/score2.jpg";
				break;
			case "Fixtures" :
				groundOn.src = "Images/mower.jpg";
				picLocation = "Images/mower2.jpg";
				break;
			case "Officers" :
				groundOn.src = "Images/scoreboard.jpg";
				picLocation = "Images/scoreboard2.jpg";
				break;
			case "Players" :
				groundOn.src = "Images/james.jpg";
				picLocation = "Images/james2.jpg";
				break;
			case "All Fixtures" :
				groundOn.src = "Images/john.jpg";
				picLocation = "Images/john2.jpg";
				break;
			case "First Team Fixtures" :
				groundOn.src = "Images/bob.jpg";
				picLocation = "Images/bob2.jpg";
				break;
			case "Second Team Fixtures" :
				groundOn.src = "Images/jim.jpg";
				picLocation = "Images/jim2.jpg";
				break;
			case "Friendly Fixtures" :
				groundOn.src = "Images/toby.jpg";
				picLocation = "Images/toby2.jpg";
				break;
			case "Colts Fixtures" :
				groundOn.src = "Images/dave.jpg";
				picLocation = "Images/dave2.jpg";
				break;
			case "History" :
				groundOn.src = "Images/pub.jpg";
				picLocation = "Images/pic4.jpg";
				break;
			case "Match Reports" :
				groundOn.src = "Images/pubjeff.jpg";
				picLocation = "Images/pubjeff2.jpg";
				break;	
			case "News" :
				groundOn.src = "Images/four2.jpg";
				picLocation = "Images/four.jpg";
				break;	
			default :
				groundOn.src = "Images/pitch.jpg";
				picLocation = "Images/pitch.jpg";
				break;
			}
		printHeader(picLocation);
		}
}

function initialiseNavbar()
{	if (document.images) {
		homeOn = new Image();
		homeOn.src = "Images/home2.gif";
		homeOff = new Image();
		homeOff.src = "Images/home.gif";
		playersOn = new Image();
		playersOn.src = "Images/player2.gif";
		playersOff = new Image();
		playersOff.src = "Images/player.gif";
		contactOn = new Image();
		contactOn.src = "Images/contact2.gif";
		contactOff = new Image();
		contactOff.src = "Images/contact.gif";
		fixturesOn = new Image();
		fixturesOn.src = "Images/fixtures2.gif";
		fixturesOff = new Image();
		fixturesOff.src = "Images/fixtures.gif";
		officersOn = new Image();
		officersOn.src = "Images/officers2.gif";
		officersOff = new Image();
		officersOff.src = "Images/officers.gif";
		historyOn = new Image();
		historyOn.src = "Images/history2.gif";
		historyOff = new Image();
		historyOff.src = "Images/history.gif";
		matchOn = new Image();
		matchOn.src = "Images/match2.gif";
		matchOff = new Image();
		matchOff.src = "Images/match.gif";
		newsOn = new Image();
		newsOn.src = "Images/news2.gif";
		newsOff = new Image();
		newsOff.src = "Images/news.gif";
		printNavbar();
		}
}

function printHeader(picLocation)
{
	var photoLocation = picLocation;
	document.write("<img src=\"Images/head23.jpg\" alt=\"Logo\" id=\"logo\" />");
	document.write("<img name=\"ground\" src=\"Images/pitch.jpg\" alt=\"\" id=\"headpicture\" onmouseover=\"activate(\'ground\')\" onmouseout=\"deactivate(\'ground\')\" onclick=\"displayPhoto(\'" + photoLocation + "\', \'Photo\')\"/>");
}

function printNavbar()
{	
	document.write("<a href=\"index.html\" onmouseover=\"activate(\'home\')\" onmouseout=\"deactivate(\'home\')\"><img  border=\"0\" src=\"Images/home.gif\" name=\"home\" alt=\"Home\" /></a><br />");
	document.write("<a href=\"news.html\" onmouseover=\"activate(\'news\')\" onmouseout=\"deactivate(\'news\')\"><img  border=\"0\" src=\"Images/news.gif\" name=\"news\" alt=\"News\" /></a><br />");
	document.write("<a href=\"match.html\" onmouseover=\"activate(\'match\')\" onmouseout=\"deactivate(\'match\')\"><img  border=\"0\" src=\"Images/match.gif\" name=\"match\" alt=\"Match Reports\" /></a><br />");
	document.write("<a href=\"history.html\" onmouseover=\"activate(\'history\')\" onmouseout=\"deactivate(\'history\')\"><img border=\"0\" src=\"Images/history.gif\" name=\"history\"alt=\"History\" /></a><br />");
	document.write("<a href=\"players.html\" onmouseover=\"activate(\'players\')\" onmouseout=\"deactivate(\'players\')\"><img border=\"0\" src=\"Images/player.gif\" name=\"players\" alt=\"Players\" /></a><br />");
	document.write("<a href=\"fixtures.html\" onmouseover=\"activate(\'fixtures\')\" onmouseout=\"deactivate(\'fixtures\')\"><img border=\"0\" src=\"Images/fixtures.gif\" name=\"fixtures\" alt=\"Fixtures\" /></a><br />");
	document.write("<a href=\"officers.html\" onmouseover=\"activate(\'officers\')\" onmouseout=\"deactivate(\'officers\')\"><img border=\"0\" src=\"Images/officers.gif\" name=\"officers\"alt=\"Officers\" /></a><br />");
	document.write("<a href=\"contact.html\" onmouseover=\"activate(\'contact\')\" onmouseout=\"deactivate(\'contact\')\"><img border=\"0\" src=\"Images/contact.gif\" name=\"contact\"alt=\"Contact Us\" /></a><br />");
}

function printFooter()
{
document.write("<address>This website was last updated on 08/01/2005.");
document.write("<br />Maintained by the <a href=\"mailto: crossclose@tiscali.co.uk\">Webmaster</a>.");
document.write("<br />Site Design by <a href=\"http://www.crossclose2.plus.com/cw.html\" target=\"_blank\">CW</a>.</address>");

}

function activate(image_name)
{
	if (document.images) {
		document[image_name].src = eval(image_name + "On.src");
	}
}

function deactivate(image_name)
{
	if (document.images) {
		document[image_name].src = eval(image_name + "Off.src");
	}
}

function displayPhoto(theURL,winName)
{
	window.open(theURL,winName)
}

