//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.quelfou.Q1[0].checked || document.quelfou.Q1[1].checked || document.quelfou.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.quelfou.Q2[0].checked || document.quelfou.Q2[1].checked || document.quelfou.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.quelfou.Q3[0].checked || document.quelfou.Q3[1].checked || document.quelfou.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.quelfou.Q4[0].checked || document.quelfou.Q4[1].checked || document.quelfou.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.quelfou.Q5[0].checked || document.quelfou.Q5[1].checked || document.quelfou.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.quelfou.Q6[0].checked || document.quelfou.Q6[1].checked || document.quelfou.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.quelfou.Q7[0].checked || document.quelfou.Q7[1].checked || document.quelfou.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.quelfou.Q8[0].checked || document.quelfou.Q8[1].checked || document.quelfou.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.quelfou.Q9[0].checked || document.quelfou.Q9[1].checked || document.quelfou.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.quelfou.Q10[0].checked || document.quelfou.Q10[1].checked || document.quelfou.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.quelfou.Q11[0].checked || document.quelfou.Q11[1].checked || document.quelfou.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.quelfou.Q12[0].checked || document.quelfou.Q12[1].checked || document.quelfou.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.quelfou.Q13[0].checked || document.quelfou.Q13[1].checked || document.quelfou.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.quelfou.Q14[0].checked || document.quelfou.Q14[1].checked || document.quelfou.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.quelfou.Q15[0].checked || document.quelfou.Q15[1].checked || document.quelfou.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.quelfou.Q16[0].checked || document.quelfou.Q16[1].checked || document.quelfou.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.quelfou.Q17[0].checked || document.quelfou.Q17[1].checked || document.quelfou.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.quelfou.Q18[0].checked || document.quelfou.Q18[1].checked || document.quelfou.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.quelfou.Q19[0].checked || document.quelfou.Q19[1].checked || document.quelfou.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.quelfou.Q20[0].checked || document.quelfou.Q20[1].checked || document.quelfou.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.quelfou.Q21[0].checked || document.quelfou.Q21[1].checked || document.quelfou.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.quelfou.Q22[0].checked || document.quelfou.Q22[1].checked || document.quelfou.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.quelfou.Q23[0].checked || document.quelfou.Q23[1].checked || document.quelfou.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.quelfou.Q24[0].checked || document.quelfou.Q24[1].checked || document.quelfou.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.quelfou.Q25[0].checked || document.quelfou.Q25[1].checked || document.quelfou.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
	}


// 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
// redirection page selon resultat
if ( ok = 1)
	{

//test
//alert ( score )
	
if ( score <= 35 )  {
	alert('Votre score est de ' +score+' points !')
	open('a.php','_self');return correct
	}

if ( score >= 36 && score <= 45)  {
	alert('Votre score est de ' +score+' points !')
	open('b.php','_self');return correct
	}

if ( score >= 46 && score <= 55)  {
	alert('Votre score est de ' +score+' points !')
	open('c.php','_self');return correct
	}
if ( score >= 56 && score <= 65)  {
	alert('Votre score est de ' +score+' points !')
	open('d.php','_self');return correct
	}
if ( score >= 66)  {
	alert('Votre score est de ' +score+' points !')
	open('e.php','_self');return correct
	}
	}
return correct

opener.parent.frameName.location.href = url
}

