function toggleMe(a){ 
	var e=document.getElementById(a);
	if(!e)return true;
	if(e.style.display=="none"){ 
		e.style.display="block" 
	} else { 
		e.style.display="none" 
	} 
}

function IsValidForm(theform) {
    total = 0; /*Begin Question 01*/
    if (!theform.question01[0].checked && !theform.question01[1].checked && !theform.question01[2].checked && !theform.question01[3].checked && !theform.question01[4].checked) {
        alert("Please answer the question: What is your age range?");
        return (false);
    }
    if (theform.question01[0].checked) {
        total = (total + ((theform.question01[0].value) * 100) / 100)
    }
    if (theform.question01[1].checked) {
        total = (total + ((theform.question01[1].value) * 100) / 100)
    }
    if (theform.question01[2].checked) {
        total = (total + ((theform.question01[2].value) * 100) / 100)
    }
    if (theform.question01[3].checked) {
        total = (total + ((theform.question01[3].value) * 100) / 100)
    }
    if (theform.question01[4].checked) {
        total = (total + ((theform.question01[4].value) * 100) / 100)
    } /*End Question 01*/
    /*Begin Question 02*/
    if (!theform.question02[0].checked && !theform.question02[1].checked && !theform.question02[2].checked && !theform.question02[3].checked && !theform.question02[4].checked) {
        alert("Please answer the question: How would you describe your investment knowledge?");
        return (false);
    }
    if (theform.question02[0].checked) {
        total = (total + ((theform.question02[0].value) * 100) / 100)
    }
    if (theform.question02[1].checked) {
        total = (total + ((theform.question02[1].value) * 100) / 100)
    }
    if (theform.question02[2].checked) {
        total = (total + ((theform.question02[2].value) * 100) / 100)
    }
    if (theform.question02[3].checked) {
        total = (total + ((theform.question02[3].value) * 100) / 100)
    }
    if (theform.question02[4].checked) {
        total = (total + ((theform.question02[4].value) * 100) / 100)
    } /*End Question 02*/
    /*Begin Question 03*/
    if (!theform.question03[0].checked && !theform.question03[1].checked && !theform.question03[2].checked && !theform.question03[3].checked && !theform.question03[4].checked) {
        alert("Please answer the question: How secure are your sources of income?");
        return (false);
    }
    if (theform.question03[0].checked) {
        total = (total + ((theform.question03[0].value) * 100) / 100)
    }
    if (theform.question03[1].checked) {
        total = (total + ((theform.question03[1].value) * 100) / 100)
    }
    if (theform.question03[2].checked) {
        total = (total + ((theform.question03[2].value) * 100) / 100)
    }
    if (theform.question03[3].checked) {
        total = (total + ((theform.question03[3].value) * 100) / 100)
    }
    if (theform.question03[4].checked) {
        total = (total + ((theform.question03[4].value) * 100) / 100)
    } /*End Question 03*/
    /*Begin Question 04*/
    if (!theform.question04[0].checked && !theform.question04[1].checked && !theform.question04[2].checked && !theform.question04[3].checked) {
        alert("Please answer the question: Which statement best describes what you want from your investment?");
        return (false);
    }
    if (theform.question04[0].checked) {
        total = (total + ((theform.question04[0].value) * 100) / 100)
    }
    if (theform.question04[1].checked) {
        total = (total + ((theform.question04[1].value) * 100) / 100)
    }
    if (theform.question04[2].checked) {
        total = (total + ((theform.question04[2].value) * 100) / 100)
    }
    if (theform.question04[3].checked) {
        total = (total + ((theform.question04[3].value) * 100) / 100)
    } /*End Question 04*/
    /*Begin Question 05*/
    if (!theform.question05[0].checked && !theform.question05[1].checked && !theform.question05[2].checked && !theform.question05[3].checked && !theform.question05[4].checked) {
        alert("Please answer the question: When will you need this money?");
        return (false);
    }
    if (theform.question05[0].checked) {
        total = (total + ((theform.question05[0].value) * 100) / 100)
    }
    if (theform.question05[1].checked) {
        total = (total + ((theform.question05[1].value) * 100) / 100)
    }
    if (theform.question05[2].checked) {
        total = (total + ((theform.question05[2].value) * 100) / 100)
    }
    if (theform.question05[3].checked) {
        total = (total + ((theform.question05[3].value) * 100) / 100)
    }
    if (theform.question05[4].checked) {
        total = (total + ((theform.question05[4].value) * 100) / 100)
    } /*End Question 05*/
    /*Begin Question 06*/
    if (!theform.question06[0].checked && !theform.question06[1].checked && !theform.question06[2].checked && !theform.question06[3].checked && !theform.question06[4].checked) {
        alert("Please answer the question: How would you react if the value of your portfolio suddenly dropped by 20%?");
        return (false);
    }
    if (theform.question06[0].checked) {
        total = (total + ((theform.question06[0].value) * 100) / 100)
    }
    if (theform.question06[1].checked) {
        total = (total + ((theform.question06[1].value) * 100) / 100)
    }
    if (theform.question06[2].checked) {
        total = (total + ((theform.question06[2].value) * 100) / 100)
    }
    if (theform.question06[3].checked) {
        total = (total + ((theform.question06[3].value) * 100) / 100)
    }
    if (theform.question06[4].checked) {
        total = (total + ((theform.question06[4].value) * 100) / 100)
    } /*End Question 06*/
    /*Begin Question 07*/
    if (!theform.question07[0].checked && !theform.question07[1].checked && !theform.question07[2].checked && !theform.question07[3].checked && !theform.question07[4].checked) {
        alert("Please answer the question: Which of the following statements best describes the trade-off you would be most willing to make with your investment?");
        return (false);
    }
    if (theform.question07[0].checked) {
        total = (total + ((theform.question07[0].value) * 100) / 100)
    }
    if (theform.question07[1].checked) {
        total = (total + ((theform.question07[1].value) * 100) / 100)
    }
    if (theform.question07[2].checked) {
        total = (total + ((theform.question07[2].value) * 100) / 100)
    }
    if (theform.question07[3].checked) {
        total = (total + ((theform.question07[3].value) * 100) / 100)
    }
    if (theform.question07[4].checked) {
        total = (total + ((theform.question07[4].value) * 100) / 100)
    } /*End Question 07*/
    /* alert("total: " + total) */
    if (total < 18) {
		toggleMe("the_form");
        toggleMe("profile1");
    }
    if (total > 17 && total < 29) {
		toggleMe("the_form");
      	toggleMe("profile2");
    }
    if (total > 28) {
		toggleMe("the_form");
        toggleMe("profile3");
    }
}
