

// -------------------------------------------------------------------------------------------------------------------
// Preloads and manages rollovers for all main nav images 


function preloadMenuImages() {
	if (document.images) {
			if (typeof(document.menuImages) == 'undefined'){
      document.menuImages = new Object();
    	}
    	document.menuImages.loadedImages = new Array();
    		document.menuImages.loadedImages[0] = new Image();
    		document.menuImages.loadedImages[0].src = '/images/shared/nav_home_over.gif';
    		document.menuImages.loadedImages[1] = new Image();
    		document.menuImages.loadedImages[1].src = '/images/shared/nav_company_over.gif';
    		document.menuImages.loadedImages[2] = new Image();
    		document.menuImages.loadedImages[2].src = '/images/shared/nav_technology_over.gif';
			document.menuImages.loadedImages[3] = new Image();
    		document.menuImages.loadedImages[3].src = '/images/shared/nav_industries_over.gif';
			document.menuImages.loadedImages[4] = new Image();
    		document.menuImages.loadedImages[4].src = '/images/shared/nav_products_over.gif';
			document.menuImages.loadedImages[5] = new Image();
    		document.menuImages.loadedImages[5].src = '/images/shared/nav_contact_over.gif';
	}	
}


// This function is called on page load after the main menu builds on. It checks to see what section the current page falls
// under and updates the main menu configuration to reflect this, switching the section's respective button to it's "on" state.

function updateNav (currentSection) {
	// If the page calling this script falls under one of the main sections, dpo this script.
	// Additional pages like "email.htm" don't fall under any section so current Section is set as "false on those pages.
	if (currentSection) {
		var currentSection_img = '/images/shared/nav_' + currentSection + '_on.gif';
		document.getElementById('nav_' + currentSection).src = currentSection_img;
	}
}


// This function swaps menu images when user rolls over them

function swapNavItem ( currentSection, swapSection) {
	// If the page calling this script falls under one of the main sections, dpo this script.
	// Additional pages like "email.htm" don't fall under any section so current Section is set as "false on those pages.
	if (currentSection) {	
		// If User is not mousing over the Menu Button for the section of the website that User is currently in,
		// swap the "off state" for the "on state" of the Menu Button that the User is mousing over.
		if (swapSection != currentSection) {
				var swapSection_img = '/images/shared/nav_' + swapSection + '_over.gif'
				document.getElementById('nav_' + swapSection).src = swapSection_img;	
		}
	}
 }
 
 
// This function swaps menu images back when user rolls back out

function swapNavItemBack ( currentSection, swapBackSection) {
	// If the page calling this script falls under one of the main sections, dpo this script.
	// Additional pages like "email.htm" don't fall under any section so current Section is set as "false on those pages.
	if (currentSection) {	
		// If User is not mousing out of the Menu Button for the section of the website that User is currently in,
		// swap the "on state" back to the "off state" of the Menu Button that the User is mousing out of.
		if (swapBackSection != currentSection) {
				var swapBackSection_img = '/images/shared/nav_' + swapBackSection + '_off.gif';
				document.getElementById('nav_' + swapBackSection).src = swapBackSection_img;
		}
	}
}



// -------------------------------------------------------------------------------------------------------------------
// Called at the bottom of each page, handles page initialization after document loads

function pageInit(currentSection) {
	// preload rollover images
	preloadMenuImages();	
	// Update main nav block to show the current section only if the page falls within one of the main sections.
	// Additional pages like "logIn.htm" don't fall under any section so current Section is set as "false on those pages
	if (currentSection) { updateNav(currentSection); }
	
}




// -------------------------------------------------------------------------------------------------------------------
// Press Releases page

function openPressRelease(url) { 
	popupWin = window.open(url, 'DetailWin', 'width=616,height=515,status=0,scrollbars=yes,toolbar=no,resizable=yes');
	popupWin.focus();
	if (!is_safari) { window.self.name = 'MAIN'; }
}

//-->

