var pageLoaded = false;

// Main level navigation
aboutusOff = new Image(); aboutusOff.src=contextPath+"/common/images/tophor/about.gif";
aboutusOn = new Image(); aboutusOn.src=contextPath+"/common/images/tophor/about-on.gif";
productsOff = new Image(); productsOff.src=contextPath+"/common/images/tophor/what.gif";
productsOn = new Image(); productsOn.src=contextPath+"/common/images/tophor/what-on.gif";
researchOff = new Image(); researchOff.src=contextPath+"/common/images/tophor/structure.gif";
researchOn = new Image(); researchOn.src=contextPath+"/common/images/tophor/structure-on.gif";
pipelineOff = new Image(); pipelineOff.src=contextPath+"/common/images/tophor/services.gif";
pipelineOn = new Image(); pipelineOn.src=contextPath+"/common/images/tophor/services-on.gif";
newsOff = new Image(); newsOff.src=contextPath+"/common/images/tophor/products.gif";
newsOn = new Image(); newsOn.src=contextPath+"/common/images/tophor/products-on.gif";
irOff = new Image(); irOff.src=contextPath+"/common/images/tophor/useful.gif";
irOn = new Image(); irOn.src=contextPath+"/common/images/tophor/useful-on.gif";
//careersOff = new Image(); careersOff.src=contextPath+"/common/images/tophor/enquires.gif";
//careersOn = new Image(); careersOn.src=contextPath+"/common/images/tophor/enquires-on.gif";

// About Section Vertical
aboutushomeNavOff = new Image(); aboutushomeNavOff.src=contextPath+"/aboutus/images/topver/about-us-home.gif";
aboutushomeNavOn = new Image(); aboutushomeNavOn.src=contextPath+"/aboutus/images/topver/about-us-home-on.gif";
mgmtNavOff = new Image(); mgmtNavOff.src=contextPath+"/aboutus/images/topver/mission.gif";
mgmtNavOn = new Image(); mgmtNavOn.src=contextPath+"/aboutus/images/topver/mission-on.gif";
objNavOff = new Image(); objNavOff.src=contextPath+"/aboutus/images/topver/object.gif";
objNavOn = new Image(); objNavOn.src=contextPath+"/aboutus/images/topver/object-on.gif";
corpoverviewNavOff = new Image(); corpoverviewNavOff.src=contextPath+"/aboutus/images/topver/corporate.gif";
corpoverviewNavOn = new Image(); corpoverviewNavOn.src=contextPath+"/aboutus/images/topver/corporate-on.gif";
comminvolvNavOff = new Image(); comminvolvNavOff.src=contextPath+"/aboutus/images/topver/management.gif";
comminvolvNavOn = new Image(); comminvolvNavOn.src=contextPath+"/aboutus/images/topver/management-on.gif";
//alliancesNavOff = new Image(); alliancesNavOff.src=contextPath+"/aboutus/images/topver/nav-alliances.gif";
//alliancesNavOn = new Image(); alliancesNavOn.src=contextPath+"/aboutus/images/topver/nav-alliances-on.gif";
//viewsNavOff = new Image(); viewsNavOff.src=contextPath+"/aboutus/images/topver/nav-views.gif";
//viewsNavOn = new Image (); viewsNavOn.src=contextPath+"/aboutus/images/topver/nav-views-on.gif";
//diverseNavOff = new Image(); diverseNavOff.src=contextPath+"/aboutus/images/topver/nav-diverse.gif";
//diverseNavOn = new Image(); diverseNavOn.src=contextPath+"/aboutus/images/topver/nav-diverse-on.gif";
//supplierrelationsNavOff = new Image(); supplierrelationsNavOff.src=contextPath+"/aboutus/images/topver/nav-supplier-relations.gif";
//supplierrelationsNavOn = new Image(); supplierrelationsNavOn.src=contextPath+"/aboutus/images/topver/nav-supplier-relations-on.gif";

