var threepoints = 'aabbccccccaabbaccacbb';
var twopoints = 'bbccbbbbbbcccbacaca';
 
function check() {
	var score = 0;
	for(var i=1;i<=21;i++) {
		for(var x=0;x<3;x++) {
			if(document.quiz.elements["q"+i][x].checked) {
				if(threepoints.charAt(i-1) == document.quiz.elements["q"+i][x].value) {
					score += 3;
				} else if(twopoints.charAt(i-1) == document.quiz.elements["q"+i][x].value) {
					score += 2;
				} else {
					score += 1;
				}
			}
		}
	}
	var msg;
	if(score <= 32) {
		msg = "Whoa, your child is in the major leagues in the externally directed department. He relies on everybody elseís thoughts and beliefs to run his life. Dangerously in need of his own mind.";
	} else if(score <= 42) {
		msg = "Could be worse. Your kid occasionally makes her own choices, but is vulnerable to the opinions, evaluations and approval of others.";
	} else if(score <= 52) {
		msg = "Your kid usually thinks for himself and might become more self-directed with maturity. The good news is that he does have a mind of his own and is actually using his head for something other than a hat rack from time to time.";
	} else {
		msg = "Wow! Good job! You are the supreme parental raiser of self-directed children. Your kid makes her choices using reason. She is blessed with a high self-esteem, a deep sense of integrity and solid self-confidence. She is competent, independent and unafraid to face failure or take risks. And because she finds ways to be an asset within any group, she will make great strides in life, both personally and for any group she chooses to belong to. (Can I send my kids over to your place for a few months?)";
	}
	alert(msg);
}
