function httpRequest(file, id){

	var httpreq_object = null; 
		
	// Fonctionne avec IE7
	
	try {  httpreq_object = new ActiveXObject('Msxml2.XMLHTTP');   }
    catch (e) 
    {
        try {   httpreq_object = new ActiveXObject('Microsoft.XMLHTTP');    }
        catch (e2) 
        {
          try {  httpreq_object = new XMLHttpRequest();     }
          catch (e3) {  httpreq_object = false;   }
        }
     }	
	
	httpreq_object.open("GET", file, true);

	httpreq_object.onreadystatechange = function() {
   		if(httpreq_object.readyState == 1){
     		document.getElementById(id).innerHTML = 'Loading...';
   		} 
   		if(httpreq_object.readyState == 4){
     		//alert(file);
     		document.getElementById(id).innerHTML= httpreq_object.responseText;
   		}
	}   

	httpreq_object.send(null);
}

function ChangeDivBackGround(id, fichier) {
		document.getElementById(id).style.backgroundImage=fichier;		
}

function ChangeBackGround(fichier) {
		document.body.background=fichier;		
}

function CollapseExpand(id, num, j, picplus, picmoins){
	
	// id = id de l'objet - le chiffre
	// num = chiffre de l'id
	// j = nombre d'élément de la page + 1 ( num max +1)
	// picplus = image pour le +
	// picmoins = image pour le -
	
	var i;
			
	for (i=1;i<j;i++){
			
		if (i != num){
			document.getElementById(id+i).style.display="none";	
			document.getElementById('piccolexp'+i).innerHTML = '<img src="'+picplus+'" alt="Ouvrir" height="10" width="10"/>';
		}
		else {				
			if (document.getElementById(id+i).style.display != "block"){
				document.getElementById(id+i).style.display = "block";
				document.getElementById('piccolexp'+i).innerHTML = '<img src="'+picmoins+'" alt="Fermer" height="10" width="10"/>';
			}
			else{
				document.getElementById(id+i).style.display = "none";
				document.getElementById('piccolexp'+i).innerHTML = '<img src="'+picplus+'" alt="Ouvrir" height="10" width="10"/>';
			}
		}			
			
	}
}

function popup(file, title, w, h){
	var x, y, mypopup;
	
	x=w;
	y=h;	
	
	mypopup = window.open(file,title,"toolbar=no,resizable=no,location=no,scrollbars=no,status=no");
	
	mypopup.resizeTo(x,y);
	mypopup.moveTo((screen.width-x)/2, (screen.height-y)/2);
}


function envoiTxt(id, txt){

	var id = id;
	var txt = txt;
	
	document.getElementById(id).innerHTML = txt;
}





