function ajax_traitement(valeur,nom_script_php,param_php,nom_id,nature,action)
{
    var xhr=null;
    
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) 
    {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
    }
    //on définit l'appel de la fonction au retour serveur
    xhr.onreadystatechange = function() { 
	alert_ajax(xhr,nom_id,nom_script_php,param_php,nature,action); 
    };

	if (nom_script_php != '')
		xhr.open("GET", nom_script_php+'?param='+valeur+param_php, true);
    xhr.send(null);
}

function alert_ajax(xhr,nom_id,nom_script_php,param_php,nature,action)
{
    if (xhr.readyState==4) 
    {
    	var docXML= xhr.responseXML;
    	var items = docXML.getElementsByTagName("donnee")

	document.getElementById('comm1').className="nonaffiche";
	document.getElementById('comm2').className="nonaffiche";
	document.getElementById('comm3').className="nonaffiche";
	document.getElementById('comm4').className="nonaffiche";
	document.getElementById('comm5').className="nonaffiche";
	document.getElementById('comm6').className="nonaffiche";
	document.getElementById('abogsm1').className="nonaffiche";
	document.getElementById('abogsm2').className="nonaffiche";
	document.getElementById('abogsm3').className="nonaffiche";
	
   	for (i=0;i<items.length;i++)
    	{
		document.getElementById(nom_id).innerHTML =items.item(i).firstChild.data;
    	}
  }
}


