<script type='text/javascript'>
	function getXhr(){
		var xhr = null; 
		if(window.XMLHttpRequest) // Firefox et autres
		   xhr = new XMLHttpRequest(); 
		else if(window.ActiveXObject){ // Internet Explorer 
		   try {
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		else { // XMLHttpRequest non supporté par le navigateur 
		   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		   xhr = false; 
		} 
		return xhr;
	}

	/**
	* Méthode qui sera appelée sur le click du bouton pour APD
	*/
	function go(){
		//var seq_id = location.search.substring(1).split('&');
		var seq_id = location.search.substring(1).split('&');
		// POUR PROGRESS
		var xhrprog = getXhr();
		xhrprog.onreadystatechange = function(){
			if(xhrprog.readyState == 4 && xhrprog.status == 200){
				leselectprog = xhrprog.responseText;
				document.getElementById('progress').innerHTML = leselectprog;
			}
		}

		xhrprog.open("POST","db/proc/edit_info_progression.php",true);
		xhrprog.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		selprog = document.getElementById('niveaugo');
		idauteurprog = selprog.options[selprog.selectedIndex].value;
		xhrprog.send("idSavoir="+idauteurprog+seq_id);

		// POUR APD
		var xhr = getXhr();
		xhr.onreadystatechange = function(){
			if(xhr.readyState == 4 && xhr.status == 200){
				leselect = xhr.responseText;
				document.getElementById('savoir1').innerHTML = leselect;
			}
		}

		xhr.open("POST","db/proc/edit_select_sav.php",true);
		xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		sel = document.getElementById('niveaugo');
		idauteur = sel.options[sel.selectedIndex].value;
		xhr.send("idSavoir="+idauteur+seq_id);
	
		// POUR EMI
		var xhremi = getXhr();
		xhremi.onreadystatechange = function(){
			if(xhremi.readyState == 4 && xhremi.status == 200){
				leselectemi = xhremi.responseText;
				document.getElementById('emi1').innerHTML = leselectemi;
			}
		}

		xhremi.open("POST","db/proc/edit_select_emi.php",true);
		xhremi.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		selemi = document.getElementById('niveaugo');
		idauteuremi = selemi.options[selemi.selectedIndex].value;
		xhremi.send("idSavoir="+idauteuremi+seq_id);
		
		// POUR PER
		var xhrper = getXhr();
		xhrper.onreadystatechange = function(){
			if(xhrper.readyState == 4 && xhrper.status == 200){
				leselectper = xhrper.responseText;
				document.getElementById('per1').innerHTML = leselectper;
			}
		}

		xhrper.open("POST","db/proc/edit_select_per.php",true);
		xhrper.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		selper = document.getElementById('niveaugo');
		idauteurper = selper.options[selper.selectedIndex].value;
		xhrper.send("idSavoir="+idauteurper+seq_id);
	}
</script>