/**

 */
var answer = new Array("dummy",1,1,0,0,1,0,1,1,0,0);
var topsize=10;
var texty = new Array(
"Be very, very careful with what you put in your mouth.",
"Did you ever take a bite out of one your friends?.",
"Are you a cannibal?",
"Take a closer look: it's your finger, not a cookie.",
"Take of your clothes, get some food and compare.",
"Take some extra biology classes.",
"Didn't that banana tasted funny the other day?",
"I know you can do better. You have the potential.",
"You're either a cook or a surgeon!",
"You're a doctor with a passion for haute cuisine, aren't you?",
"Congratulations! You don't get your food groups mixed up with any body parts.");

var imageright = new Array(
"dummy",
"01_a.gif",
"02_a.gif",
"03_a.gif",
"04_a.gif",
"05_a.gif",
"06_a.gif",
"07_a.gif",
"08_a.gif",
"09_a.gif",
"10_a.gif");

var imagewrong = new Array(
"dummy",
"01_b.gif",
"02_b.gif",
"03_b.gif",
"04_b.gif",
"05_b.gif",
"06_b.gif",
"07_b.gif",
"08_b.gif",
"09_b.gif",
"10_b.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();
}
}


