$(document).ready(setupQuiz);

function setupQuiz(){
	output = "";
	correct= "<p class='quiz_answer'><img src='/sites/rednoseday.com/assets/img/changing_lives/quiz/correct.gif' alt='Correct' /></p>";
	incorrect= "<p class='quiz_answer'><img src='/sites/rednoseday.com/assets/img/changing_lives/quiz/incorrect.gif' alt='Incorrect' /></p><p>Oops, you got that one<br /> wrong - try again</p>";
	$("div#changinglives_quiz .answer").click(function(){
		quiz_answer = $(this).attr("id");
		switch(quiz_answer){
			case "answer_1_false":
				output = ""+ correct +"<p class='quiz_answer2'>Incredibly, malaria is actually a disease that’s cheap and easy to prevent which means you really can help to save lives</p>";
				break;
			case "answer_1_true":
				output = ""+ incorrect +"";
				break;
			case "answer_2_a":
				output = ""+ correct +"<p>People with mental health problems can find it hard to get a job.</p>";
				break;
			case "answer_2_b":
				output = ""+ incorrect +"";
				break;		
			case "answer_3_a":
				output = ""+ correct +"<p>In Sub-Saharan Africa, around 35 million primary school aged children can’t go to school</p>";
				break;
			case "answer_3_b":
			case "answer_3_c":
			case "answer_3_d":
				output = ""+ incorrect +"";
				break;
			case "answer_4_a":
				output = ""+ correct +"<p>In Sub-Saharan Africa, the chance of a women dying whilst giving birth is 1 woman in 22.  That's one woman dying every minute</p>";
				break;
			case "answer_4_b":
			case "answer_4_c":
			case "answer_4_d":
				output = ""+ incorrect +"";
				break;
		}
		$(".quiz_intro").remove();
		$("div#" + quiz_answer.substring(0,8) + "_comment").remove();
		$(this).parent().prepend("<div id='" + quiz_answer.substring(0,8) + "_comment'>" + output + "</div>");

		return false;
	});	
}