	function liste_diplome(i,cible, valeur_diplome){
		var xhr=null;
    
    if (window.XMLHttpRequest) { 
        xhr = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        //xhr = new ActiveXObject("Microsoft.XMLHTTP");
				try { xhr = new ActiveXObject("Msxml2.XMLHTTP" );}
				catch(e){
					try { xhr = new ActiveXObject("Microsoft.XMLHTTP" );}
					catch (e1) {xhr = null;}
				}  
    }
    //on définit l'appel de la fonction au retour serveur
    xhr.onreadystatechange = function() { xml_liste_diplome(xhr, cible, valeur_diplome); };
    
    //on appelle le fichier reponse.txt
    xhr.open("GET", "./ajax_diplome.php?activite=" + i, true);
//    xhr.open("GET", "./ajax_diplome.php?activite=" + i, false);
    xhr.send(null);
	}
	
	function xml_liste_diplome(xhr,cible, valeur_diplome){
		if (xhr.readyState==4 && xhr.status == 200) {
			var docXML= xhr.responseXML;

			var id_diplome = document.getElementById(cible);
			id_diplome.options.length = docXML.getElementsByTagName('diplome').length;
//			alert(docXML.getElementsByTagName('charge_affaire').length);
			for (i=0; i < docXML.getElementsByTagName('diplome').length; i++){
				element = docXML.getElementsByTagName('diplome')[i];
				//alert(element.getElementsByTagName('name')[0].firstChild.data);
				if(element.getElementsByTagName('name')[0].firstChild.data=="Choisissez") {
					id_diplome.options[i].value = "";
				}
				else id_diplome.options[i].value = element.getElementsByTagName('id')[0].firstChild.data;
				id_diplome.options[i].text  = element.getElementsByTagName('name')[0].firstChild.data;
			}
//			alert(document.forms[0]['candidat_diplome1'].options.length);
			select_diplome(cible, valeur_diplome);
		}
	}

