// Validate mandatory fields
function checkMandatoryFields(form) {
	// Flag to indicate if all mandatory fields are completed and all date inputs are valid
	var isValid = true;
	var focusEval = "";

	// Validate Question 16071
	if(!checkRadioGroup(form, "q_16071", false)) {
		isValid = false;
		document.getElementById("f_16071").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('a_16071').focus()";
		}
	}
	else {
		document.getElementById("f_16071").color = "FFFFFF";
	}

	// Validate Question 16072
	if(!checkRadioGroup(form, "q_16072", false)) {
		isValid = false;
		document.getElementById("f_16072").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('a_16072').focus()";
		}
	}
	else {
		document.getElementById("f_16072").color = "FFFFFF";
	}

	// Indicates that another answer in the single question has failed validation
	var b_16072_AnsMandFailed = false;

	// Validate Question 16072, Answer 15, for associated Text
	if(!checkRadioGroupText(form, "q_16072", 15)) {
		isValid = false;
		document.getElementById("f_16072").color = "FF0000";
		document.getElementById("f_16072_15").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('q_16072_15_Text').focus()";
		}
		b_16072_AnsMandFailed = true;
	}
	else {
		if(checkRadioGroup(form, "q_16072", false) && !b_16072_AnsMandFailed)
		document.getElementById("f_16072").color = "FFFFFF";
		document.getElementById("f_16072_15").color = "000000";
	}

	// Validate Question 16073
	if(!checkCheckBoxGroup(form, "q_16073", 14, false)) {
		isValid = false;
		document.getElementById("f_16073").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('a_16073').focus()";
		}
	}
	else {
		document.getElementById("f_16073").color = "FFFFFF";
	}

	// Indicates that another answer in the multiple question has failed validation
	var b_16073_AnsMandFailed = false;

	// Validate Question 16073, Answer 14, for associated Text
	if(!checkCheckBoxText(form, "q_16073", 14)) {
		isValid = false;
		document.getElementById("f_16073").color = "FF0000";
		document.getElementById("f_16073_14").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('q_16073_14_Text').focus()";
		}
		b_16073_AnsMandFailed = true;
	}
	else {
		if(checkCheckBoxGroup(form, "q_16073", 14, false) && !b_16073_AnsMandFailed)
			document.getElementById("f_16073").color = "FFFFFF";
		document.getElementById("f_16073_14").color = "000000";
	}

var centresValid = true;
	var seatsValid = true;

	// Validate Question 16074
	if(!checkSingle("q_16074", false)) {
		centresValid = false;
	}

	// Validate Question 16075
	if(!checkSingle("q_16075", false)) {
		centresValid = false;
	}

	// Validate Question 16076
	if(!checkSingle("q_16076", false)) {
		centresValid = false;
	}

	// Validate Question 16077
	if(!checkSingle("q_16077", false)) {
		seatsValid = false;
	}

	// Validate Question 16078
	if(!checkSingle("q_16078", false)) {
		seatsValid = false;
	}

	// Validate Question 16079
	if(!checkSingle("q_16079", false)) {
		seatsValid = false;
	}

	if(!centresValid) {
		isValid = false;
		document.getElementById("f_centre").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('a_centre').focus()";
		}
	}
	else {
		document.getElementById("f_centre").color = "000000";
	}
	
	if(!seatsValid) {
		isValid = false;
		document.getElementById("f_seat").color = "FF0000";
		if (focusEval == "") {
			focusEval = "document.getElementById('a_seat').focus()";
		}
	}
	else {
		document.getElementById("f_seat").color = "000000";
	}
	if (!isValid) {
		alert("Please answer all highlighted questions.");
		eval(focusEval);
	}

	return isValid;
}

