
function validateContactForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if (document.contactForm.name.value == "") {
    incomplete = 1;
    msg = "Please type your first and last name." + vbCRLF;
  }
  if (document.contactForm.phone.value == "") {
    incomplete = 1;
    msg += "Please type your phone #." + vbCRLF;
  }
  if (document.contactForm.email.value == "" || document.contactForm.email.value.indexOf("@")==-1 || document.contactForm.email.value.indexOf(".")==-1 ) {
    incomplete = 1;
    msg += "Please type a valid email address." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.contactForm.submit();
  }

}

function validateLeasingForm() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if ((document.leasingForm.apartmentType.value == "") || (document.leasingForm.apartmentOccupancy.value == "") || (document.leasingForm.apartmentLease.value == "") || (document.leasingForm.apartmentHow.value == "") || (document.leasingForm.applicantName.value == "") || (document.leasingForm.applicantSS.value == "") || (document.leasingForm.applicantBirth.value == "") || (document.leasingForm.applicantNumberOccupants.value == "") || (document.leasingForm.applicantNamesOccupants.value == "") || (document.leasingForm.applicantHomePhone.value == "") || (document.leasingForm.applicantWorkPhone.value == "") || (document.leasingForm.applicantTime.value == "") || (document.leasingForm.applicantEmail.value == "") || (document.leasingForm.applicantPets.value == "") || (document.leasingForm.housingPresentAddress.value == "") || (document.leasingForm.housingPresentCity.value == "") || (document.leasingForm.housingPresentState.value == "") || (document.leasingForm.housingPresentZip.value == "") || (document.leasingForm.housingPresentHow.value == "") || (document.leasingForm.housingPresentRent.value == "") || (document.leasingForm.housingPresentLandlord.value == "") || (document.leasingForm.housingPresentPhone.value == "") || (document.leasingForm.housingPresentReason.value == "") || (document.leasingForm.housingPreviousAddress.value == "") || (document.leasingForm.housingPreviousCity.value == "") || (document.leasingForm.housingPreviousState.value == "") || (document.leasingForm.housingPreviousZip.value == "") || (document.leasingForm.housingPreviousHow.value == "") || (document.leasingForm.housingPreviousRent.value == "") || (document.leasingForm.housingPreviousLandlord.value == "") || (document.leasingForm.housingPreviousPhone.value == "") || (document.leasingForm.employmentPresent.value == "") || (document.leasingForm.employmentPresentAddress.value == "") || (document.leasingForm.employmentPresentCity.value == "") || (document.leasingForm.employmentPresentHowLong.value == "") || (document.leasingForm.employmentPresentPosition.value == "") || (document.leasingForm.employmentPresentSupervisor.value == "") || (document.leasingForm.employmentPresentPhone.value == "") || (document.leasingForm.employmentPresentSalary.value == "") || (document.leasingForm.employmentPresentPer.value == "") || (document.leasingForm.employmentPresentOvertime.value == "") || (document.leasingForm.employmentPreviuos.value == "") || (document.leasingForm.employmentPreviuosAddress.value == "") || (document.leasingForm.employmentPreviuosCity.value == "") || (document.leasingForm.employmentPreviuosHowLong.value == "") || (document.leasingForm.employmentPreviuosPosition.value == "") || (document.leasingForm.employmentPreviuosSupervisor.value == "") || (document.leasingForm.employmentPreviuosPhone.value == "") || (document.leasingForm.employmentPreviuosSalary.value == "") || (document.leasingForm.employmentPreviuosPer.value == "") || (document.leasingForm.employmentPreviuosOvertime.value == "") || (document.leasingForm.vehicle.value == "") || (document.leasingForm.driversLicense.value == "") || (document.leasingForm.spousesVehicle.value == "") || (document.leasingForm.emergencyContact.value == "") || (document.leasingForm.emergencyAddress.value == "") || (document.leasingForm.emergencyPhone.value == "")) {
    incomplete = 1;
    msg = "Please fill out all the fields." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.leasingForm.submit();
  }

}

function validateLeasingForm1() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if ((document.leasingForm1.landlordApplicant.value == "") || (document.leasingForm1.landlordDate.value == "") || (document.leasingForm1.landlordLandlord.value == "") || (document.leasingForm1.landlordAddress.value == "") || (document.leasingForm1.landlordCity.value == "") || (document.leasingForm1.landlordState.value == "") || (document.leasingForm1.landlordZip.value == "") || (document.leasingForm1.landlordPhone.value == "") || (document.leasingForm1.landlordFax.value == "")) {
    incomplete = 1;
    msg = "Please fill out all the fields." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.leasingForm1.submit();
  }

}

function validateLeasingForm2() {

  var vbCRLF = String.fromCharCode(13,10);
  var incomplete = 0, msg = "";

  if ((document.leasingForm2.employmentApplicant.value == "") || (document.leasingForm2.employmentDate.value == "") || (document.leasingForm2.employmentEmployer.value == "") || (document.leasingForm2.employmentAddress.value == "") || (document.leasingForm2.employmentCity.value == "") || (document.leasingForm2.employmentState.value == "") || (document.leasingForm2.employmentZip.value == "") || (document.leasingForm2.employmentPhone.value == "") || (document.leasingForm2.employmentFax.value == "")) {
    incomplete = 1;
    msg = "Please fill out all the fields." + vbCRLF;
  }
  if (incomplete == 1) {
    alert(msg);
  }
  else {
    document.leasingForm2.submit();
  }

}
