// JavaScript Document

var score =0;

var questions = new Array(
	"",
	"1. The news was bad. ",
	"2. Mrs Rose looked happy. ",
	"3. Edith felt sad.   ",
	"4. Edith had a good idea.  ", 
	"5. Mrs Rose bought cheap tea. ", 
	"6. There was a little sugar left in the bowl.  ", 
	"7. There were  a lot of   things in the drawer. ",
	"8. Train tickets are  expensive.  ",
	"9. Aunt Emily was  young.  "	
	);

var correct= new Array(
	"",
	"1. The news was worse than we thought. ",
	"2. Mrs Rose looked much happier than before. ",
	"3. Edith felt sadder as she listened to the story",
	"4. Edith's idea was better than her aunt's idea. ",
	"5. Tea was cheaper than coffee.  ",
	"6. After Edith put some in her tea, there was less sugar in the bowl than before",
	"7. There were  more  things in the drawer than on the table. ",
	"8. Train tickets are  more expensive  than steamer tickets. ",
	"9. Aunt Emily was  younger  than Aunt Harriet. "
	);

var  wrong = new Array(
	"",
	"1. The news was badder than we thought. ",
	"2. Mrs Rose looked much more happy than before. ",
	"3. Edith felt more sad as she listened to the story",
	"4. Edith's idea was gooder than her aunt's idea. ",
	"5. Tea was more cheap than coffee.  ",
	"6. After Edith put some in her tea, there was littler sugar in the bowl.",
	"7. There were  much  things in the drawer than on the table. ",
	"8. Train tickets are expensiver  than steamer tickets. ",
	"9. Aunt Emily was  more young  than Aunt Harriet. "
	);
	
	
var possanswers1= new Array(
"",
	"worse",
	"happier",
	"sadder ",
	"better",
	"cheaper",
	"less",
	"more",
	"more expensive",
	"younger"
	);



var possanswers2 = new Array(
"",
	"badder",
	"more happy",
	"more sad",
	"gooder",
	"more cheaper",
	"littler",
	"much",
	"expensiver",
	"more young"
	);

var anscode= new Array( 
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b"
);


function changetext(thequestion, theval){ //nb change index now at 1 not 0
	if (theval.indexOf('a')>1){ //right
		score++;
	with (navigator) if (appVersion.indexOf('Mac')==-1)	{
		getscore();
	}else {
	// alert("you have scored " + score);
	}
		
		var changeto=correct[parseInt(thequestion) ];
	
		MM_swapImage('tb0'+thequestion,'','../img/tickboxticksmall.gif',1);
		eval("q0"+thequestion).innerHTML=changeto;

	//alert(score);

	}else if (theval.indexOf('b')>1){ //wrong
		//alert("wrong");
		var changeit=wrong[parseInt(thequestion)];
		MM_swapImage('tb0'+thequestion,'','../img/tickboxsmallcross.gif',1);
		eval("q0"+thequestion).innerHTML=changeit;
	}else{ //not done
	}
}

function getscore(){
	if (score >9){score=9}
	 var sendText = "You have scored " + score;
   window.document.myFlash.SetVariable("score", sendText);
//	var picpath="../img/skittles" +score+".jpg";
//	MM_swapImage('p0','','../img/skittles9.jpg','p0','',picpath,1);
}

function giveanswers(){
 bname=navigator.appName
	if (bname.indexOf("Netscape")!=-1)
	{
		//window.location="game101nsa.htm"
		 window.setTimeout(window.location="game301nsa.htm",100);
		return
	}
	if (bname.indexOf("Microsoft")!=-1){

		for (var thequestion=1; thequestion<= 9; thequestion++){
		var changeto=correct[parseInt(thequestion) ];
		eval("q0"+thequestion).innerHTML=changeto;
		MM_swapImage('tb0'+thequestion,'','../img/tickboxticksmall.gif',1)// remove if we do not want the ticks
		}
	}
}
