// è = &#232;
// é =  &#233;

//document.charset = "iso-8859-5";

//var url = "navigation.xml";

function NavigationTop()
{
	var current = this;

	this.navtopA = document.getElementById("labelA");
	this.navtopB = document.getElementById("labelB");
	this.navtopC = document.getElementById("labelC");
	this.navtopD = document.getElementById("labelD");
	this.navtopE = document.getElementById("labelE");
	this.navtopF = document.getElementById("labelF");
	this.navtopG = document.getElementById("labelG");
	this.submenuA = document.getElementById("submenuA");
	this.submenuB = document.getElementById("submenuB");
	this.submenuC = document.getElementById("submenuC");
	this.submenuD = document.getElementById("submenuD");
	this.submenuE = document.getElementById("submenuE");
	this.submenuF = document.getElementById("submenuF");
	this.submenuG = document.getElementById("submenuG");
	

	// MISE EN PLACE DES FONCTIONS ASSOCIEES AU MENU	
	
	this.navtopA.onmouseover = function() {
		navtopA.style.backgroundColor = "#005da8";
		menu_visible(navtopA, submenuA);
	}
	this.navtopA.onmouseout = function() {
		navtopA.style.backgroundColor = "#7b7c7e";
		menu_invisible(navtopA, submenuA);
	}
	this.submenuA.onmouseover = function() {
		navtopA.style.backgroundColor = "#005da8";
		menu_visible(navtopA, submenuA);
	}
	this.submenuA.onmouseout = function() {
		navtopA.style.backgroundColor = "#7b7c7e";
		menu_invisible(navtopA, submenuA);
	}
	
	this.navtopB.onmouseover = function() {
		navtopB.style.backgroundColor = "#e2007a";
		menu_visible(navtopB, submenuB);
	}
	this.navtopB.onmouseout = function() {
		navtopB.style.backgroundColor = "#929395";
		menu_invisible(navtopB, submenuB);
	}
	this.submenuB.onmouseover = function() {
		navtopB.style.backgroundColor = "#e2007a";
		menu_visible(navtopB, submenuB);
	}
	this.submenuB.onmouseout = function() {
		navtopB.style.backgroundColor = "#929395";
		menu_invisible(navtopB, submenuB);
	}
	
	this.navtopC.onmouseover = function() {
		navtopC.style.backgroundColor = "#730a63";
		menu_visible(navtopC, submenuC);
	}
	this.navtopC.onmouseout = function() {
		navtopC.style.backgroundColor = "#a7a8aa";
		menu_invisible(navtopC, submenuC);
	}
	this.submenuC.onmouseover = function() {
		navtopC.style.backgroundColor = "#730a63";
		menu_visible(navtopC, submenuC);
	}
	this.submenuC.onmouseout = function() {
		navtopC.style.backgroundColor = "#a7a8aa";
		menu_invisible(navtopC, submenuC);
	}
	
	this.navtopD.onmouseover = function() {
		navtopD.style.backgroundColor = "#e20031";
		menu_visible(navtopD, submenuD);
	}
	this.navtopD.onmouseout = function() {
		navtopD.style.backgroundColor = "#929395";
		menu_invisible(navtopD, submenuD);
	}
	this.submenuD.onmouseover = function() {
		navtopD.style.backgroundColor = "#e20031";
		menu_visible(navtopD, submenuD);
	}
	this.submenuD.onmouseout = function() {
		navtopD.style.backgroundColor = "#929395";
		menu_invisible(navtopD, submenuD);
	}
	
	this.navtopE.onmouseover = function() {
		navtopE.style.backgroundColor = "#ee813c";
		menu_visible(navtopE, submenuE);
	}
	this.navtopE.onmouseout = function() {
		navtopE.style.backgroundColor = "#7b7c7e";
		menu_invisible(navtopE, submenuE);
	}
	this.submenuE.onmouseover = function() {
		navtopE.style.backgroundColor = "#ee813c";
		menu_visible(navtopE, submenuE);
	}
	this.submenuE.onmouseout = function() {
		navtopE.style.backgroundColor = "#7b7c7e";
		menu_invisible(navtopE, submenuE);
	}
	
	this.navtopF.onmouseover = function() {
		navtopF.style.backgroundColor = "#d4a13c";
		menu_visible(navtopF, submenuF);
	}
	this.navtopF.onmouseout = function() {
		navtopF.style.backgroundColor = "#a7a8aa";
		menu_invisible(navtopF, submenuF);
	}
	this.submenuF.onmouseover = function() {
		navtopF.style.backgroundColor = "#d4a13c";
		menu_visible(navtopF, submenuF);
	}
	this.submenuF.onmouseout = function() {
		navtopF.style.backgroundColor = "#a7a8aa";
		menu_invisible(navtopF, submenuF);
	}
	
	this.navtopG.onmouseover = function() {
		navtopG.style.backgroundColor = "#4ca151";
		menu_visible(navtopG, submenuG);
	}
	this.navtopG.onmouseout = function() {
		navtopG.style.backgroundColor = "#929395";
		menu_invisible(navtopG, submenuG);
	}
	this.submenuG.onmouseover = function() {
		navtopG.style.backgroundColor = "#4ca151";
		menu_visible(navtopG, submenuG);
	}
	this.submenuG.onmouseout = function() {
		navtopG.style.backgroundColor = "#929395";
		menu_invisible(navtopG, submenuG);
	}

}

