function ajax(page){
	var xhr_object = null;
	if(window.XMLHttpRequest) // Firefox
	   xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
		try
    	{
			xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
    	}
    	catch(e)
    	{
        	try
        	{
        		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
        	}
        	catch(e1)
        	{
        		xhr_object = null;
        	}
    	}
	
	else { // XMLHttpRequest non supporté par le navigateur
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	   return;
	}
	xhr_object.open("GET", page, false);
	xhr_object.send(null);
	if(xhr_object.readyState == 4){
		return xhr_object.responseText;
	}
}
function click_refs(id){
	document.getElementById('cadre').innerHTML = ajax("../pages/recup_infos.php?nocache="+Math.random()+"&id="+id);	
	document.getElementById('cadre').style.position = 'absolute';
	if (document.documentElement){
		var larg = (document.documentElement.clientWidth);
		var haut = (document.documentElement.clientHeight);
	}else{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	document.getElementById('cadre').style.left = (larg/2-404)+"px";
	document.getElementById('cadre').style.top = (haut/2-238)+"px";
	Effect.Appear(document.getElementById('cadre'),{duration:1});	
}
function cacheCadre(){
	document.getElementById('cadre').style.position = 'absolute';
	if (document.documentElement){
		var larg = (document.documentElement.clientWidth);
		var haut = (document.documentElement.clientHeight);
	}else{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	document.getElementById('cadre').style.left = (larg/2-404)+"px";
	document.getElementById('cadre').style.top = (haut/2-238)+"px";
	Element.hide(document.getElementById('cadre'));	
}
function envoieCP(cp){
	document.getElementById('cadre').innerHTML = ajax("../pages/info_regions.php?nocache="+Math.random()+"&cp="+cp);	
	document.getElementById('cadre').style.position = 'absolute';
	if (document.documentElement){
		var larg = (document.documentElement.clientWidth);
		var haut = (document.documentElement.clientHeight);
	}else{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	document.getElementById('cadre').style.left = (larg/2-404)+"px";
	document.getElementById('cadre').style.top = (haut/2-238)+"px";
	document.getElementById('cadre').style.zIndex = "100";
	Effect.Appear(document.getElementById('cadre'),{duration:1});
}
function recup_construct(id){
	Element.hide(document.getElementById('img1'));	
	document.getElementById('img1').innerHTML = ajax("../pages/recup_construct.php?nocache="+Math.random()+"&id="+id);	
	if (document.documentElement){
		var larg = (document.documentElement.clientWidth);
		var haut = (document.documentElement.clientHeight);
	}else{
		var larg = (window.innerWidth);
		var haut = (window.innerHeight);
	}
	Effect.Appear(document.getElementById('img1'),{duration:1});	
}
function affContrats(num){
	document.getElementById('prestations').innerHTML = ajax("../pages/recup_contrats.php?nocache="+Math.random()+"&num="+num);
}
function envoieID(id){
	Element.hide(document.getElementById('affInfos'));	
	document.getElementById('affInfos').innerHTML = ajax("../pages/recup_projet.php?nocache="+Math.random()+"&id="+id);
	Effect.Appear(document.getElementById('affInfos'),{duration:1});	
}