






    function computeForm() {

        if (document.calc.downpayment.value == null || document.calc.downpayment.value.length == 0)
            document.calc.downpayment.value = 0;

        if ((document.calc.interest.options[document.calc.interest.selectedIndex].value == null || document.calc.interest.options[document.calc.interest.selectedIndex].value.length == 0) ){
		alert("You must choose an interest rate.");
            return false;
        }

        if ((document.calc.payments.options[document.calc.payments.selectedIndex].value == null || document.calc.payments.options[document.calc.payments.selectedIndex].value.length == 0) ){
		alert("You must choose number of months.");
            return false;
        }


        if ((document.calc.principal.value == null || document.calc.principal.value.length == 0) ){
		alert("You must choose an principal.");
            return false;
        }
amount = document.calc.principal.value
newamount = ""
        for (var i = 0; i < amount.length; i++) {
            var ch = amount.substring(i, i + 1)
            if ((ch < "0" || "9" < ch) && ch != '.') {

            }else{
	newamount = newamount + ch
	}
        }

        var i = document.calc.interest.options[document.calc.interest.options.selectedIndex].value;
        if (i=="0.0"){
            months =  document.calc.payments.options[document.calc.payments.options.selectedIndex].value;
            newamount = newamount - document.calc.downpayment.value;
            returnpayment = eval(newamount)/months; 
        }else{
        i=i/100;
        i /= 12;

        var pow = 1;
        for (var j = 0; j < document.calc.payments.options[document.calc.payments.options.selectedIndex].value; j++)
            pow = pow * (1 + i);

		var returnpayment = ((eval(newamount) - document.calc.downpayment.value) * pow * i) / (pow - 1);
}
	        document.calc.calcresults.value = Math.round(returnpayment + 1) + ".00";
		return;
    }





