﻿
function validateRealExForm() {

    var theForm = document.forms['aspnetForm'];
    if (!theForm) {
        theForm = document.aspnetForm;
    }

    if (theForm.agree.checked == true) {
      
        var saleAmount = theForm.CD_saleAmount;
        var saleAmountVal = 1.0;

        saleAmountVal = parseFloat(saleAmount.value);
        
        if (saleAmountVal > 0.0) {  // Go to RealEx if there is an amount to be charged.
            theForm.action = theForm.RealExURL.value;
        } else {
            alert('You are now being directed to "My Document" section of the website where you can begin editing your Safety Statement Document.');            
        }
        
        return true;
    } else {
        alert("You have not accepted the Terms and Conditions for using this site.   You must agree to these terms before you can continue with your registration.");
        return false;
    }  
}