var compteur =0;

var igasite = "<a href='http://www.iga.net/' target='_blank'>www.iga.net</a>";

var suggestion="<a href='http://www.iga.net/healthtips.php?lang=en&id=28' target='_blank'>Ten Quebec fruits and vegetables in the spotlight</i> </a>";

var resultat1="Congratulations! You know your antioxidants and where to find them. Read the article "+suggestion+ "to learn more.";
var resultat2 ="You could learn more by reading the article "+ suggestion +", which presents 10 fruits and vegetables that can help you!";
 
function checkReponse(noQuestion,suivante){
	var currentSelect	= document.getElementById('q_'+noQuestion);
	var nextQuestion	= document.getElementById('q'+suivante);
	var nextSelect		= document.getElementById('q_'+suivante);
	var currentIndex 	= currentSelect.selectedIndex;
	
	if (
		(noQuestion==1 && currentIndex==2) ||
		(noQuestion==2 && currentIndex==3) ||
		(noQuestion==3 && currentIndex==4) ||
		(noQuestion==4 && currentIndex==5) ||
		(noQuestion==5 && currentIndex==1) 
	){
		document.getElementById('p'+noQuestion+'_v').style.display = '';
		
		
		
		compteur +=1;
		
		
		
		
	} else{
		
			
		document.getElementById('p'+noQuestion+'_f').style.display = '';
		
	}
	
	
	if (nextQuestion){
			nextQuestion.style.display = 'block';
		}else{
			
				// resultat;
				
				if(compteur >= 4){
			

				
				
				document.getElementById("resultat").innerHTML = compteur;
				document.getElementById("msg").innerHTML = resultat1;
				document.getElementById("voir").style.display = "";
				//document.getElementById("defi").style.display = "";
			
				
			
			}
			
			
			if(compteur <=3){
			
	
			
				
				document.getElementById("resultat").innerHTML = compteur;
				document.getElementById("msg").innerHTML = resultat2;
				document.getElementById("voir").style.display = "";
				//document.getElementById("defi").style.display = "";
			
			}
			
		}
		
	currentSelect.disabled = true;	
			

}
	
