// JavaScript designed by davidHarris http://mediarevolutionary.com
// all rights to JavaScript copyleft non-commercial with attribution to davidHarris

// this script uses images to highlight rollover state and current page 
// uses full address for placement at any level, 
// consider var homeAddress = h; to simplify



function mouseOver(b) { // when mouse over, highlight image loaded
	document.getElementById(b).src="http://playingwithknobs.us/images/"+b+"On.png"; 
	trail(); // checks for current page and highlights nav button
}
function mouseOut(b) { // when mouse out, resets to original image, non-active state
	document.getElementById(b).src="http://playingwithknobs.us/images/"+b+".png"; 
	trail(); // checks for current page and highlights nav button
}
function trail() { // uses location.pathname to detect current page and highlight appropriate nav button
	p=location.pathname;
	switch(p) {
		case"/index.php": case"/": // if on thesepages, this nav button highlighted
			document.getElementById("playerButton").src="http://playingwithknobs.us/images/playerButtonOn.png";
			break // move on to other business
		case"/photos.php":
			document.getElementById("photosButton").src="http://playingwithknobs.us/images/photosButtonOn.png";
			break
		case"/about.php":
			document.getElementById("aboutButton").src="http://playingwithknobs.us/images/aboutButtonOn.png";
			break
		case"/blog/":
			document.getElementById("blogButton").src="http://playingwithknobs.us/images/blogButtonOn.png";
			break
		case"/download.php": case"/register.php": case"/donate.php":
			document.getElementById("downloadButton").src="http://playingwithknobs.us/images/downloadButtonOn.png";
			break
		case"/contact.php":
			document.getElementById("contactButton").src="http://playingwithknobs.us/images/contactButtonOn.png";
			break
	}
}

