function havefun(){
messages = new Array ("Is that your final answer?", "Are you confident?", "Would you like to use one of your lifelines?", "Not really sure, are you?", "That's ok.  Take your time.", "Do you want to just guess?")
j = parseInt(Math.round((messages.length -1)*Math.random()));
alert(messages[j]);
}
function graderevquiz(form){
grades = new Array();
i = 0
grades[i] = 0;
if (form.c1.checked) grades[i] = 1;
if (form.a1.checked) grades[i] = -1;
if (form.b1.checked) grades[i] = -1;
if (form.d1.checked) grades[i] = -1;

if (grades[i] > 0) form.linkq.value = "Right!" 
  else form.linkq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.b2.checked) grades[i] = 1;
if (form.a2.checked) grades[i] = -1;
if (form.c2.checked) grades[i] = -1;
if (form.d2.checked) grades[i] = -1;

if (grades[i] > 0) form.lineq.value = "Right!"
  else form.lineq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.b3.checked) grades[i] = 1;
if (form.a3.checked) grades[i] = -1;
if (form.c3.checked) grades[i] = -1;
if (form.d3.checked) grades[i] = -1;

if (grades[i] > 0) form.styleq.value = "Right!"
  else form.styleq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.a4.checked) grades[i] = 1;
if (form.b4.checked) grades[i] = -1;
if (form.c4.checked) grades[i] = -1;
if (form.d4.checked) grades[i] = -1;

if (grades[i] > 0) form.styleq2.value = "Right!"
  else form.styleq2.value = "Sorry!";
i++;

grades[i] = 0;
if (form.d5.checked) grades[i] = 1;
if (form.a5.checked) grades[i] = -1;
if (form.c5.checked) grades[i] = -1;
if (form.b5.checked) grades[i] = -1;

if (grades[i] > 0) form.tableq.value = "Right!"
  else form.tableq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.c6.checked) grades[i] = 1;
if (form.a6.checked) grades[i] = -1;
if (form.b6.checked) grades[i] = -1;
if (form.d6.checked) grades[i] = -1;

if (grades[i] > 0) form.quizq.value = "Right!"
  else form.quizq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.c6.checked) grades[i] = 1;
if (form.a6.checked) grades[i] = -1;
if (form.b6.checked) grades[i] = -1;
if (form.d6.checked) grades[i] = -1;

if (grades[i] > 0) form.validq.value = "Right!"
  else form.validq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.d8.checked) grades[i] = 1;
if (form.a8.checked) grades[i] = -1;
if (form.b8.checked) grades[i] = -1;
if (form.c8.checked) grades[i] = -1;

if (grades[i] > 0) form.arrayq.value = "Right!"
  else form.arrayq.value = "Sorry!";
i++;

grades[i] = 0;
if (form.a9.checked) grades[i] = 1;
if (form.c9.checked) grades[i] = -1;
if (form.b9.checked) grades[i] = -1;
if (form.d9.checked) grades[i] = -1;

if (grades[i] > 0) form.funq.value = "Right!"
  else form.funq.value = "Sorry!";
i++;

finalscore = 0;
for (i = 0; i < grades.length; i++)
finalscore += grades[i];

form.overall.value = "Your final score is " + finalscore + " out of " + grades.length;
} 

function browserwarn(){
var isIE5x = navigator.appVersion.indexOf("MSIE 5") != -1;
if (!isIE5x) document.write("<h4>These pages use CSS controls that have been tested on Internet Explorer 5.0, but which may not work on other browsers.  The pages definitely will <i>not</i> render correctly in Netscape 4.7 or below.</h4>");
}
function tagrep(instring){
outstring = instring.replace("<", "&lt;");
outstring = outstring.replace(">","&gt;");
outstring += "<br>";
document.write(outstring);
}
function alertUser(){
alert ("Thanks for pressing the button");
}
function headerwrite(){
document.write('<div class = "header_left">'
+'Web Design</div>' +
'<div class = "header_center">\n'
+'<a href = "../index.html">Table of Contents</a></div>'
+'<div class = "header_right">'
+'&copy; by Arnold Kling</div>');
}
function headerwrite2(){
document.write('<div class = "headerLeft">'
+'Web Design</div>' +
'<div class = "headerCenter">\n'
+'<a href = "../index.html">Table of Contents</a></div>'
+'<div class = "header_Right">'
+'&copy; by Arnold Kling</div>');
}