var ans = new Array;
ans[1] = "The Truman Show";
ans[2] = "The Matrix";
ans[3] = "King Kong";
ans[4] = "Titanic";
ans[5] = "The Sixth Sense";
ans[6] = "Men in Black";
ans[7] = "Harry Potter";
ans[8] = "Spider-Man 2";
var yourAns="";

function store(answer) {
  yourAns=answer;
}

function show(qnum) {
  var showText = "Answer\n--------------------------------------\n\n";  
  if(yourAns == ans[qnum]) {
	showText = showText + "You selected '" + yourAns + "'.\n\n"; 
    showText = showText + "Yes, it's correct. It's '"+ ans[qnum] + "'\n";
  } else if (yourAns=="") { 
	showText = showText + "Please choose your answer first!\n";
  } else {
    showText = showText + "You selected '" + yourAns + "'.\n\n";	  
	showText = showText + "Sorry, it's not correct. Please try again!\n";
  }					 
  showText = showText + "\n--------------------------------------\n\n";
  alert(showText);
}
