/*  JavaScript for MouseOver effect in the main navigation for "Race to 2025" sub-site
	By Kenji Kondo, adapted by Juergen Rohem
  	(C) 2009 Wycliffe Bibletranslators Canada Inc.      */


// Variable definitions

var imageDocID;
var imgName;
var page;


//MouseOver buttons

aboutus = new Image(150, 34);
aboutus.src = "../images/but_aboutus.gif";
aboutus2 = new Image(150, 34);
aboutus2.src = "../images/but_aboutus_ov.gif";

translation = new Image(149, 34);
translation.src = "../images/but_translation.gif";
translation2 = new Image(149, 34);
translation2.src = "../images/but_translation_ov.gif";

transform = new Image(156, 34);
transform.src = "../images/but_transform.gif";
transform2 = new Image(156, 34);
transform2.src = "../images/but_transform_ov.gif";

involved = new Image(148, 34);
involved.src = "../images/but_involved.gif";
involved2 = new Image(148, 34);
involved2.src = "../images/but_involved_ov.gif";

resources = new Image(153, 34);
resources.src = "../images/but_resources.gif";
resources2 = new Image(153, 34);
resources2.src = "../images/but_resources_ov.gif";

newsroom = new Image(147, 34);
newsroom.src = "../images/but_newsroom.gif";
newsroom2 = new Image(147, 34);
newsroom2.src = "../images/but_newsroom_ov.gif";

// MouseOver function

function Description(imageDocID,imgName) {
	if (page != imageDocID){ //MouseOver effect only for the buttons NOT indicating the current location
		document.images[imageDocID].src = eval(imgName + ".src")
		}
}

// Feedback function (Displays a "pressed" button for the current location)

function buttonfdbk(){ //Function for a feedback of the buttons
		if ((location.href.indexOf("aboutus") != -1)){ //Check if the expression "projecet" is found in the URL
			document.images.aboutus.src = "../images/but_aboutus_ov.gif"; //Dislpay the pressed button for the current page
			page = "aboutrace"; //Set var to the current location
			}
		if ((location.href.indexOf("translation") != -1)){
			document.images.translation.src = "../images/but_translation_ov.gif";
			page = "translation";
			}
		if ((location.href.indexOf("transform") != -1)){
			document.images.transform.src = "../images/but_transform_ov.gif";
			page = "transform";
			}
		if ((location.href.indexOf("involved") != -1)){
			document.images.involved.src = "../images/but_involved_ov.gif";
			page = "involved";
			}
		if ((location.href.indexOf("resources") != -1)||
			(location.href.indexOf("store") != -1)||
			(location.href.indexOf("wordalive") != -1)){
			document.images.resources.src = "../images/but_resources_ov.gif";
			page = "resources";
			}
		if ((location.href.indexOf("newsroom") != -1)){
			document.images.newsroom.src = "../images/but_newsroom_ov.gif";
			page = "newsroom";
			}
}

