// 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;


navAboutOn = new Image();
navAboutOn.src = "images/nav_1_on.gif";
navAboutOff = new Image();
navAboutOff.src = "images/nav_1.gif";

navPreviewOn = new Image();
navPreviewOn.src = "images/nav_2_on.gif";
navPreviewOff = new Image();
navPreviewOff.src = "images/nav_2.gif";

navPraiseOn = new Image();
navPraiseOn.src = "images/nav_3_on.gif";
navPraiseOff = new Image();
navPraiseOff.src = "images/nav_3.gif";

navPressOn = new Image();
navPressOn.src = "images/nav_4_on.gif";
navPressOff = new Image();
navPressOff.src = "images/nav_4.gif";

navBlogOn = new Image();
navBlogOn.src = "images/nav_5_on.gif";
navBlogOff = new Image();
navBlogOff.src = "images/nav_5.gif";

navBuyOn = new Image();
navBuyOn.src = "images/nav_6_on.gif";
navBuyOff = new Image();
navBuyOff.src = "images/nav_6.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";
			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');
}

function swapimages(which1,what1,which2,what2){
document.getElementById(''+which1+'').src=''+what1+'';
document.getElementById(''+which2+'').src=''+what2+'';
}

