var nb_menu=12;
var save_id;

function change_menu(objet,type)
{
	if (type=="out")
	{
		for (i=0;i<=nb_menu;i++)
		{
			if (document.getElementById('menu_'+i).style.background=="")
			{
				save_id="menu_"+i;
				pos=i;
			}
		}
	/*	for (j=0;j<=nb_menu;j++)
		{
			document.getElementById('menu_'+j).style.background="url('module_fichiers/z_27.png')";
		}	*/
		if (save_id)
		{
			document.getElementById(save_id).style.background="";
		}

		
	}
	else if (type=="over")
	{
		for (i=0;i<=nb_menu;i++)
		{
			if (document.getElementById('menu_'+i).style.background=="")
			{
				save_id="menu_"+i;
				pos=i;
			}
		}
		for (j=0;j<=nb_menu;j++)
		{
			document.getElementById('menu_'+j).style.background="url('module_fichiers/z_27.png')";
		}	
		document.getElementById(objet.id).style.background="url('module_fichiers/under.png')";

		if (save_id)
		{
			document.getElementById(save_id).style.background="";
		}	
	}
	else if (type=="0")
	{
		for (i=0;i<=nb_menu;i++)
		{
			document.getElementById('menu_'+i).style.background="url('module_fichiers/z_27.png')";
		}
		document.getElementById(objet.id).style.background="";
	}
	else
	{
	}
	save_id="";
}





var xhr_object = null; 
var temp;
temp_timer=1;
function envoieRequeteMenu(url,id) 
{ 
	if (temp_timer==1){
		if (url!=temp)
		{
		temp=url;
		temp_timer=0;
		var xhr_object = null; 
		    var position = id; 
		
			if(window.ActiveXObject) xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
			
			else
				if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
				else 
					if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest(); 
					
					// On ouvre la requete vers la page désirée 
					xhr_object.open("GET", url, true); 
					xhr_object.onreadystatechange = function(){ 
						if ( xhr_object.readyState == 4 ) 
						{ 
							// j'affiche dans la DIV spécifiées le contenu retourné par le fichier 
			        if(document.getElementById(position))
			        {
							document.getElementById(position).innerHTML = xhr_object.responseText; 
							}
						} 
					} 
					// dans le cas du get 
					var chaine='bonjour'
					xhr_object.send(null);
		}
		
	setTimeout("change_temp()",0);
	}
}

function change_temp(){
temp_timer="1";
}
