function chargerDiv(fichierACharger,idDiv){
if(window.XMLHttpRequest) // FIREFOX
var xhr = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr = new ActiveXObject("Microsoft.XMLHTTP");
else { // XMLHttpRequest non supporté par le navigateur 
alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest... utiliser FireFox ou IE"); 
return; 
}
var news = document.getElementById(idDiv);
if(idDiv =='miseEnForme08') news.innerHTML = "Chargement en cours ...";
xhr.open("GET", fichierACharger,true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
news.innerHTML = xhr.responseText;
//initLightbox();
}
}
xhr.send(null);
}


function changeSex (idForm,idDiv){
	if(document.getElementById(idForm).MOI.options[document.getElementById(idForm).MOI.selectedIndex].value==0){
	sexe = document.getElementById(idDiv);
	sexe.innerHTML='<Select name="RCH"><option  value="0"> Un Homme</option><option  value="1" selected="selected"> Une Femme</option></Select>';
	}
	if(document.getElementById(idForm).MOI.options[document.getElementById(idForm).MOI.selectedIndex].value==1){
	sexe = document.getElementById(idDiv);
	sexe.innerHTML='<Select name="RCH"><option  value="0" selected="selected"> Un Homme</option><option  value="1"> Une Femme</option></Select>';
	}
}

function validerFormulaire(idForm,nomScript){
/*if(window.XMLHttpRequest) // FIREFOX
 	var xhr = new XMLHttpRequest();
 	else if(window.ActiveXObject) // IE
         xhr = new ActiveXObject("Microsoft.XMLHTTP");
	else { // XMLHttpRequest non supporté par le navigateur 
	alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest... utiliser FireFox ou IE"); 
	return; 
	}*/
var variables='';
  for (i=0; i<document.getElementById(idForm).length; i++) {
  variables=variables+'&'+document.getElementById(idForm)[i].name+'='+document.getElementById(idForm)[i].value;
  }
  alert(variables);
  
/* Préparation d'une requête asynchrone de type POST : 
xhr.open("POST", nomScript,true);
/* Effectue la requête en envoyant les données : 
xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xhr.send(variables);	*/
}


function cacheDiv(idDiv){
	if(document.getElementById(idDiv)){
	var divForm = document.getElementById(idDiv);
	divForm.style.display='none';
	}
}
function aparaitDiv(idDiv){
	if(document.getElementById(idDiv)){
	var divForm = document.getElementById(idDiv);
	divForm.style.display='block';
	}
}

function cacheAparaitDiv(idDiv1,idDiv2){
cacheDiv(idDiv1);
aparaitDiv(idDiv2);
}

