// JavaScript Document
var xhr = null;
 
// Fonction de creation de l'objet XMLHttpRequest qui resservira pour chaques fonctions AJAX
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, veuillez le mettre à jour"); 
    	xhr = false; 
	} 
}

function ajaxval(){
	getXhr();
	xhr.onreadystatechange = function(){
  		if(xhr.readyState == 4 && xhr.status == 200) {
			document.getElementById('zonemsg').innerHTML=xhr.responseText;
			document.getElementById('zonemsg').style.display="block";
		}
	}
	xhr.open("POST","modules/recherche.php",true);
  	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	var recherche = document.getElementById('recherche').value;
  	xhr.send("cherche="+recherche);
}

