var rollover = function (li){
	var content = li.getElementsByTagName("ul");
	var a = li.getElementsByTagName("a");
	content[0].style.display = "block";
	content[0].style.position = "relative";
	content[0].style.zIndex = "100000000";
	content[0].style.left = "2px";

	if(li.id == "itemservices"){
		content[0].style.marginLeft = "-171px";
	} else if(li.id == "itemthemes"){
		content[0].style.marginLeft = "-168px";
	}

	if(a[0].className != "actif"){
		if(li.id == "itemscience"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_sciences.jpg\") no-repeat top left";
		} else if(li.id == "itemtechno"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_techno.jpg\") no-repeat top left";
		} else if(li.id == "itemhabitat"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_habitat.jpg\") no-repeat top left";
		} else if(li.id == "itemenvironnement"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_environnement.jpg\") no-repeat top left";
		} else if(li.id == "itemsante"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_sante.jpg\") no-repeat top left";
		} else if(li.id == "itemthemes"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_themes.jpg\") no-repeat top left";
		} else if(li.id == "itemservices"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b4_services.jpg\") no-repeat top left";
		}
	} else {
		if(li.id == "itemscience"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_sciences.jpg\") no-repeat top left";
		} else if(li.id == "itemtechno"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_techno.jpg\") no-repeat top left";
		} else if(li.id == "itemhabitat"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_habitat.jpg\") no-repeat top left";
		} else if(li.id == "itemenvironnement"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_environnement.jpg\") no-repeat top left";
		} else if(li.id == "itemsante"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_sante.jpg\") no-repeat top left";
		} else if(li.id == "itemthemes"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_themes.jpg\") no-repeat top left";
		} else if(li.id == "itemservices"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/ho/b3_services.jpg\") no-repeat top left";
		}
	}
	return false;
}

var hidemenu = function (li){
	var content = li.getElementsByTagName("ul");
	var a = li.getElementsByTagName("a");
	if(a[0].className != "actif"){
		if(li.id == "itemscience"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_sciences.jpg\") no-repeat top left";
		} else if(li.id == "itemtechno"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_techno.jpg\") no-repeat top left";
		} else if(li.id == "itemhabitat"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_habitat.jpg\") no-repeat top left";
		} else if(li.id == "itemenvironnement"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_environnement.jpg\") no-repeat top left";
		} else if(li.id == "itemsante"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_sante.jpg\") no-repeat top left";
		} else if(li.id == "itemthemes"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_themes.jpg\") no-repeat top left";
		} else if(li.id == "itemservices"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/no/b1_services.jpg\") no-repeat top left";
		}
	}else{
		if(li.id == "itemscience"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_sciences.jpg\") no-repeat top left";
		} else if(li.id == "itemtechno"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_techno.jpg\") no-repeat top left";
		} else if(li.id == "itemhabitat"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_habitat.jpg\") no-repeat top left";
		} else if(li.id == "itemenvironnement"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_environnement.jpg\") no-repeat top left";
		} else if(li.id == "itemsante"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_sante.jpg\") no-repeat top left";
		} else if(li.id == "itemthemes"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_themes.jpg\") no-repeat top left";
		} else if(li.id == "itemservices"){
			a[0].style.background = "white url(\"/fileadmin/templates/v4/bg/menuhaut/act/b2_services.jpg\") no-repeat top left";
		}
	}

	content[0].style.display = "none";
	return false;
}


var rollover2 = function (li){
	li.style.paddingLeft = "23px";
	li.style.width = "257px";
	li.style.cursor = "pointer";
	li.style.borderLeftWidth = "12px";
	if(li.className == "themes" || li.className == "themes sante first" || li.className == "themes techno first" || li.className == "themes habitat first"  || li.className == "themes sante" || li.className == "themes techno" || li.className == "themes habitat")
	{
		li.style.width = "237px";
		li.style.paddingLeft = "43px";
		li.style.backgroundPosition = "10px 10px";
	}
}

var hide2 = function (li){
	li.style.borderLeftWidth = "2px";
	li.style.paddingLeft = "33px";
	li.style.width = "257px";
	li.style.cursor = "normal";
	if(li.className == "themes" || li.className == "themes sante first" || li.className == "themes techno first" || li.className == "themes habitat first"  || li.className == "themes sante" || li.className == "themes techno" || li.className == "themes habitat")
	{
		li.style.width = "237px";
		li.style.paddingLeft = "53px";
		li.style.backgroundPosition = "20px 10px";
	}
}

var navigate = function (li){
	var a = li.getElementsByTagName("a");
	document.location.href = a[0].href;
}

var clickmenuleft = function (link){

	var imglink = link.getElementsByTagName("img");

	if(link.className == "sciencesmoins") {
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/psciencesp.gif";
		link.className = "sciencesplus";
	} else if(link.className == "sciencesplus") {
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/psciencesm.gif";
		link.className = "sciencesmoins";
	} else if(link.className == "technomoins"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/ptechnop.gif";
		link.className = "technoplus";
	} else if(link.className == "technoplus"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/ptechnom.gif";
		link.className = "technomoins";
	} else if(link.className == "habitatmoins"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/phabitatp.gif";
		link.className = "habitatplus";
	} else if(link.className == "habitatplus"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/phabitatm.gif";
		link.className = "habitatmoins";
	} else if(link.className == "environnementmoins"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/penvp.gif";
		link.className = "environnementplus";
	} else if(link.className == "environnementplus"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/penvm.gif";
		link.className = "environnementmoins";
	} else if(link.className == "santemoins"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/psantep.gif";
		link.className = "santeplus";
	} else if(swapped == 0 && link.className == "santeplus"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/psantem.gif";
		link.className = "santemoins";
	} else if(link.className == "servicesmoins"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/pservp.gif";
		link.className = "servicesplus";
	} else if(swapped == 0 && link.className == "servicesplus"){
		imglink[0].src = "/fileadmin/templates/v4/bg/menugauche/pictos/pservm.gif";
		link.className = "servicesmoins";
	}
	
	var li = link.parentNode
	var ul = li.getElementsByTagName("ul");
	if(ul[0].style.display == "block" || ul[0].style.display == ""){
		ul[0].style.display = "none";
	} else {
		ul[0].style.display = "block";
	}

	return false;
}