	var ajx;
	function goTraitement(url,value,id,message,option)
	{
		if(window.XMLHttpRequest) ajx = new XMLHttpRequest(); // Firefox et autres
		else if(window.ActiveXObject)// Internet Explorer
		{
			try {ajx = new ActiveXObject('Msxml2.XMLHTTP');}
			catch (e) {ajx = new ActiveXObject('Microsoft.XMLHTTP');}
		}

		ajx.onreadystatechange = function()
		{
			if(ajx.readyState == 4 && ajx.status == 200) 
			{
				document.getElementById(id).innerHTML = ajx.responseText;
				if(option) eval(option);
			}	
		}
		ajx.open('POST',url,true);
		ajx.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');
		ajx.send(value);
	}
	
	function goTraitementRefreshListeItem()
	{
		var value = document.getElementById("value").value+"&nbre="+document.getElementById("Nbre").value;
		var div = document.getElementById("balisediv").value
		var url =document.getElementById("url").value
		goTraitement(url,value,div,"",document.getElementById("Option").value)
	}

	function goTraitementRefreshRepareListeItem()
	{
		var value = document.getElementById("valuerepare").value;
		var div = document.getElementById("balisediv").value
		var url =document.getElementById("url").value
		goTraitement(url,value,div,"",document.getElementById("Option").value)
	}


	function goTraitementUpdateJoueur(url,value, div)
	{
		goTraitement(url,value+"&Msg=" +document.getElementById("MsgPerso").value,div)
	}
	
	function goTraitementPostMsgFonction(url,value, div)
	{
		goTraitement(url,value+"&title=" +document.getElementById("title").value+"&body=" +document.getElementById("body").value,div)
	}

	function visibilite(thingId)
	{
		var targetElement;
		targetElement = document.getElementById(thingId) ;
		if (targetElement.style.display == "none")
		{
			targetElement.style.display = "" ;
		} else {
			targetElement.style.display = "none" ;
		}
	}
	
	function ChargeImageMenu()
	{
		img2=new Image();
		img3=new Image();
		img4=new Image();
		img5=new Image();
		img6=new Image();
		img7=new Image();
		img8=new Image();
		img9=new Image();
		img10=new Image();
		img2.src='images/presentation/mnu_acceuil.gif';
		img3.src='images/presentation/mnu_carte.gif';
		img4.src='images/presentation/mnu_exit.gif';
		img5.src='images/presentation/mnu_faction.gif';
		img6.src='images/presentation/mnu_forum.gif';
		img7.src='images/presentation/mnu_grimoire.gif';
		img8.src='images/presentation/mnu_messagerie.gif';
		img9.src='images/presentation/mnu_parametre.gif';
		img10.src='images/presentation/mnu_perso.gif';
	}
	
	function popup(lien,nom,x,y)
	{
	
		window.open(lien,nom,config='height='+x+', width='+y+', toolbar=no, scrollbars=yes, menubar=no, resizable=no, location=no, directories=no, status=no')
	}
	
	function OuvrirPopup(page,nom,option) {
       window.open(page,nom,option);
    }

	function reste(zetime, nom_id,taille)
	{
		var restant = zetime - 5;
		goTraitement("updatefaction.php","Type=invocation&value=" + zetime + "&taille=" + taille,"BarreTimer");
		setTimeout("reste(" + restant + ",'" + nom_id + "','" + taille + "')", 5000);
	}
	
	var timer;
	function fatigue(zetime, nom_id)
	{		
		var restant = zetime - 1;
		if (zetime>-1)
		{	
			if (zetime > 25 && zetime <= 50) { img="bar_fatigue_jaune.gif";}
			if (zetime > 50 && zetime <= 75) { img="bar_fatigue_orange.gif";}
			if (zetime > 75) { img="bar_fatigue_rouge.gif";}
			if (zetime <= 25) { img="bar_fatigue_vert.gif";}
			if (zetime>100) 
			{ 
				sec=100;
				img="/bar_fatigue_rouge.gif";	
			} 
			else {  sec= zetime}
			document.getElementById("ImgFatigue").innerHTML = "<img border=0 width='"+ sec + "' src='../images/" + img + "' height='10' />";
			timer=setTimeout("fatigue(" + restant + ",'ImgFatigue')", 1000);
		}
		else
		{ document.getElementById(nom_id).innerHTML = "";}
	}