setUpPage();
function setUpPage(){

	
	
	for(suindex = 0;suindex<questionArray.length;suindex++){

		document.write(questionArray[suindex][0]);
		document.write("<b> <font color='#666699' size='+1'>" + (suindex+1) + "</font> </b>");
		document.write("<select name=ans"  + (suindex+1) + ">");
		document.write("<option>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>");
		document.write("<option>" + questionArray[suindex][1] + "</option>");
		document.write("<option>" + questionArray[suindex][2] + "</option>");
		document.write("<option>" + questionArray[suindex][3] + "</option>");
		document.write("</select>");
       		document.write("<img src='/images/elt/product_site_graphics/clocktransparent.gif' height='20' width='20'name='im" + (suindex +1) + "'>");
       		document.write(questionArray[suindex][4]);
	}
	
	
}

var answerArray = new Array(document.form1.ans1,document.form1.ans2,document.form1.ans3,document.form1.ans4,document.form1.ans5);
var imageArray = new Array(document.images.im1,document.images.im2,document.images.im3,document.images.im4,document.images.im5);
function checkScore() {
var answerArray = new Array(document.form1.ans1,document.form1.ans2,document.form1.ans3,document.form1.ans4,document.form1.ans5);
var imageArray = new Array(document.images.im1,document.images.im2,document.images.im3,document.images.im4,document.images.im5);
	if(cheat){
		alert("Please press reset to try again.")
	}else{
		var score = 0;
		for(csindex = 0;csindex<questionArray.length;csindex++){
			if (answerArray[csindex].selectedIndex == correctArray[csindex]) {
				imageArray[csindex].src="/images/elt/product_site_graphics/clocktick.gif";
				score++;
			} else {
				imageArray[csindex].src="/images/elt/product_site_graphics/clockcross.gif";
			}
		}
		if(score<5){
			alert("Your score is "+score+" / " + questionArray.length + ". Please try again.");
		}else{
			alert("Well done, you scored 5/5.");
		}
	}
}




function reveal() {
var answerArray = new Array(document.form1.ans1,document.form1.ans2,document.form1.ans3,document.form1.ans4,document.form1.ans5);
var imageArray = new Array(document.images.im1,document.images.im2,document.images.im3,document.images.im4,document.images.im5);
	for(revindex = 0;revindex<questionArray.length;revindex++){
		answerArray[revindex].selectedIndex = correctArray[revindex];
		imageArray[revindex].src="/images/elt/product_site_graphics/clocktransparent.gif";
	}
	cheat = true;
}
function again() {
var answerArray = new Array(document.form1.ans1,document.form1.ans2,document.form1.ans3,document.form1.ans4,document.form1.ans5);
var imageArray = new Array(document.images.im1,document.images.im2,document.images.im3,document.images.im4,document.images.im5);
	cheat = false;
	for(agindex = 0;agindex<questionArray.length;agindex++){
		answerArray[agindex].selectedIndex = 0;
		imageArray[agindex].src="/images/elt/product_site_graphics/clocktransparent.gif";
	}

}

