function changeHeaderMetaItem(num,position,selected){
	
	elm  		= document.getElementById("header_meta_" + position + "_item_" + num).id;
	elmselected = document.getElementById("separator_" + position + "_" + selected);
	elmsnelected= document.getElementById("separator_" + position + "_" + (selected+1));	
	separ_left	= document.getElementById("separator_" + position + "_" + num);
	separ_right	= document.getElementById("separator_" + position + "_" + (num+1));
	wichnode 	= document.getElementById("header_meta_" + position + "_item_" + num);
	node 		= wichnode.parentNode;
  	
	for (x=0;x < node.childNodes.length;x++) {
		if (node.childNodes[x].tagName == "DIV") {						
			id 		  = node.childNodes[x].id;
			classname = node.childNodes[x].className;
			if ((classname != "header_meta_separator") && (classname != "header_meta_separator_both") && (classname != "header_meta_separator_left") && (classname != "header_meta_separator_right")) {
				if (id != elm) {
					if (classname != "header_meta_" + position + "_item_on") {
						node.childNodes[x].className = "header_meta_" + position + "_item";
					}
				}
			}
		}
	}
	if (wichnode.className == "header_meta_" + position + "_item") {
		wichnode.className 	 = "header_meta_" + position + "_item_hover";
		if ((num+1) == selected) {
			separ_left.className = "header_meta_separator_left";			
			separ_right.className = "header_meta_separator_both";
		} else if ((num-1) == selected ){
			separ_right.className = "header_meta_separator_right";
			separ_left.className = "header_meta_separator_both";
		} else {
			separ_left.className = "header_meta_separator_left";
			if (separ_right) {
				separ_right.className = "header_meta_separator_right";
			}
		}
	} else {
		wichnode.className = "header_meta_" + position + "_item";
		if ((num+1) == selected) {
			separ_left.className  = "header_meta_separator";
			elmselected.className = "header_meta_separator_left";
		} else if ((num-1) == selected ){
			separ_right.className = "header_meta_separator";
			if (elmsnelected) {
				elmsnelected.className = "header_meta_separator_right";
			} else {
				separ_left.className  = "header_meta_separator_right";
			}
		} else {
			if (separ_left) {
				separ_left.className  = "header_meta_separator";
			}
			if (separ_right) {
				separ_right.className = "header_meta_separator";
			}
		}
	}
}

function changeHeaderFooterButton(type,num){
	if(num == 0){
		document.getElementById(type + "_button_1").className = type + "_button_1";
		document.getElementById(type + "_button_2").className = type + "_button_2";
	}else if(num == 1){
		document.getElementById(type + "_button_1").className = type + "_button_1_hover";
		document.getElementById(type + "_button_2").className = type + "_button_2";
	}else if(num == 2){
		document.getElementById(type + "_button_1").className = type + "_button_1";
		document.getElementById(type + "_button_2").className = type + "_button_2_hover";
	}
}

function positionnelayerHeader(val,parent) {

	var left =0;
	if (document.getElementById("Menu" + val)) {
		if ((document.getElementById("Menu" + val).style.display == "none") || (document.getElementById("Menu" + val).style.display == "")) {
			node = document.getElementById("Menu" + val);
			node = node.parentNode;
			node = node.parentNode;
			node.style.left = "0";
			nombrowser = navigator.appName;
			if (nombrowser.indexOf('Internet')>-1) {
				thedivparent = "_ie";
			} else {
				thedivparent = "";
			}	
			while ((node.id != "header" + thedivparent) && (node.id != "footer" + thedivparent)) {	
				var leftelem = node.offsetLeft;
				node = node.parentNode;
				left = left + leftelem;
			}

			var width = document.getElementById(parent).parentNode.offsetWidth;
			var top = document.getElementById(parent).parentNode.offsetTop;
			
			document.getElementById("Menu"+val).style.position = "absolute";
			document.getElementById("Menu"+val).style.left = left + "px";
			document.getElementById("Menu"+val).style.top = (top + 31) + "px";
			document.getElementById("Menu"+val).style.width = width + "px";	
			
			document.getElementById("Menu"+val).style.display = "block";

		}		
	}
}

function changeclassheader(obj) {

	valid 		= (obj.id);
	var arrayid = valid.split("_");
	var id 		= arrayid[arrayid.length-1];
	 
	if (obj.className == "sheader_title") {			
		document.getElementById("sheader_right_separator_"+id).className ="sheader_right_separator_top";
		obj.className = "sheader_title_on";
		if (document.getElementById("sheader_right_separator_"+(parseInt(id)+2))) {
			document.getElementById("sheader_right_separator_"+(parseInt(id)+2)).className ="sheader_right_separator_bottom";
		}
	} else if (obj.className == "sheader_title_on") {
		document.getElementById("sheader_right_separator_"+id).className ="sheader_right_separator";
		obj.className = "sheader_title";			
		if (document.getElementById("sheader_right_separator_"+(parseInt(id)+2))) {
			document.getElementById("sheader_right_separator_"+(parseInt(id)+2)).className ="sheader_right_separator";		
		}
	}
}

function HideMenuHeader(id,evt){
	
	var e = (window.event) ? window.event : evt;

	pos_x_mouse = e.clientX;
	pos_y_mouse = e.clientY;
	
	var scrollTop = document.documentElement.scrollTop;
	if(scrollTop == 0){
		//Pour Safari et Chrome
		var scrollTop = document.body.scrollTop;	
	}	
	
	if (pos_y_mouse > (document.getElementById("Menu"+ id).offsetTop + document.getElementById("Menu"+ id).offsetHeight)) {
		document.getElementById("Menu"+ id).style.display = "none";
	} else if (pos_x_mouse < document.getElementById("Menu"+ id).offsetLeft) {
		document.getElementById("Menu"+ id).style.display = "none";
	} else if (pos_x_mouse > (document.getElementById("Menu"+ id).offsetLeft + document.getElementById("Menu"+ id).offsetWidth)) {
		document.getElementById("Menu"+ id).style.display = "none";
	}
	
}

function EffaceRequest(obj) {
	if ((obj.value == "SAISIR UN TITRE, UN AUTEUR, UN MOT-CLE") || (obj.value == "EEN TITEL, EEN AUTEUR, EEN SLEUTELWOORD INVOEREN")) {
		document.getElementById("searchInHeader").value ="";
		if (document.getElementById("searchInFooter")) {
			document.getElementById("searchInFooter").value ="";
		}
	}
}
function HideMenuSHeader(obj){
	
	/*node = obj;
	for (x=0;x < node.childNodes.length;x++) {
		if (node.childNodes[x].tagName == "DIV") {	
			fils = node.childNodes[x];
			for (xx=0;xx < fils.childNodes.length;xx++) {
				if (fils.childNodes[xx].tagName == "DIV") {	
					id 		  = fils.childNodes[xx].id;
					if (id.indexOf("Menu") == 0) {
					 fils.childNodes[xx].style.display = "none";
					}
				}
			}
		}
	}*/
}

function checkEnter(evt,inputName){
	var event = window.event? window.event : evt;
	if (event.keyCode == 13){
		event.cancelBubble = true;
		event.returnValue = false;
		AddSearchCookie(inputName,'/search?id=1');
	}
}