

var ans = new Array;
var done = new Array;
var score = 0;
// LOSER!  Don't read the answers!

ans[1] = "a";
ans[2] = "c";
ans[3] = "b";
ans[4] = "a";
ans[5] = "d";

function Engine(question, answer) {

		

	if (answer != ans[question]) {
		if (!done[question]) {
			done[question] = -1;
			alert("Wrong!\n\nYour score is now: " + score);
		    	}
		else {
			alert("Sorry, you already made a selection for this photo. Click the LET ME TRY AGAIN button if you want to begin a new game and change your answer.");
			}
		}
	else {
		if (!done[question]) {
			done[question] = -1;
			score++;
			alert("Correct!\n\nYour score is now: " + score);
		    	}
		else {		
			alert("Sorry, you already made a selection for this photo. Click the LET ME TRY AGAIN button if you want to begin a new game and change your answer.");
			}
		}

	if (score >= 5) {
		alert("Congratulations, you identified all these medicinal herbs correctly.  Watch for additional Plant Identification Games in the weeks to come and test your knowledge on other types of plants.");
		}


}
		
function NextLevel () {
	if (score > 3) {
		alert("Your really doing well, keep it up and your sure to get them all");
		}
	if (score >= 4 && score <= 6) {
		alert("Access permitted!  Good job! You will now advance to the third, and last level")
		//self.location="qtest2.htm"
                        newWindow = open ("qtest3.htm")
		}
	else {
		alert("Access denied!  You need 4 points to enter the next level.")
		}
}