function menu_visible(navtop, submenu)
{
	/*image = navtop.getElementsByTagName("img")[0];
	image_src_actuel = image.src;
	image_src_nouveau = image_src_actuel.replace("_gris.png",".png");
	image.src = image_src_nouveau;*/
	navtop.style.height = "28px";
	submenu.style.visibility = "visible";
	submenu.style.display = "block";
}

function menu_invisible(navtop, submenu)
{
	/*image = navtop.getElementsByTagName("img")[0];
	image_src_actuel = image.src;
	image_src_nouveau = image_src_actuel.replace(".png","_gris.png");
	image.src = image_src_nouveau;*/
	navtop.style.height = "20px";
	submenu.style.visibility = "hidden";
	submenu.style.display = "none";
}


/*
function NavigationTop1()
{
	var current = this;
	var nb_topmenu;

	this.navtop = document.getElementById("navigation_top");
	
	this.menus = this.navtop.getElementsByTagName("div");
	this.navtopA = this.menus[0];
	this.navtopB = this.menus[2];
	this.navtopC = this.menus[4];
	this.navtopD = this.menus[6];
	this.navtopE = this.menus[8];
	this.navtopF = this.menus[10];
	this.navtopG = this.menus[12];
	this.submenuA = this.menus[1];
	this.submenuB = this.menus[3];
	this.submenuC = this.menus[5];
	this.submenuD = this.menus[7];
	this.submenuE = this.menus[9];
	this.submenuF = this.menus[11];
	this.submenuG = this.menus[13];
	
	//while(this.navtop.hasChildNodes()) { this.navtop.removeChild(this.navtop.firstChild); }
	
	//------------------------- XML --------------------------------//
	this.loadSubMenu = function(id_menu) {
		// Creation de la requete
		var xhr = createXMLHttpRequest();
		
		if(xhr != null)
		{
			// Traitement de la requete
			xhr.onreadystatechange = function() {  
					
				if(xhr.readyState == 4)
				{
					var menu_i, id, menu, submenu, label, nb_item, item;
					var nodeSpan, nodeTxt, nodeBr;
					var margintop, marginleft, marginheight, top, left, height, width;
					
					margintop = 0;
					marginleft = 0;
					marginheight = -22;
					top = 21;
					left = 0;
					height = 21;
					width = 110;
					
					nb_topmenu = xhr.responseXML.getElementsByTagName("submenu").length;
					nb_topmenu = nb_topmenu - 2;					
					for(i=0; i<nb_topmenu; i++)
					{	
						// RECUPERATION DES DONNES DANS FICHIER XML
						menu_i = xhr.responseXML.getElementsByTagName("submenu")[i];
						id = menu_i.getAttribute("id");
						label = menu_i.getAttribute("label");			
						nb_item = menu_i.getElementsByTagName("item").length;
						
						// LABEL DU MENU
						menu = current.menus[2*i];
						nodeSpan = document.createElement("span");
						nodeTxt = document.createTextNode(label);
						nodeSpan.appendChild(nodeTxt);
						menu.appendChild(nodeSpan);
						menu.style.marginTop = margintop + "px";
						menu.style.marginLeft = marginleft + "px";
						
						// SOUS-MENU
						submenu = current.menus[2*i+1];
						for(j=0; j<nb_item; j++)
						{
							item = menu_i.getElementsByTagName("item")[j].firstChild.data
							
							nodeSpan = document.createElement("span");
							nodeTxt = document.createTextNode(item);
							nodeSpan.appendChild(nodeTxt);
							submenu.appendChild(nodeSpan);
							nodeBr = document.createElement("br");
							submenu.appendChild(nodeBr);
						}				
						submenu.style.top = top + "px";
						submenu.style.left = left + "px";	
						//submenu.style.display = "none";
						
						// INCREMENTATION DES VARIABLES
						top = height;	
						left = left + width;
						margintop = marginheight;
						marginleft = marginleft + width;
					}
				}
			}
			
			// Chargement des donnees
			xhr.open("GET", url, true);
			xhr.send(null);
		}
	}
	
	// Chargement des sous-menus
	this.loadSubMenu();

	
	// MISE EN PLACE DES FONCTIONS ASSOCIEES AU MENU	
	
	this.navtopA.onmouseover = function() {
		current.submenuA.style.visibility = "visible";
		current.submenuA.style.display = "";
	}
	this.navtopA.onmouseout = function() {
		current.submenuA.style.visibility = "hidden";
		current.submenuA.style.display = "none";
	}
	this.submenuA.onmouseover = function() {
		current.submenuA.style.visibility = "visible";
		current.submenuA.style.display = "";
	}
	this.submenuA.onmouseout = function() {
		current.submenuA.style.visibility = "hidden";
		current.submenuA.style.display = "none";
	}
	
	this.navtopB.onmouseover = function() {
		current.submenuB.style.visibility = "visible";
		current.submenuB.style.display = "";
	}
	this.navtopB.onmouseout = function() {
		current.submenuB.style.visibility = "hidden";
		current.submenuB.style.display = "none";
	}
	this.submenuB.onmouseover = function() {
		current.submenuB.style.visibility = "visible";
		current.submenuB.style.display = "";
	}
	this.submenuB.onmouseout = function() {
		current.submenuB.style.visibility = "hidden";
		current.submenuB.style.display = "none";
	}
	
	this.navtopC.onmouseover = function() {
		current.submenuC.style.visibility = "visible";
		current.submenuC.style.display = "";
	}
	this.navtopC.onmouseout = function() {
		current.submenuC.style.visibility = "hidden";
		current.submenuC.style.display = "none";
	}
	this.submenuC.onmouseover = function() {
		current.submenuC.style.visibility = "visible";
		current.submenuC.style.display = "";
	}
	this.submenuC.onmouseout = function() {
		current.submenuC.style.visibility = "hidden";
		current.submenuC.style.display = "none";
	}
	
	this.navtopD.onmouseover = function() {
		current.submenuD.style.visibility = "visible";
		current.submenuD.style.display = "";
	}
	this.navtopD.onmouseout = function() {
		current.submenuD.style.visibility = "hidden";
		current.submenuD.style.display = "none";
	}
	this.submenuD.onmouseover = function() {
		current.submenuD.style.visibility = "visible";
		current.submenuD.style.display = "";
	}
	this.submenuD.onmouseout = function() {
		current.submenuD.style.visibility = "hidden";
		current.submenuD.style.display = "none";
	}
	
	this.navtopE.onmouseover = function() {
		current.submenuE.style.visibility = "visible";
		current.submenuE.style.display = "";
		//current.navtopE.style.fontWeight = "bold";
	}
	this.navtopE.onmouseout = function() {
		current.submenuE.style.visibility = "hidden";
		current.submenuE.style.display = "none";
		//current.navtopE.style.fontWeight = "normal";
	}
	this.submenuE.onmouseover = function() {
		current.submenuE.style.visibility = "visible";
		current.submenuE.style.display = "";
		//current.navtopE.style.fontWeight = "bold";
	}
	this.submenuE.onmouseout = function() {
		current.submenuE.style.visibility = "hidden";
		current.submenuE.style.display = "none";
		//current.navleftE.style.fontWeight = "normal";
	}
	
	this.navtopF.onmouseover = function() {
		current.submenuF.style.visibility = "visible";
		current.submenuF.style.display = "";
	}
	this.navtopF.onmouseout = function() {
		current.submenuF.style.visibility = "hidden";
		current.submenuF.style.display = "none";
	}
	this.submenuF.onmouseover = function() {
		current.submenuF.style.visibility = "visible";
		current.submenuF.style.display = "";
	}
	this.submenuF.onmouseout = function() {
		current.submenuF.style.visibility = "hidden";
		current.submenuF.style.display = "none";
	}
	
	this.navtopG.onmouseover = function() {
		current.submenuG.style.visibility = "visible";
		current.submenuG.style.display = "";
	}
	this.navtopG.onmouseout = function() {
		current.submenuG.style.visibility = "hidden";
		current.submenuG.style.display = "none";
	}
	this.submenuG.onmouseover = function() {
		current.submenuG.style.visibility = "visible";
		current.submenuG.style.display = "";
	}
	this.submenuG.onmouseout = function() {
		current.submenuG.style.visibility = "hidden";
		current.submenuG.style.display = "none";
	}

}
*/
function createXMLHttpRequest()
{
	var xhr = null;

	if (window.XMLHttpRequest)
	{ // Firefox et autres
		xhr = new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{ // Internet Explorer
	    try
		{
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch(e)
		{
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
	    }
	}
	else // XMLHttpRequest non supporte par le navigateur
	{
	    alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest ...");
	}

	return xhr;
}
