
// Note: Wouldn't need the Case statement if the image names matched the body id names
//  but can't have too id's the same - could capitalise or some such...

var bodyRef;
var targetImg;

function initMenu (){

	bodyRef = document.getElementsByTagName('body')[0].id;

	switch (bodyRef) {
	case 'about':			targetImg='about_btn'; break;
	case 'solutions':		targetImg='solutions_btn'; break;
	case 'testimonials':	targetImg='testimonials_btn'; break;
	case 'tools':			targetImg='tools_btn'; break;
	case 'contact':			targetImg='contact_btn'; break;
	default:targetImg='Home';
	}

	if(targetImg != 'Home') { // No Home Button - also no News etc....
		document[targetImg].src = "/images/common/"+targetImg+"_on.gif";
	}

}

function swapImage(imagename, dir){

var imagein = document[imagename].src;
var pos = imagein.lastIndexOf("_");
var onoff = imagein.substr((pos+1),2);

if (imagename != targetImg) {
	if (onoff == "on"){
	imagesource = "/images/" + dir + imagename + "_off.gif";
	}
	else{
	imagesource = "/images/" + dir + imagename + "_on.gif";
	}
	document[imagename].src = imagesource;
}

}


function openSubMenu(menu){

if (menu == "about") {
	document.getElementById("aboutmenu").style.top = 20;
}
if (menu == "solutions") {
	document.getElementById("solmenu").style.top = 20;
}
if (menu == "tools") {
	document.getElementById("toolsmenu").style.top = 20;
}

}


function closeSubMenu(menu){

if (menu == "about") {
	document.getElementById("aboutmenu").style.top = -1000;
}
if (menu == "solutions") {
	document.getElementById("solmenu").style.top = -1000;
}
if (menu == "tools") {
	document.getElementById("toolsmenu").style.top = -1000;
}

}