var vminutes = 5;
var vseconds = 00;
var boxedanswers = 0;
var autocomplete = 1;
var gamever = 0;
var justincase1 = 0;
var justincase2 = 0;


function loadanswers()
{
	answers = new Array();
	answers.push( new inans('The Gremlins', new Array('The Gremlins')));
	answers.push( new inans('James and the Giant Peach', new Array('James & the Giant Peach')));
	answers.push( new inans('Charlie and the Chocolate Factory', new Array('Charlie & the Chocolate Factory')));
	answers.push( new inans('The Magic Finger', new Array('Magic Finger')));
	answers.push( new inans('Fantastic Mr Fox', new Array()));
	answers.push( new inans('Charlie and the Great Glass Elevator', new Array('Charlie and the Great Glass Elevator','The Great Glass Elevator','Charlie & the Great Glass Elevator')));
	answers.push( new inans('Danny, the Champion of the World', new Array('Danny Champion of the World','Danny the Champion of the World')));
	answers.push( new inans('The Enormous Crocodile', new Array('Enormous Crocodile')));
	answers.push( new inans('The Twits', new Array('Twits')));
	answers.push( new inans('George\'s Marvelous Medicine', new Array('Georges Marvelous Medicine')));
	answers.push( new inans('The BFG', new Array('BFG')));
	answers.push( new inans('The Witches', new Array('Witches')));
	answers.push( new inans('The Giraffe and the Pelly and Me', new Array('The Giraffe & the Pelly & Me')));
	answers.push( new inans('Matilda', new Array()));
	answers.push( new inans('Esio Trot', new Array()));
	answers.push( new inans('The Minpins', new Array('Minpins')));
	answers.push( new inans('The Vicar of Nibbleswicke', new Array('Vicar of Nibbleswicke')));
	remaining = answers.length;
	displayRemaining();
}

function doEndAlert()
{
	var total = (correct + remaining);
	var percentunrounded = (correct/total) * 100;
	var percent = roundNumber(percentunrounded,2)
	if ( percent == 100 ) {
	alert("Nicely done. You read them when you was younger, didn't you?.\nYou got all " + correct + " answers correct.\nWell done!!!");
	}
	if ( percent >= 80 && percent < 100) {
	alert("Well done! You managed to get " + correct + " correct.\nThat is " + percent + "% of the total possible answers.\nThat is an amazing score");
	}
	if ( percent >= 60 && percent < 80) {
	alert("Great Job! You managed to get " + correct + " correct.\nThat is " + percent + "% of the total possible answers.\nThat is a very good score");
	}
	if ( percent >= 45 && percent < 60) {
	alert("Good Job! You managed to get " + correct + " correct.\nThat is " + percent + "% of the total possible answers.\nThat is a good score");
	}
	if ( percent >= 35 && percent < 45) {
	alert("Not bad! You managed to get " + correct + " correct.\nThat is " + percent + "% of the total possible answers.\nThat is a average score");
	}
	if ( percent < 35) {
	alert("Not very good, I'm afraid! You managed to get " + correct + " correct.\nThat is " + percent + "% of the total possible answers.\nThat is a not a very good score");
	}
}

