var clickedButton = 0;

function setButton(bv) {
	clickedButton = bv;
}

function validateCQuiz(theForm) {
	if (clickedButton == 2) {
		window.close();
		return false;
	}
	var noCount = 0;
	var yesCount = 0;
	if (theForm.question1[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question2[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question3[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question4[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question5[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question6[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question7[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question8[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question9[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question10[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question11[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question12[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question13[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question14[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
if (theForm.question15[0].checked == true) {
    yesCount++;
} else {
    noCount++;
}
	if ( yesCount == 15 ) {
		alert("Congratulations, your answers indicate that you have the capacity to live the celibate life well");
		return false;
	}
	if ( yesCount >=10 && yesCount < 15 ) {
		alert("Your answers indicate that you might have some issues to be resolved before committing to the celibate life.");
		return false;
	}
	if (yesCount >= 5 && yesCount <= 9) {
		alert("You have a number of issues to be resolved before committing to the celibate life.");
		return false;
	}
	if (yesCount >= 0 && yesCount <= 4) {
		alert("The number of negative answers you've given indicates that you are very likely not yet prepared to live the celibate life.");
		return false;
	}
	alert("Your answers indicate that you have a capacity to live the celibate life well, but some issues might need to be resolved before making a full commitment. ");
	return false;
}