// Products Section Vertical
productshomeNavOff = new Image(); productshomeNavOff.src=contextPath+"/whatsnew/images/topver/press.gif";
productshomeNavOn = new Image(); productshomeNavOn.src=contextPath+"/whatsnew/images/topver/press-on.gif";
diseducNavOff = new Image(); diseducNavOff.src=contextPath+"/structure/images/topver/bsu.gif";
diseducNavOn = new Image(); diseducNavOn.src=contextPath+"/structure/images/topver/bsu-on.gif";
//patprofNavOff = new Image(); patprofNavOff.src=contextPath+"/structure/images/topver/incubator.gif";
//patprofNavOn = new Image(); patprofNavOn.src=contextPath+"/structure/images/topver/incubator-on.gif";
patasprogNavOff = new Image(); patasprogNavOff.src=contextPath+"/structure/images/topver/tcm.gif";
patasprogNavOn = new Image(); patasprogNavOn.src=contextPath+"/structure/images/topver/tcm-on.gif";

// Research Section Vertical
researchhomeNavOff = new Image(); researchhomeNavOff.src=contextPath+"/structure/images/topver/incubation.gif";
researchhomeNavOn = new Image(); researchhomeNavOn.src=contextPath+"/structure/images/topver/incubation-on.gif";
ourvisionNavOff = new Image(); ourvisionNavOff.src=contextPath+"/structure/images/topver/bsu.gif";
ourvisionNavOn = new Image(); ourvisionNavOn.src=contextPath+"/structure/images/topver/bsu-on.gif";
focusareasNavOff = new Image(); focusareasNavOff.src=contextPath+"/structure/images/topver/gmpcon.gif";
focusareasNavOn = new Image(); focusareasNavOn.src=contextPath+"/structure/images/topver/gmpcon-on.gif";
biotechnologyNavOff = new Image(); biotechnologyNavOff.src=contextPath+"/structure/images/topver/tcm.gif";
biotechnologyNavOn = new Image(); biotechnologyNavOn.src=contextPath+"/structure/images/topver/tcm-on.gif";
researcherProfilesNavOff = new Image(); researcherProfilesNavOff.src=contextPath+"/structure/images/topver/tcm.gif";
researcherProfilesNavOn = new Image(); researcherProfilesNavOn.src=contextPath+"/structure/images/topver/tcm-on.gif";
//reviewboardNavOff = new Image(); reviewboardNavOff.src=contextPath+"/structure/images/topver/nav-resource-board.gif";
//reviewboardNavOn = new Image(); reviewboardNavOn.src=contextPath+"/structure/images/topver/nav-resource-board-on.gif";
//fellowshipNavOff = new Image(); fellowshipNavOff.src=contextPath+"/structure/images/topver/nav-fellowship.gif";
//fellowshipNavOn = new Image(); fellowshipNavOn.src=contextPath+"/structure/images/topver/nav-fellowship-on.gif";
//postdoctoralNavOff = new Image(); postdoctoralNavOff.src=contextPath+"/structure/images/topver/nav-postdoctoralprogram.gif";
//postdoctoralNavOn = new Image(); postdoctoralNavOn.src=contextPath+"/structure/images/topver/nav-postdoctoralprogram-on.gif";
//fellowshipNavOff = new Image(); fellowshipNavOff.src=contextPath+"/structure/images/topver/nav-fellowship.gif";
//fellowshipNavOn = new Image(); fellowshipNavOn.src=contextPath+"/structure/images/topver/nav-fellowship-on.gif";

// Pipeline Section Vertical
testNavOff = new Image(); testNavOff.src=contextPath+"/services/images/topver/incubation.gif";
testNavOn = new Image (); testNavOn.src=contextPath+"/services/images/topver/incubation-on.gif";
medicinedevNavOff = new Image(); medicinedevNavOff.src=contextPath+"/services/images/topver/bsu.gif";
medicinedevNavOn = new Image (); medicinedevNavOn.src=contextPath+"/services/images/topver/bsu-on.gif";
clintriNavOff = new Image(); clintriNavOff.src=contextPath+"/services/images/topver/gmpcon.gif";
clintriNavOn = new Image(); clintriNavOn.src=contextPath+"/services/images/topver/gmpcon-on.gif";
trieduNavOff = new Image(); trieduNavOff.src=contextPath+"/services/images/topver/tcm.gif";
trieduNavOn = new Image(); trieduNavOn.src=contextPath+"/services/images/topver/tcm-on.gif";

