function validateThis(f, num) {
	// checks that all radio button groups have been checked
	for (var i=0; i < f.length; i++) {
		if (f[i].type == "radio" && f[i].checked) {
			num--;
		}
	}
	if (num == 0) {
		return true; // short circuit: correct number of radio buttons checked
	}
	alert("Please answer all questions. There are still " + num + " questions to answer");
	return false;
}