
 function envoieRequete(url,id)
 {
 var xhr_object = null;
 var position = id;
 if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
 else
 if (window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");

 // On ouvre la requete vers la page désirée
 xhr_object.open("GET", url, true);
 xhr_object.onreadystatechange = function(){
 if ( xhr_object.readyState == 4 )
 {
 // j'affiche dans la DIV spécifiées le contenu retourné par le fichier
 document.getElementById(position).innerHTML = xhr_object.responseText;
 }
 }
 // dans le cas du get
 xhr_object.send(null);

 }



function xhr_connect(){
	var xhr = false
	if (window.XMLHttpRequest) {
		
		xhr = new XMLHttpRequest
		
	} else if (window.ActiveXObject) {
		
		var reussi = false
		
		var iexhr = new Array("Msxml2.XMLHTTP.7.0", "Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP.2.0", "Microsoft.XMLHTTP")
		
		for (var i = 0; i<iexhr.length && !reussi; i++) {
			try {
				xhr = new ActiveXObject(iexhr[i])
				reussi = true
			} catch(e) {}
		}
	}
	return xhr;
}


function charge_sl(arg){
	
	var objxhr = xhr_connect();
	if (objxhr) {
			objxhr.onreadystatechange = function() {
			if (objxhr.readyState == 4) {
				
				if (objxhr.status == 200) {	
				
					var retour = objxhr.responseText
					
					place_sl(retour)
	
				}
			}
		}
		var sql = "nage="+ arg
		objxhr.open("POST", "charge_sl.php", true)
		objxhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		objxhr.send(sql)
	} else {
		alert("soucis xml http request")	
	}
	
}

function charge_sl2(arg){
	
	var objxhr = xhr_connect();
	if (objxhr) {
			objxhr.onreadystatechange = function() {
			if (objxhr.readyState == 4) {
				
				if (objxhr.status == 200) {	
				
					var retour = objxhr.responseText
					
					place_sl(retour)
	
				}
			}
		}
		var sql = "nage="+ arg
		objxhr.open("POST", arg+".php", true)
		objxhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		objxhr.send(sql)
	} else {
		alert("soucis xml http request")	
	}
	
}


function place_sl(arg) {
	var tab_sl = document.getElementById('res_sl');
	tab_sl.innerHTML = arg;

}

