function getXhr()
{
     if(window.XMLHttpRequest)
	 	xhr = new XMLHttpRequest(); 
	else
		if(window.ActiveXObject)
  		{ 
			try
			{
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e) 
			{
			     xhr = new ActiveXObject("Microsoft.XMLHTTP");
     		}
  		}
		else 
		{
			alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
			xhr = false; 
		} 
}
 
function Ajax_ChargerPage(url, idDiv)
{
	getXhr();
	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			if (idDiv!="" )
			{
				document.getElementById(idDiv).innerHTML=xhr.responseText;
				xhr=null;
				initPageLang();
			}
		}
	}
	xhr.open("GET",url,true);
	xhr.send(null);
}


// data sous la forme a=1&b=2
function Ajax_ChargerPagePOST(url, data, idDiv)
{
	getXhr();
	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4 && xhr.status == 200)
		{
			if (idDiv!="" )
			{
				document.getElementById(idDiv).innerHTML=xhr.responseText;
				xhr=null;
				initPageLang();
			}
		}
	}
	xhr.open("POST",url,true);
	xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
	xhr.send(data);
}
