<!--
//Declare Function Variables
var CmdValidateData, FindMonthlyPayments

//Function Which Retrieves the form values and calculates the Monthly Payments and Principle
function FindMonthlyPayments(form) {
        principle = form.listprice.value - form.downpayment.value; //Principle = listprice minus downpayment
        intRate = (form.intrate.value/100) / 12; // Monthly Interest = Yearly interest divided 12
        months = form.years.value * 12; //Months = years x 12
        form.payments.value = "$" + Math.floor((principle*intRate)/(1-Math.pow(1+intRate,(-1*months)))*100)/100; //Formula for Mortgage Payment Calc
//        form.principle.value = "$" + principle; //Fill in Principle Field

    }
//Function which Validates Data Submitted
function CmdValidateData_Click(form) {
        if (form.listprice.value == 0 || form.listprice.value.length == 0) {
            alert ("You must fill in the List Price Field"); // Check Price Field
            form.listprice.focus(); }
        else if (form.intrate.value == 0 || form.intrate.value.length == 0) {
            alert ("You Must Fill in the Interest Rate Field"); // Check Interest Field
            form.intrate.focus(); }
        else if (form.years.value == 0 || form.years.value.length == 0) {
            alert ("You must fill in the Loan Time Field");  // Check Loan Time Field
            form.years.focus(); }
        else
            FindMonthlyPayments(form);
    }

// -->
