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 a capacity to live the celibate life well. ");
		return false;
	}
	if (yesCount == 0) {
		alert("Your answers indicate that you might have difficulty living the celibate life well. ");
		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;
}


