/*****************************************************
	Fonction pour voter
******************************************************/
function valid_sondage(q) {

	data="";

	var xhr2 = new_xhr();//On crée un nouvel objet XMLHttpRequest
	xhr2.onreadystatechange = function(){
		if ( xhr2.readyState == 4 ){//Actions executées une fois le chargement fini
			if(xhr2.status  != 200){//Message si il se produit une erreur
				document.getElementById("sondage").innerHTML ="Error code " + xhr2.status;
			} else {//On met le contenu du fichier externe dans la div "content"
				chaine=xhr2.responseText;
				document.getElementById("sondage").innerHTML = chaine;

			}
		} else {//Message affiché pendant le chargement
			document.getElementById("sondage").innerHTML = "Enegistrement en cours ...<br />";
		}
	}

	monForm=document.formSondage;

	data="rep1="+monForm.informer.value;
	if(q==2){
		data+="&rep2="+monForm.lot.value;
	}
	data+="&rep3="+monForm.initiative.value;
	data+="&rep4="+monForm.ajout.value;
	
	xhr2.open("POST", "comportement/php/save_sondage.html", true);
	xhr2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 	
	xhr2.send(data);

}



//=============================================================================================================