// News Section Vertical
newsroomhomeNavOff = new Image(); newsroomhomeNavOff.src=contextPath+"/products/images/topver/lifeart.gif";
newsroomhomeNavOn = new Image(); newsroomhomeNavOn.src=contextPath+"/products/images/topver/lifeart-on.gif";
pressNavOff = new Image(); pressNavOff.src=contextPath+"/products/images/topver/eshop.gif";
pressNavOn = new Image(); pressNavOn.src=contextPath+"/products/images/topver/eshop-on.gif";

// Investors Section Vertical
investorshomeNavOff = new Image(); investorshomeNavOff.src=contextPath+"/useful/images/topver/useful-home.gif";
investorshomeNavOn = new Image(); investorshomeNavOn.src=contextPath+"/useful/images/topver/useful-home-on.gif"
calendarofeventsNavOff = new Image(); calendarofeventsNavOff.src=contextPath+"/useful/images/topver/official.gif";
calendarofeventsNavOn = new Image(); calendarofeventsNavOn.src=contextPath+"/useful/images/topver/official-on.gif"
contactsNavOff = new Image(); contactsNavOff.src=contextPath+"/useful/images/topver/cucamed.gif";
contactsNavOn = new Image(); contactsNavOn.src=contextPath+"/useful/images/topver/cucamed-on.gif";
corpgovNavOff = new Image(); corpgovNavOff.src=contextPath+"/useful/images/topver/ddc.gif";
corpgovNavOn = new Image(); corpgovNavOn.src=contextPath+"/useful/images/topver/ddc-on.gif"
edeliveryNavOff = new Image(); edeliveryNavOff.src=contextPath+"/useful/images/topver/nav-edelivery.gif";
edeliveryNavOn = new Image(); edeliveryNavOn.src=contextPath+"/useful/images/topver/nav-edelivery-on.gif";
//emailalertsNavOff = new Image(); emailalertsNavOff.src=contextPath+"/ir/images/subnav/nav-e-mail-alerts.gif";
//emailalertsNavOn = new Image(); emailalertsNavOn.src=contextPath+"/ir/images/subnav/nav-e-mail-alerts-on.gif";
//factsheetNavOff = new Image(); factsheetNavOff.src=contextPath+"/ir/images/subnav/nav-fact-sheet.gif";
//factsheetNavOn = new Image(); factsheetNavOn.src=contextPath+"/ir/images/subnav/nav-fact-sheet-on.gif";
//faqNavOff = new Image(); faqNavOff.src=contextPath+"/ir/images/subnav/nav-faqs.gif";
//faqNavOn = new Image(); faqNavOn.src=contextPath+"/ir/images/subnav/nav-faqs-on.gif";
//financialsNavOff = new Image(); financialsNavOff.src=contextPath+"/ir/images/subnav/nav-financials.gif";
//financialsNavOn = new Image(); financialsNavOn.src=contextPath+"/ir/images/subnav/nav-financials-on.gif";
//litrequestsNavOff = new Image(); litrequestsNavOff.src=contextPath+"/ir/images/subnav/nav-literature-requests.gif";
//litrequestsNavOn = new Image(); litrequestsNavOn.src=contextPath+"/ir/images/subnav/nav-literature-requests-on.gif";

//secfilingsNavOff = new Image(); secfilingsNavOff.src=contextPath+"/ir/images/subnav/nav-sec-filings.gif";
//secfilingsNavOn = new Image(); secfilingsNavOn.src=contextPath+"/ir/images/subnav/nav-sec-filings-on.gif"
//stockNavOff = new Image(); stockNavOff.src=contextPath+"/ir/images/subnav/nav-stock-info.gif";
//stockNavOn = new Image(); stockNavOn.src=contextPath+"/ir/images/subnav/nav-stock-info-on.gif";


