//Q=question (Q1, Q2, ...)		ptQ=Point pour la question(ptQ1=5, ptQ2=3,...)	ok=si tt les Questions sont remplies(0 ou 1)

// Initialisation de variables
var  ptQ1=0;
var  ptQ2=0;
var  ptQ3=0;
var  ptQ4=0;
var  ptQ5=0;
var  ptQ6=0;
var  ptQ7=0;
var  ptQ8=0;
var  ptQ9=0;
var  ptQ10=0;
var  ptQ11=0;
var  ptQ12=0;
var  ptQ13=0;
var  ptQ14=0;
var  ptQ15=0;
var  ptQ16=0;
var  ptQ17=0;
var  ptQ18=0;
var  ptQ19=0;
var  ptQ20=0;
var  ptQ21=0;
var  ptQ22=0;
var  ptQ23=0;
var  ptQ24=0;
var  ptQ25=0;
var  ptQ26=0;
var  ptQ27=0;
var  ptQ28=0;
var  ptQ29=0;
var  ptQ30=0;


function checkData()
{
var nbA=0;
var nbB=0;
var nbC=0;
var correct = true
var ok = 1

// verification de la validite de tous les champs
if (!(document.introextra.Q1[0].checked || document.introextra.Q1[1].checked || document.introextra.Q1[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 1 !");return correct
	}

if (!(document.introextra.Q2[0].checked || document.introextra.Q2[1].checked || document.introextra.Q2[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 2 !");return correct
	}

if (!(document.introextra.Q3[0].checked || document.introextra.Q3[1].checked || document.introextra.Q3[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 3 !");return correct
	}

if (!(document.introextra.Q4[0].checked || document.introextra.Q4[1].checked || document.introextra.Q4[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 4 !");return correct
	}


if (!(document.introextra.Q5[0].checked || document.introextra.Q5[1].checked || document.introextra.Q5[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 5 !");return correct
	}

if (!(document.introextra.Q6[0].checked || document.introextra.Q6[1].checked || document.introextra.Q6[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 6 !");return correct
	}

if (!(document.introextra.Q7[0].checked || document.introextra.Q7[1].checked || document.introextra.Q7[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 7 !");return correct
	}

if (!(document.introextra.Q8[0].checked || document.introextra.Q8[1].checked || document.introextra.Q8[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 8 !");return correct
	}

if (!(document.introextra.Q9[0].checked || document.introextra.Q9[1].checked || document.introextra.Q9[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 9 !");return correct
	}

if (!(document.introextra.Q10[0].checked || document.introextra.Q10[1].checked || document.introextra.Q10[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 10 !");return correct
	}

if (!(document.introextra.Q11[0].checked || document.introextra.Q11[1].checked || document.introextra.Q11[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 11 !");return correct
	}

if (!(document.introextra.Q12[0].checked || document.introextra.Q12[1].checked || document.introextra.Q12[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 12 !");return correct
	}

if (!(document.introextra.Q13[0].checked || document.introextra.Q13[1].checked || document.introextra.Q13[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 13 !");return correct
	}

if (!(document.introextra.Q14[0].checked || document.introextra.Q14[1].checked || document.introextra.Q14[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 14 !");return correct
	}

if (!(document.introextra.Q15[0].checked || document.introextra.Q15[1].checked || document.introextra.Q15[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 15 !");return correct
	}

if (!(document.introextra.Q16[0].checked || document.introextra.Q16[1].checked || document.introextra.Q16[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 16 !");return correct
	}

if (!(document.introextra.Q17[0].checked || document.introextra.Q17[1].checked || document.introextra.Q17[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 17 !");return correct
	}

if (!(document.introextra.Q18[0].checked || document.introextra.Q18[1].checked || document.introextra.Q18[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 18 !");return correct
	}

if (!(document.introextra.Q19[0].checked || document.introextra.Q19[1].checked || document.introextra.Q19[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 19 !");return correct
	}

if (!(document.introextra.Q20[0].checked || document.introextra.Q20[1].checked || document.introextra.Q20[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 20 !");return correct
	}
if (!(document.introextra.Q21[0].checked || document.introextra.Q21[1].checked || document.introextra.Q21[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 21 !");return correct
	}
if (!(document.introextra.Q22[0].checked || document.introextra.Q22[1].checked || document.introextra.Q22[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 22 !");return correct
	}
if (!(document.introextra.Q23[0].checked || document.introextra.Q23[1].checked || document.introextra.Q23[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 23 !");return correct
	}
if (!(document.introextra.Q24[0].checked || document.introextra.Q24[1].checked || document.introextra.Q24[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 24 !");return correct
	}
if (!(document.introextra.Q25[0].checked || document.introextra.Q25[1].checked || document.introextra.Q25[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 25 !");return correct
	}
if (!(document.introextra.Q26[0].checked || document.introextra.Q26[1].checked || document.introextra.Q26[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 26 !");return correct
	}
if (!(document.introextra.Q27[0].checked || document.introextra.Q27[1].checked || document.introextra.Q27[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 27 !");return correct
	}
if (!(document.introextra.Q28[0].checked || document.introextra.Q28[1].checked || document.introextra.Q28[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 28 !");return correct
	}
if (!(document.introextra.Q29[0].checked || document.introextra.Q29[1].checked || document.introextra.Q29[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 29 !");return correct
	}
if (!(document.introextra.Q30[0].checked || document.introextra.Q30[1].checked || document.introextra.Q30[2].checked))
	{
	correct = false;ok = 0; alert("Vous n'avez pas r"+String.fromCharCode (233)+"pondu "+String.fromCharCode (224)+" la question 30 !");return correct
	}

// calcul
var score=0;


score = ptQ1 + ptQ2 + ptQ3 + ptQ4 + ptQ5 + ptQ6 + ptQ7 + ptQ8 + ptQ9 + ptQ10 + ptQ11 + ptQ12 + ptQ13 + ptQ14 + ptQ15 + ptQ16 + ptQ17 + ptQ18 + ptQ19 + ptQ20 + ptQ21 + ptQ22 + ptQ23 + ptQ24 + ptQ25 + ptQ26 + ptQ27 + ptQ28 + ptQ29 + ptQ30

// redirection page selon resultat
if ( ok = 1)
	{

//test
//alert ( score )
	
if ( score <= 39 )  {
	alert('Votre score est de ' +score+' points !')
	open('a.php','_self');return correct
	}

if ( score >= 40 && score <= 69)  {
	alert('Votre score est de ' +score+' points !')
	open('b.php','_self');return correct
	}

if ( score >= 70)  {
	alert('Votre score est de ' +score+' points !')
	open('c.php','_self');return correct
	}
	}
return correct

opener.parent.frameName.location.href = url
}

