// JavaScript Document

function submitQuiz()
{
	var f=document.getElementById('miniquiz-cars');	
	if(f){f.innerHTML='<p>Correct</p>';}
}

var quiz = new Array
(
	new Array
	(
		'How many tonnes of waste do we throw away in the UK a year?',
		'5 million',
		'20 million',
		'30 million'
	),
	new Array
	(
		'How much money is wasted on energy in the UK every year?',
		'&pound;500,000',
		'&pound;5 million',
		'&pound;5 billion'
	),
	new Array
	(
		'How much of the world\'s energy do fossil fuels supply?',
		'10%',
		'50%',
		'90%'
	),
	new Array
	(
		'How much of the UK\'s CO2 emissions are caused by road traffic?',
		'5%',
		'22%',
		'66%'
	),
	new Array
	(
		'How much does the average household spend on wasted food?',
		'&pound;242',
		'&pound;424',
		'&pound;4024'
	),
	new Array
	(
		'How many pastic bags does the average household use a year?',
		'400',
		'500',
		'4000'
	),
	new Array
	(
		'How much of the energy used by a mobile phone charger is wasted when left on?',
		'5%',
		'55%',
		'95%'
	),
	new Array
	(
		'How many trees would it take to absorb the amount of CO2 emissions from a computer every day?',
		'50 - 100',
		'100 - 500',
		'500 - 1000'
	),
	new Array
	(
		'How many homes could be powered by the amount of energy wasted from items on standby?',
		'2.4 million',
		'2.5 million',
		'2.7 million'
	),
	new Array
	(
		'1.Turning your thermostat down 1&deg;C could cut heating bills by how much?',
		'1%',
		'10%',
		'20%'
	)
);

function quizGetQuestion()
{
	var r = Math.floor(Math.random()*quiz.length);
	
	var str = '<p>'+quiz[r][0]+'</p>';
	str += '<div><input type="radio" name="ecoquiz" value="1" /><label>'+quiz[r][1]+'</label></div>';
	str += '<div><input type="radio" name="ecoquiz" value="2" /><label>'+quiz[r][2]+'</label></div>';
	str += '<div><input type="radio" name="ecoquiz" value="3" /><label>'+quiz[r][3]+'</label></div>';
	document.write(str);
}