// Careers Section Vertical 
//careershomeNavOff = new Image(); careershomeNavOff.src=contextPath+"/enquiries/images/topver/nav-careers-home.gif";
//careershomeNavOn = new Image(); careershomeNavOn.src=contextPath+"/enquiries/images/topver/nav-careers-home-on.gif"
//jobpostNavOff = new Image(); jobpostNavOff.src=contextPath+"/enquiries/images/topver/nav-job-postings.gif";
//jobpostNavOn = new Image(); jobpostNavOn.src=contextPath+"/enquiries/images/topver/nav-job-postings-on.gif";
//cultureNavOff = new Image(); cultureNavOff.src=contextPath+"/enquiries/images/topver/nav-culture.gif";
//cultureNavOn = new Image(); cultureNavOn.src=contextPath+"/enquiries/images/topver/nav-culture-on.gif";
//benefitsNavOff = new Image(); benefitsNavOff.src=contextPath+"/enquiries/images/topver/nav-benefits.gif";
//benefitsNavOn = new Image(); benefitsNavOn.src=contextPath+"/enquiries/images/topver/nav-benefits-on.gif";
//valNavOff = new Image(); valNavOff.src=contextPath+"/enquiries/images/topver/nav-values.gif";
//valNavOn = new Image(); valNavOn.src=contextPath+"/enquiries/images/topver/nav-values-on.gif";
//natconfNavOff = new Image(); natconfNavOff.src=contextPath+"/enquiries/images/topver/nav-natconf.gif";
//natconfNavOn = new Image(); natconfNavOn.src=contextPath+"/enquiries/images/topver/nav-natconf-on.gif";
//collprogNavOff = new Image(); collprogNavOff.src=contextPath+"/enquiries/images/topver/nav-coll-prog.gif";
//collprogNavOn = new Image(); collprogNavOn.src=contextPath+"/enquiries/images/topver/nav-coll-prog-on.gif";
//mbaNavOff = new Image(); mbaNavOff.src=contextPath+"/enquiries/images/topver/nav-mba.gif";
//mbaNavOn = new Image(); mbaNavOn.src=contextPath+"/enquiries/images/topver/nav-mba-on.gif";

function loadProc() {
	pageLoaded = true;
}

function img_act(img) {
	document[img].src = eval(img + "On").src;
}

function img_inact(img) {
	document[img].src = eval(img + "Off").src;
}

function showLayer(layername) {
	if (pageLoaded) {
		if (document.all){
			document.all[layername].style.visibility = "visible";
		}
		else if (document.layers){
	 		document.layers[layername].visibility = "visible";
		}
		else {
			var myLayer = document.getElementById(layername);
			myLayer.style.visibility = "visible";
		}
	}
}

function hideLayer(layername) {
	if (pageLoaded) {
		if (document.all){
			document.all[layername].style.visibility = "hidden";
		}
		else if (document.layers){
			document.layers[layername].visibility = "hidden";
		}
		else {
			var myLayer = document.getElementById(layername);
			myLayer.style.visibility = "hidden";
		}
	}
}

var blnReset = false;
var defaultSubnav = "emptySubnav";
var currImage = "";
var currLayer = "";

function showtopnav(menuname)
{
	resettopnav(menuname);
	currLayer = menuname + "Subnav";
	showLayer(menuname+'Subnav');
	showLayer('resetSubnav');
	img_act_nav(menuname, "topNav");
	clearreset();
}
function resettopnav()
{
	if (currLayer != "") {
		hideLayer(currLayer);
	}
	if ((currImage != "") && (currImage + "Subnav" != defaultSubnav)) {
		img_inact_nav(currImage, "topNav");
	}
	showLayer("emptySubnav");
	clearreset();
}
function settimedreset()
{
	hideLayer('resetSubnav');
	blnReset = true;
	resetTimeout = setTimeout('timedresetnav()', 1000);
}
function timedresetnav()
{
	if(blnReset)
	{
		resettopnav();
	}
}
function clearreset()
{
	if(blnReset) window.clearTimeout(resetTimeout);
	blnReset = false;
}
function img_inact_nav(imagename,layername)
{
	if (document.layers){
		document.layers[layername].document.images[imagename].src = eval(imagename + 'Off.src')
	}else{
		document [imagename].src = eval(imagename + 'Off.src')
	}
	if (layername == "topNav") {
		currImage = "";
	}
	clearreset();
}
function img_act_nav(imagename,layername)
{
	if (document.layers){
		document.layers[layername].document.images[imagename].src = eval(imagename + 'On.src')
	}else{
		document [imagename].src = eval(imagename + 'On.src')
	}
	if (layername == "topNav") {
		currImage = imagename;
	}
	showLayer('resetSubnav');
	clearreset();
}

