	var correctTextColor = '#439F43';
	var correctBackgroundColor = '#E2F0DE';
	var errorColor = '#FF0000';
	var black = '#000000';
	
	function loadTrackingImage(x)
	{
	  var d = document;
	  d.i = new Image;
	  d.i.src=x;
	}
	
	function formatCorrectAnswer(questionNumber, correctAnswerNumber) {
		//Make the text that indicates the answer was correct visible
		document.getElementById("answer"+questionNumber).style.visibility = 'visible';
		document.getElementById("answer"+questionNumber).style.display = 'block';

		//Change the color of the question to green
		document.getElementById("question"+questionNumber).style.color = correctTextColor;

		//Higlight the background of the correct answer
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.color = black;
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.width = '300px';
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.backgroundColor = correctBackgroundColor;
	
	}

	function formatWrongAnswer(questionNumber, correctAnswerNumber) {
		//Make the text that indicates the answer was incorrect visible
		document.getElementById("erroranswer"+questionNumber).style.visibility = 'visible';
		document.getElementById("erroranswer"+questionNumber).style.display = 'block';
	
		//Change the color of the question to red
		document.getElementById("question"+questionNumber).style.color = errorColor;

		//Highlight the background of the correct answer 
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.color = black;
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.width = '300px';
		document.getElementById("q"+questionNumber+correctAnswerNumber).style.backgroundColor = correctBackgroundColor;
	
	}

	function highlightWrongAnswer(questionNumber, question) {
		var answerIndex;
		var numAnswers;

		//Iterate through all of the answer and change the color to red for those that are wrong (checked)
		for (j=0;j<question.length;j++) {
			if (question[j].checked) {
				answerIndex = j + 1;
				document.getElementById("q"+questionNumber+answerIndex).style.color = errorColor;
				document.getElementById("q"+questionNumber+answerIndex).style.fontWeight = 'bold';
			}
		}

	}

	function submitQuiz() {

		if (document.quiz.q1[3].checked != true) {
			formatWrongAnswer(1, 4);
			highlightWrongAnswer(1, document.quiz.q1);

		} else if (document.quiz.q1[3].checked == true) {
			formatCorrectAnswer(1, 4);
		}

		if (document.quiz.q2[1].checked != true) {
			formatWrongAnswer(2, 2);
			highlightWrongAnswer(2, document.quiz.q2);
		} else if (document.quiz.q2[1].checked == true) {
			formatCorrectAnswer(2, 2);
		}

		if (document.quiz.q3[2].checked != true) {
			formatWrongAnswer(3, 3);
			highlightWrongAnswer(3, document.quiz.q3);
		} else if (document.quiz.q3[2].checked == true) {
			formatCorrectAnswer(3, 3);
		}

		if (document.quiz.q4[0].checked != true) {
			formatWrongAnswer(4, 1);
			highlightWrongAnswer(4, document.quiz.q4);
		} else if (document.quiz.q4[0].checked == true) {
			formatCorrectAnswer(4, 1);
		}

		if (document.quiz.q5[1].checked != true) {
			formatWrongAnswer(5, 2);
			highlightWrongAnswer(5, document.quiz.q5);
		} else if (document.quiz.q5[1].checked == true) {
			formatCorrectAnswer(5, 2);
		}

		if (document.quiz.q6[0].checked != true) {
			formatWrongAnswer(6, 1);
			highlightWrongAnswer(6, document.quiz.q6);
		} else if (document.quiz.q6[0].checked == true) {
			formatCorrectAnswer(6, 1);
		}

		//Remove the dashed line and submit button
		document.getElementById("submit_area").style.display = 'none';
		document.getElementById("submit_area").style.visibility = 'hidden';

		//Display the tip for question # 2
		document.getElementById("tip").style.visibility = 'visible';
		document.getElementById("tip").style.display = 'block';
		loadTrackingImage('img/tracking.png?pageID=HealthierLivesCold&FluC&FQuizSubmitButton');
	}

	function deselectAll(index, question) {
		for (var i=0;i<question.length;i++) {
			if ((question[i].checked==true) && (i!=index)) {
				question[i].checked = false;
			}
		}
	}

