	
	
function toggleCheck(thisField) {
	checkSet = eval("document.finQuizForm."+thisField)
	checkSet.checked = !(checkSet.checked)
}
function toggleRadio(thisField,thisValue) {
	radioSet = eval("document.finQuizForm."+thisField)
	for (i=0;i<radioSet.length;i++) {
		if (radioSet[i].value == thisValue) {
			radioSet[i].checked = true
		}
	}
}

 function validateAnswers() {
     var correct = 0;
     var wrong = 0;
     var blank = 0;
     for (var i=0;i<15;i++) {
         var yesChoice = eval("document.finQuizForm.quest" + i + "[0].checked");
         var noChoice  = eval("document.finQuizForm.quest" + i + "[1].checked");
         var yesAnswer = eval("document.finQuizForm.quest" + i + "[0].value");
         var noAnswer  = eval("document.finQuizForm.quest" + i + "[1].value");

         if (yesChoice == noChoice)
             blank++; 
         else {
			if ((yesChoice.toString() == yesAnswer) && (noChoice.toString() == noAnswer)) {
				correct++;
			}
			else {
				wrong++;
			}
		 }
     }

     document.finQuizForm.correct.value = correct;
     document.finQuizForm.blank.value = blank;
 }
 
function popupAnswer() {
	if (document.finQuizForm.blank.value > 0){
		alert ("Please answer all questions in the quiz");
	}
	else if (document.finQuizForm.correct.value>7) {
		popup = "<html><head></head><body><font face=\'Arial,Helvetica,sans-serif\' size=\'-1\'><p>It's time for Crisis Control! You need to Reduce the amount of your debt. The first thing to do is to determine how much you owe. Identify ways that you can decrease your expenses and/or increase your income.</p><p>A Clearpoint Credit Counseling Debt Management Program can help you get out of debt by consolidating your unsecured debts into one affordable monthly payment and working with creditors to lower interest rates and waive fees.<a href=\'#\' onClick=\"window.opener.location='http://www.credit-counselors.cc/get_started/get_started.asp';window.close();\">Join Now.</a> <p><a href=\'#\' onClick=\'window.close()\'>CLOSE WINDOW</a></p></body></html>";
		libsWin = window.open("","","width=400,height=300,left=125,top=125,scrollbars=yes,menubar=yes,toolbar=yes");
		libsWin.document.write(popup);
		libsWin.document.close();
		return false;
	}
	else if (document.finQuizForm.correct.value<=3){
		popup = "<html><head></head><body><font face=\'Arial,Helvetica,sans-serif\' size=\'-1\'>"
				+ "<p>Congratulations! It looks like you are able to manage your debt and your finances.</p><p>Do you have a "
				+ "saving plan in place? If you don\'t start one today. "
				+ "Your savings can be there to help support you in times of financial emergency or provide for your retirement years. Remember, "
				+ "it\'s never too early, or too late, to save.<p>Have you thought about your personal and financial goals? Now is the time to "
				+ "develop short and long-term goals that can help you gain financial freedom. " 
				+ "Identify your goals "
				+ "and stick to a strategy to achieve your objectives.</p><p><a href=\'#\' onClick=\'window.close()\'>CLOSE WINDOW</a></p></body></html>";
		libsWin = window.open("","","width=400,height=300,left=125,top=125,scrollbars=yes,menubar=yes,toolbar=yes");
		libsWin.document.write(popup);
		libsWin.document.close();
		return false;
	}
	else if (document.finQuizForm.correct.value>3 && document.finQuizForm.correct.value<=7){
		popup = "<html><head></head><body><font face=\'Arial,Helvetica,sans-serif\' size=\'-1\'><p>Your debt may be within manageable limits. When paying off your debt, be sure to make more than the minimum monthly payment (<a href=\'#\' onClick=\"window.opener.location='/credit_counseling_learn.aspx';window.close();\">credit card tips</a>) so that more money can be applied toward the principal of your debt.</p><p>Also, try to achieve a <a href=\'#\' onClick=\"window.opener.location='/credit_counseling_ratio.aspx';window.close();\">debt-to-income</a> ratio less than 20 percent.</p><p>Small savings add up, <a href=\'#\' onClick=\"window.opener.location='/credit_counseling_tips.aspx';window.close();\">look for everyday ways to save.</a> You can save hundreds or even thousands of dollars every year!  Now may also be the time to begin developing short- and long-term goals that can help you gain financial freedom.  Identify your goals and stick to a strategy to achieve your objectives.</p><p><a href=\'#\' onClick=\"window.close();\">CLOSE WINDOW</a></p></body></html>";
		libsWin = window.open("","","width=400,height=300,left=125,top=125,scrollbars=yes,menubar=yes,toolbar=yes");
		libsWin.document.write(popup);
		libsWin.document.close();
		return false;
	}
	return true;
}
				
var win = null;
	
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}	
					
	
 //-->
