<!--

function validate() {
        var passed = false;
        if (document.contact.EMail.value.indexOf("@") == -1 ||
            document.contact.EMail.value.indexOf(".") == -1) {
            alert("Please include a proper email address.");
        }
        else {
        passed = true;
        }
        return passed;
}

function req_text(field, msg) {

    if(field.value.length == 0) {
	addMsg(field, msg);
    }
}


function req_number(field, msg) {

    strip_commas(field);
    if(field.value.length == 0 || isNaN(field.value)) {
	addMsg(field, msg);
    }
}


function req_number_amt(field, amt, msg) {

    strip_commas(field);
    if(field.value.length == 0 || isNaN(field.value)) {
	addMsg(field, msg);
    }
    else if(field.value < amt) {
	addMsg(field, msg + " Must be greater than: " + amt);
    }
}

function req_regexp(field, exp_text, msg) {

    req_regexpRE = new RegExp(exp_text);
    if(!req_regexpRE.test(field.value)) {
	addMsg(field, msg);
    }
}

function req_number_length(field, length, msg) {

    strip_commas(field);
    if(field.value.length != length || isNaN(field.value)) {
	addMsg(field, msg);
    }
}

function addMsg(control, msg) {
    theError += "\n\t-" + msg;
    if(errorFree) {
	control.focus();
    }
    errorFree = false;
}


function finish_Validation (theForm) {

   if(!errorFree)
	{
	    alert(theError);
	    return false;
	}
    else if(!submitted)
	{
	    submitted = true;
	    return true;
	}
   return false;
}

function validate() {
	errorFree = true;
    theError = "Please correct the following information:\n";
    
	req_number_amt(contact.Loan_Amount, 0, "Loan Amount");
	req_number_amt(contact.Property_Value, 0, "Property Value");
	req_number_length(contact.Borrower_Homephone, 10, "Home Phone without dashes");
	req_text(contact.Borrower_Name, "First Name");
    req_text(contact.Borrower_Last, "Last Name");
    req_regexp(contact.ApplicantEmail, ".+@.+[.].+", "E-mail Address");
	return finish_Validation(contact);
}
//-->

function startList() {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementById("navList");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" over";
					}
  					node.onmouseout=function() {
  						this.className=this.className.replace(" over", "");
   					}
   				}
  			}
 		}
	}
window.onload= function(){
	startList();
}