
function appel() {

	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() { response_ajax(xhr); };
    
	var select = document.getElementById('ListeIdSite');
	//alert(select.options[select.options.selectedIndex].value);
    //on appelle le fichier reponse.txt
    xhr.open("POST", "home_XMLHttpRequest", true);
  	xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    xhr.send("id_site="+select.options[select.options.selectedIndex].value);
	
}

function response_ajax(xhr) {

	if(xhr.readyState == 4 && xhr.status == 200){
		var docXml = xhr.responseXML;
		var select = document.getElementById('ClasseActif');
		select.options.length = 0;
		var options = docXml.getElementsByTagName('option')
		var values = docXml.getElementsByTagName('value')
		for (var i=0; i < options.length; ++i) {
			select.options[select.options.length] = new Option(values[i].firstChild.data, options[i].firstChild.data); 
		}
		
	}
	
}




