
var ans = new Array;
var done = new Array;
var UserAns = new Array;

ans[1] = "b";
ans[2] = "c";
ans[3] = "a";
ans[4] = "c";
ans[5] = "a";
ans[6] = "b";
ans[7] = "c";
ans[8] = "b";
ans[9] = "c";
ans[10] = "b";

function SaveAnswer(question, answer) {
	UserAns[question]=answer;
}

function Score(){
	var score = 0;

	for(i = 1;i <= 10;i++){
		if(ans[i] != UserAns[i]){
		} else {
			score++;
		}
		document.getElementById('correct' + i).className = 'correctanswer'
	}

	var textquiz = document.getElementById('text-quiz');

	textquiz.innerHTML = '<p>You got ' + score + ' correct!</p>'

	if (score < 4){
		textquiz.innerHTML += '<p>Less than 4: Dear oh dear, no wonder the planet is in such a sorry state. Read our <a href="TopTenTips.aspx">top ten tips on green behaviour</a> and do not rest until you know and abide by each and every one!!</p>';
	} else if (score >= 4 && score < 8) {
		textquiz.innerHTML += '<p>4 &minus; 7: Not bad.  Your green knowledge is certainly developing nicely and you are well on your way to helping save the planet. Brush up with our <a href="TopTenTips.aspx">top ten tips on being green in the office</a></p>';
	} else if (score >= 8 && score <= 10) {
		textquiz.innerHTML += '<p>8 &minus; 10: Well done! You certainly know your green stuff &minus; how do you use your super-green knowledge in your everyday routines? Let us know how you manage to be so green by submitting your <a href="GetInvolved.aspx">green tips</a></p>';
	}

	textquiz.innerHTML += '<p>The correct answers are highlighted in orange</p>'

	location.hash = 'quiztop'
}