// Copyright 2003 2004 - Thierry Koblentz (TJKDesign) //
function checkAnswer(TJKform,theAnswer){
var theTotal=MM_findObj("totaux");
  var theChoice = "";
// Finding the user's choice. //
  var i = 0;
  for(;i<TJKform.elements.length;i++)
  {
    if(("theOption" == TJKform.elements[i].name) && (TJKform.elements[i].checked))
    {
      theChoice = TJKform.elements[i].value;
    }
  }
// no selection has been made //
  if(theChoice == "")
  {
    alert("Please make a selection.");
    return false;
  }
// Do we have the correct choice? //
  if(theChoice == theAnswer)
  {  
  alert("This is correct.       \n");
theTotal.value += 1; 
  }
  else
  {
    alert("'"+theChoice+"' is incorrect.\nThe correct answer is '"+theAnswer+"'     ");
// Disable the button once the user has made his/her choice //
  }
// Disable the button once the user has made his/her choice //
TJKform.elements[3].disabled=true;
// FALSE to make sure the form is not submitted //
  return false;
}

// Copyright 2003 - Thierry Koblentz (TJKDesign) //
function findOut(resultat){
switch(resultat) 
{
case "": 
  alert("Not one?!\nGo read my article...\n          \n\n"); 
break;
case "1": 
  alert("Only 1 correct answer out of 9?!\nGo read my article!          \n\n"); 
break;
case "11": 
  alert("Only 2 correct answers out of 9?!\nThat's not enough to give frames a try.\n          \n\n"); 
break;
case "111": 
  alert("3 correct answers out of 9?!\nLook at the bright side, that\'s 33%!\n          \n\n"); 
break;
case "1111": 
  alert("You score 4 out of 9!\nYou should avoid using Frames until you get a better understanding of the pros and cons.          \n\n"); 
break;
case "11111": 
  alert("You score 5 out of 9!\nThat is pretty decent; it's above average.          \n\n"); 
break;
case "111111": 
  alert("You score 6 out of 9!\nI guess you have used Frames before.          \n\n"); 
break;
case "1111111": 
  alert("You score 7 out of 9!\nGive yourself a pat on the back, bravo!          \n\n"); 
break;
case "11111111": 
  alert("You score 8 out of 9!\nYou were so close to a perfect score, bravo!.          \n\n"); 
break;
case "111111111": 
  alert("10 out of 10? Do you want me to believe that? You cheater!          \n\n:-\)"); 
break;
default:
  alert("I don't know how you got here - but it doesn't look kosher to me.          \n\n"); 
break
}
}
