// JavaScript Document

var bWidth = "1px"
var bColor = "#729C76"

function FormIsReady(){
if (document.Contact.fName.value==""){
document.Contact.fName.focus();
document.getElementById('formfName').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your first name!</font>";
document.getElementById('formfName').style.visibility='Visible';
return false;
}
if (document.Contact.lName.value==""){
document.Contact.lName.focus();
document.getElementById('formlName').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your last name!</font>";
document.getElementById('formlName').style.visibility='Visible';
return false;
}
var email = document.getElementById('email');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
document.Contact.email.focus();
document.getElementById('formemail').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter a valid email address!</font>";
document.getElementById('formemail').style.visibility='Visible';
return false;
}
//alert("going to submit");
document.Contact.submit();
}

function FormIsReadyPreQual(){
if (document.Contact.fName.value==""){
document.Contact.fName.focus();
document.getElementById('formfName').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your first name!</font>";
document.getElementById('formfName').style.visibility='Visible';
return false;
}
if (document.Contact.lName.value==""){
document.Contact.lName.focus();
document.getElementById('formlName').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your last name!</font>";
document.getElementById('formlName').style.visibility='Visible';
return false;
}
if (document.Contact.address.value==""){
document.Contact.address.focus();
document.getElementById('formaddress').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your address!</font>";
document.getElementById('formaddress').style.visibility='Visible';
return false;
}
if (document.Contact.city.value==""){
document.Contact.city.focus();
document.getElementById('formcity').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter the city you live in!</font>";
document.getElementById('formcity').style.visibility='Visible';
return false;
}
if (document.Contact.state.options[
document.Contact.state.selectedIndex].value==""){
document.getElementById('formstate').innerHTML="<font style='font-size:10px; color:#990000; font-style:italic'>Please select the state you live in!</font>";
document.Contact.state.focus();
return false;
}
if (document.Contact.zip.value==""){
document.Contact.zip.focus();
document.getElementById('formzip').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your zip code!</font>";
document.getElementById('formzip').style.visibility='Visible';
return false;
}
if (document.Contact.residence.value==""){
document.Contact.residence.focus();
document.getElementById('formresidence').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter the length of residence!</font>";
document.getElementById('formresidence').style.visibility='Visible';
return false;
}
if (document.Contact.owner.options[
document.Contact.owner.selectedIndex].value==""){
document.getElementById('formowner').innerHTML="<font style='font-size:10px; color:#990000; font-style:italic'>Please select if you are the owner!</font>";
document.Contact.owner.focus();
return false;
}
var email = document.getElementById('email');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
document.Contact.email.focus();
document.getElementById('formemail').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter a valid email address!</font>";
document.getElementById('formemail').style.visibility='Visible';
return false;
}
if (document.Contact.employer.value==""){
document.Contact.employer.focus();
document.getElementById('formemployer').innerHTML="<font style='font-size:11px; color:#990000; font-style:italic'>Please enter your employer name!</font>";
document.getElementById('formemployer').style.visibility='Visible';
return false;
}

//alert("going to submit");
document.Contact.submit();
}