	<script type="text/javascript" src="bin-clt/validator.js"></script>
		
			function getAncestor(node, parentNodeName) {
				while (node) {
					if (node.nodeName
						&& node.nodeName.toLowerCase() == parentNodeName.toLowerCase()
					) return node;
					node = node.parentNode;
				}
				return null;
			}
			
			var isEmptyRule = new Validator.Rule(
				function(v){
					var b = false;
					for (var i = 0; i < v.length; i++) {
						if (v[i].checked) {
							b = true;
							break;
						}
					}
					return b;
				},
				"Must choose a value."
			);
			
			var onFail = new Validator.Handler(function(elm, msg){
				var c = document.getElementById(elm[0].name + "-label");
				if (c) {
					c.style.color = "#930";
					c.setAttribute("title", msg);
				}
			});
			
			//	set up the exams
			var v = new Validator();
			v.AddExam(new Validator.Exam("Question 1", "skintype", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 2", "acne", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 3", "shaving", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 4", "facialhair", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 5", "sensitivity", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 6", "puffiness", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 7", "backacne", [isEmptyRule], onFail));
			v.AddExam(new Validator.Exam("Question 8", "age", [isEmptyRule], onFail));
			
			function validate(f) {
				var b = v.Invoke(f);
				if (!b) alert("Please answer the questions in red before submitting.");
				return b;
}
