var answer = new Array("dummy",1,1,0,0,1,1,0,1);
var topsize=8;
var texty = new Array(
"Jesus can't help you now.",
"Can you run fast?",
"Have you considered Hinduism?",
"Not bad, just make sure you're never alone.",
"You need to improve before it's too late.",
"Will you forgive those who trespass against you?",
"You have the eyes of The Lord.",
"You have followed The Truth and The Light, mostly.",
"You have the power of God on your side.");

var imageright = new Array(
"dummy",
"right_01.gif",
"right_02.gif",
"right_03.gif",
"right_04.gif",
"right_05.gif",
"right_06.gif",
"right_07.gif",
"right_08.gif");

var imagewrong = new Array(
"dummy",
"wrong_01.gif",
"wrong_02.gif",
"wrong_03.gif",
"wrong_04.gif",
"wrong_05.gif",
"wrong_06.gif",
"wrong_07.gif",
"wrong_08.gif");

function ResetQuiz()
{
var count=0;
while (count++<topsize)
 {
 eval("document.a"+count+".src='images/none.gif'");
 eval("document.form.s" + count + "[0].disabled=false");
 eval("document.form.s" + count + "[1].disabled=false");
 eval("document.form.s" + count + "[0].checked=false");
 eval("document.form.s" + count + "[1].checked=false")
 }
}

function check()
{
var count=0;
var score=0;
var finished=0;
while (count++<topsize)
  {
	var checkx;
  if ((eval("document.form.s" + count + "[0].checked")) ||
     (eval("document.form.s" + count + "[1].checked")))
    {
		if (eval("document.form.s" + count + "[0].checked"))
		{checkx = 0;}
		if (eval("document.form.s" + count + "[1].checked"))
		{checkx = 1;}
		//alert (checkx);
     if (checkx ==  answer[count])
     {score++;eval("document.a"+count+".src='images/" + imageright[count] +"'");}
     else
     {eval("document.a"+count+".src='images/" + imagewrong[count] +"'");}
     eval("document.form.s" + count + "[0].disabled='true'");
     eval("document.form.s" + count + "[1].disabled='true'");
     finished++;
    }
 }

if (finished==topsize)
{
alert(texty[score]+"\n\n"+"You scored "+score+"/"+topsize+"\n\nPressing OK will restart the quiz.");
location.href="#";
ResetQuiz();
}
}