// Browser & Platform Variables
var platform = navigator.platform.substr(0,3);
var browser = navigator.appName;
var shortVersion = navigator.appVersion.substr(0,1);
var longVersion = navigator.appVersion;


// Variables needed for Rollovers
var over = 'no';
var whichOne = ' ';
var styleSheetElement;
var oldElement;

// Function to Assign the relative path to images and links
if (whichLevel == 0) {
	var path = '';
} else if (whichLevel == 1) {
	var path = '../';
} else if (whichLevel == 2) {
	var path = '../../';
}

navProfileOn = new Image();
navProfileOn.src = "" + path +"images/nav_1_on.gif";
navProfileOff = new Image();
navProfileOff.src = "" + path +"images/nav_1.gif";

navPortfolioOn = new Image();
navPortfolioOn.src = "" + path +"images/nav_2_on.gif";
navPortfolioOff = new Image();
navPortfolioOff.src = "" + path +"images/nav_2.gif";

navRecognitionOn = new Image();
navRecognitionOn.src = "" + path +"images/nav_3_on.gif";
navRecognitionOff = new Image();
navRecognitionOff.src = "" + path +"images/nav_3.gif";

navContactOn = new Image();
navContactOn.src = "" + path +"images/nav_4_on.gif";
navContactOff = new Image();
navContactOff.src = "" + path +"images/nav_4.gif";

aboutOn = new Image();
aboutOn.src = "" + path +"images/about_header_1_on.gif";
aboutOff = new Image();
aboutOff.src = "" + path +"images/about_header_1.gif";

servicesOn = new Image();
servicesOn.src = "" + path +"images/about_header_2_on.gif";
servicesOff = new Image();
servicesOff.src = "" + path +"images/about_header_2.gif";

peopleOn = new Image();
peopleOn.src = "" + path +"images/about_header_3_on.gif";
peopleOff = new Image();
peopleOff.src = "" + path +"images/about_header_3.gif";

awardsOn = new Image();
awardsOn.src = "" + path +"images/recognition_header_1_on.gif";
awardsOff = new Image();
awardsOff.src = "" + path +"images/recognition_header_1.gif";

pressOn = new Image();
pressOn.src = "" + path +"images/recognition_header_2_on.gif";
pressOff = new Image();
pressOff.src = "" + path +"images/recognition_header_2.gif";

addressOn = new Image();
addressOn.src = "" + path +"images/contact_header_1_on.gif";
addressOff = new Image();
addressOff.src = "" + path +"images/contact_header_1.gif";

mapOn = new Image();
mapOn.src = "" + path +"images/contact_header_2_on.gif";
mapOff = new Image();
mapOff.src = "" + path +"images/contact_header_2.gif";

careersOn = new Image();
careersOn.src = "" + path +"images/contact_header_3_on.gif";
careersOff = new Image();
careersOff.src = "" + path +"images/contact_header_3.gif";


// function that turns on the main nav graphics as well as the menus
function menuOn(pic) {
	over = 'yes';
	var layerName = pic + 'Menu';
		styleSheetElement = document.getElementById(layerName);
		if(document.images) {
			if (whichOne != ' ') {
				if (currentSection != whichOne) {
				eval('document.images[whichOne].src = ' + whichOne + 'Off.src');
				}
				whichOne = whichOne + 'Menu';
				oldElement = document.getElementById(whichOne);
				oldElement.style.visibility = "hidden";
				
			}
			styleSheetElement.style.visibility = "visible";
			if (whichLevel == 1)  {
				eval('document.images[pic].src = ' + pic + 'On.src');
			} else {
				eval('document.images[pic].src = ' + pic + 'On.src');
			}
			whichOne = layerName;		
		}
	}



// Timer function that is run to give the user time to get to the menu from the button
function overChecker(pic) {
	if ((browser == 'Netscape') && (shortVersion < 5)) {
		off(pic);		
	}
	else {
		whichOne = pic;
		over = 'no';
		setTimeout("menuOff()", 900);
	}
}

// function that turns off the main nav graphics as well as the menus
function menuOff() 
{
	if (document.images) {
		if (over == 'no')  {	
			styleSheetElement.style.visibility = "hidden";
			if (currentSection != whichOne) {
				eval('document.images[whichOne].src = ' + whichOne + 'Off.src');
			}
		}	
	}
}


// Image replace On Function	
function on(pic) {
	document.images[pic].src = eval(pic + 'On.src');
}
        

// Image replace Off Function	
function off(pic) {
	document.images[pic].src = eval(pic + 'Off.src');
}