
// Fonction pour jouer les son

function jouerson(animal) {
		document.embeds[animal].play();
}

function chx(radio) {
					this.document.all.id_correc.innerText="";
}
	

//Fonction pour evaluer la reponse

var rep1="";
var rep2="";

function chx1(radio) {
		 for (var i=0; i<radio.length;i++) {
		          if (radio[i].checked) {
						this.document.all.id_correc.innerText="";
						//this.document.all.id_rep1.innerText= radio[i].value;
						rep1= radio[i].value;
						}
					}
	 }

	 function chx2(radio) {
	 	 for (var j=0; j<radio.length;j++) {
		          if (radio[j].checked) {
						this.document.all.id_correc.innerText="";
						//this.document.all.id_rep2.innerText= radio[j].value;
						rep2= radio[j].value;
						}
					}
	 }

	 function eval(){
	 //rep1 = this.document.all.id_rep1.innerText;
	 nbchar_rep1 = rep1.length;

	 //rep2 = this.document.all.id_rep2.innerText;
	 nbchar_rep2 = rep2.length;

	 	 if (nbchar_rep1 == 0 || nbchar_rep2 == 0) {
			this.document.all.id_correc.innerText="La réponse n'est pas complète !";
			//alert("La réponse n'est pas complète !")
		 }
		 else {
				if (rep1 == rep1_page && rep2 == rep2_page)
				{
				jouerson(1);
				this.document.all.id_correc.innerText="Bravo !";
				//alert("Bonne reponse !")
				}
				else {
				jouerson(2);
				this.document.all.id_correc.innerText="Essaie encore !";
				//alert("La reponse est fausse !")
				}
		 }
	 }



