for (i=1;i<7;i++){			
	$j("#answer"+i).slider({
		value:5,
		min: 0,
		max: 10,
		step: 1
	});
	
}

function signup(){
	if($j("#mc-embedded-subscribe-form-quiz").valid()) {
	   $j('#mc-embedded-subscribe-form-quiz').submit();
	   alert('submitted');
		$j('#mc_embed_signup.quiz').hide("fast");
		$j('#quiz-err').addClass("quiz-ok");
		$j('#quiz-err').html("We've added your email to the list. Check your e-mail account now to confirm sign-up!");
		pageTracker._trackPageview('/signup-success');
	} else {
		//$j('#quiz-err').html("Please provide a valid e-mail address!");	
		//$j('#quiz-err').addClass("quiz-err");
		return;
	}
}
function tally(){

	var ttl = 0;
	for (i=1;i<7;i++){			
		ttl = ttl + $j("#answer"+i).slider("value");
	}
	$j("#quiz-questions").hide("fast");
	$j("#quiz-results").show("fast");
	$j("#nl").show("fast");

	//scale of 100
	//0 to 24 = 0 to 40
	//25 to 43 = 41 to 71
	//44 to 60 = 72 to 100
	var needleValue = (ttl * 100) / 60;

	var msg = "";
	if(needleValue < 41){
		msg = "Probably not a good fit";
	} else if (needleValue < 72) {
    	msg = "May be worth a no cost initial meeting: <a class='ln-white' href='/contact'>Contact Us</a>";
	} else {
    	msg = "<a class='ln-white' href='/contact'>Contact Us</a>: you are highly likely to be a good fit!";
	}

	$j('#evaluation').html(msg);
	    
	var gauge = bindows.loadGaugeIntoDiv("/themes/cfa/gauge/gauge.xml", "gaugeDiv");
	gauge.needle.setValue(needleValue);
	gauge.label.setText(parseInt(needleValue) + "!");

}
