// Path needs to be relative link from page that called this script Image1 = new Image(); Image1.src = "../../../Images/heasarc/icons/blank2.gif"; Image2 = new Image(); Image2.src = "../../../Images/heasarc/icons/star2.gif"; total = 4; yourAnswer = new Array(total); answer = new Array("B","A","C","A"); function Swap(start, end) { for (i = start; i <= end; i++) { document.images["correct" + i].src = Image2.src; } return true; } function AssignClick(letter, position) { yourAnswer[position] = letter.value; } function CheckMe() { var count = 0; for (i = 0; i < total; i++) { if (yourAnswer[i] == answer[i]) {count++;} } Swap(1, total); var win = window.open("", "score_window", "width=300,height=300, resizable=yes,scrollbars=yes"); var myURL = window.location.pathname.match(/^.*\//); if (navigator.appName == "Microsoft Internet Explorer") {myURL = "";} win.document.write('\n
\n\n'); win.document.write('\n'); win.document.write('
\n'); } win.document.write ("Your score is " + Math.round(count*100/total) + " %!\n\n\n"); win.document.write("
\n");
win.document.write ("Stars are next to the correct answers.
\n"); win.document.write ("