
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}


function FrontPage_Form1_Validator(theForm)
{

	if (theForm.companyname.value == "")
  {
    alert("Please enter a value for the \"Company Name\" field.");
    theForm.companyname.focus();
    return (false);
  }

  if (theForm.companystreet.value == "")
  {
    alert("Please enter a value for the \"Company Address\" field.");
    theForm.companystreet.focus();
    return (false);
  }

  if (theForm.companycity.value == "")
  {
    alert("Please enter a value for the \"Company City\" field.");
    theForm.companycity.focus();
    return (false);
  }

  if (theForm.companystate.value == "")
  {
    alert("Please enter a value for the \"Company State\" field.");
    theForm.companystate.focus();
    return (false);
  }

  if (theForm.companyzipcode.value == "")
  {
    alert("Please enter a value for the \"Company Zipcode\" field.");
    theForm.companyzipcode.focus();
    return (false);
  }

  if (theForm.companyphone1.value == "")
  {
    alert("Please enter a value in the first \"Company Telephone\" field.");
    theForm.companyphone1.focus();
    return (false);
  }

  if (theForm.companyphone2.value == "")
  {
    alert("Please enter a value in the second \"Company Telephone\" field.");
    theForm.companyphone2.focus();
    return (false);
  }

  if (theForm.companyphone3.value == "")
  {
    alert("Please enter a value in the thrid \"Company Telephone\" field.");
    theForm.companyphone3.focus();
    return (false);
  }

  if (theForm.fax1.value == "")
  {
    alert("Please enter a value in the first \"Company Fax\" field.");
    theForm.fax1.focus();
    return (false);
  }

  if (theForm.fax2.value == "")
  {
    alert("Please enter a value in the second \"Company Fax\" field.");
    theForm.fax2.focus();
    return (false);
  }

  if (theForm.fax3.value == "")
  {
    alert("Please enter a value in the third \"Company Fax\" field.");
    theForm.fax3.focus();
    return (false);
  }

  if (theForm.companyyrsinbusiness.value == "")
  {
    alert("Please enter a value for the \"TIB\" field.");
    theForm.companyyrsinbusiness.focus();
    return (false);
  }

  if (theForm.companyFederalTaxID.value == "")
  {
    alert("Please enter a value for the \"Federal Tax ID\" field.");
    theForm.companyFederalTaxID.focus();
    return (false);
  }

  if (theForm.companystructure.value == "")
  {
    alert("Please enter a value for the \"Type of Business\" field.");
    theForm.companystructure.focus();
    return (false);
  }





if (theForm.owner1firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.owner1firstname.focus();
    return (false);
  }

  if (theForm.owner1lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.owner1lastname.focus();
    return (false);
  }

  if (theForm.owner1title.value == "")
  {
    alert("Please enter a value for the \"Title\" field.");
    theForm.owner1title.focus();
    return (false);
  }

if (theForm.owner1ssn1.value == "")
  {
    alert("Please enter a value for the first \"Social Security Number\" field.");
    theForm.owner1ssn1.focus();
    return (false);
  }

  if (theForm.owner1ssn2.value == "")
  {
    alert("Please enter a value for the second \"Social Security Number\" field.");
    theForm.owner1ssn2.focus();
    return (false);
  }

if (theForm.owner1ssn3.value == "")
  {
    alert("Please enter a value for the third \"Social Security Number\" field.");
    theForm.owner1ssn3.focus();
    return (false);
  }

if (theForm.owner1homeaddress.value == "")
  {
    alert("Please enter a value for the \"Home Address\" field.");
    theForm.owner1homeaddress.focus();
    return (false);
  }

  if (theForm.owner1city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.owner1city.focus();
    return (false);
  }

  if (theForm.owner1state.value == "")
  {
    alert("Please enter a value for the \"State\" field.");
    theForm.owner1state.focus();
    return (false);
  }

  if (theForm.owner1zipcode.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.owner1zipcode.focus();
    return (false);
  }

  if (theForm.homephone1.value == "")
  {
    alert("Please enter a value in the first \"Home Phone\" field.");
    theForm.homephone1.focus();
    return (false);
  }

  if (theForm.homephone2.value == "")
  {
    alert("Please enter a value in the second \"Home Phone\" field.");
    theForm.homephone2.focus();
    return (false);
  }

  if (theForm.homephone3.value == "")
  {
    alert("Please enter a value in the third \"Home Phone\" field.");
    theForm.homephone3.focus();
    return (false);
  }

  if (theForm.owner1emailaddress.value == "")
  {
    alert("Please enter a value for the \"Email Address\" field.");
    theForm.owner1emailaddress.focus();
    return (false);
  }



if (theForm.bank1.value == "")
  {
    alert("Please enter a value for the \"Bank Name\" field.");
    theForm.bank1.focus();
    return (false);
  }

  if (theForm.bank1accountnumber.value == "")
  {
    alert("Please enter a value for the \"Bank Account Number\" field.");
    theForm.bank1accountnumber.focus();
    return (false);
  }

  if (theForm.bank1phone1.value == "")
  {
    alert("Please enter a value in the first \"Bank Phone\" field.");
    theForm.bank1phone1.focus();
    return (false);
  }

  if (theForm.bank1phone2.value == "")
  {
    alert("Please enter a value in the second \"Bank Phone\" field.");
    theForm.bank1phone2.focus();
    return (false);
  }

  if (theForm.bank1phone3.value == "")
  {
    alert("Please enter a value in the third \"Bank Phone\" field.");
    theForm.bank1phone3.focus();
    return (false);
  }

  if (theForm.bank1address.value == "")
  {
    alert("Please enter a value for the \"Bank Address\" field.");
    theForm.bank1address.focus();
    return (false);
  }

  return (true);
}