size1 = "Blank";
size2 = "Blank";
size3 = "Blank";

function testButton(form) {
  for (Count = 0; Count < 5; Count++) {
    if (form.answer1[Count].checked)
      size1 = Count;
    if (form.answer2[Count].checked)
      size2 = Count;
    if (form.answer3[Count].checked)
      size3 = Count;
  }
    
  RightAnswer1 = 2;
  RightAnswer2 = 0;
  RightAnswer3 = 3;
  AnswerPage = './circular-quiz-answer.html';
var total = 3;
var NumberCorrect = 0;
    
  if (size1 == RightAnswer1) {
    NumberCorrect++;
  }
  if (size2 == RightAnswer2) {
    NumberCorrect++;
  }
  if (size3 == RightAnswer3) {
    NumberCorrect++;
  }
    
  //    alert ("You answered " + NumberCorrect + " out of 3 questions correctly!");

  location = AnswerPage; 

  var win = window.open("", "score_window", "width=300,height=325, resizable=yes,scrollbars=yes");
	var myURL = window.location.pathname.match(/^.*\//);
	if (navigator.appName == "Microsoft Internet Explorer") {myURL = "";}


  win.document.write('<HTML>\n<HEAD>\n<TITLE>Your Score</TITLE>\n</HEAD>\n');
  win.document.write('<BODY BGCOLOR="#FFFFFF" TEXT="#000094" LINK="#7D5F00"');
  win.document.write(' VLINK="#9E0A42" ALINK="#FF0000">');
  win.document.write('<H2 ALIGN="CENTER">');

  if (NumberCorrect == total) {
    win.document.write('<P ALIGN="CENTER">\n');
    win.document.write('<IMG SRC="',myURL,'../../Images/icons/fireworks.gif" BORDER=0>\n');
    win.document.write('</P>\n');
  }
  win.document.write ("You answered " + NumberCorrect + " out of " + total + " questions correctly!\n</H2>\n</P><P>\n");

  win.document.write("<CENTER>");
  win.document.write("<FORM>");
  win.document.write("<TABLE BORDER=5 CELLPADDING=10>");
  win.document.write("<TR><TD ALIGN=\"CENTER\">");
  win.document.write("<INPUT TYPE=button VALUE=\"Close\" onClick=\"window.close()\"></TD></TR>");
  win.document.write("</TABLE>");
  win.document.write("</FORM>");
  win.document.write("</CENTER>");
  win.document.write('</BODY>\n</HTML>\n');

}

    
