<!--
// Contact.js
function Validate(theForm)
{

// ======================================================================
// First Name
// ======================================================================
  if (theForm.FirstName.value == "")
  {
    alert("Please enter your First Name.");
    theForm.FirstName.focus();
    return (false);
  }

// ======================================================================
// Middle Name
// ======================================================================
  if (theForm.FirstName.value == theForm.MidName.value)
  {
    alert("Invalid Name, please re-enter.");
    theForm.MidName.focus();
    return (false);
  }

// ======================================================================
// Last Name
// ======================================================================
  if (theForm.LastName.value == "")
  {
    alert("Please enter your Last Name.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.LastName.value == theForm.FirstName.value)
  {
    alert("Invalid Name, please re-enter.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == theForm.MidName.value)
  {
    alert("Invalid Name, please re-enter.");
    theForm.MidName.focus();
    return (false);
  }

// ===========================
// Organization 
// ===========================
  if (theForm.Organization.value == "")
  {
    alert("Please enter a value for the \"Organization\" field.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Organization.value == theForm.FirstName.value)
  {
    alert("Invalid Organization Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Organization.value == theForm.MidName.value)
  {
    alert("Invalid Organization Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Organization.value == theForm.LastName.value)
  {
    alert("Invalid Organization Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

// ===========================
// Address 1 
// ===========================
  if (theForm.Address1.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address1.focus();
    return (false);
  }

  if (theForm.Address1.value.length < 7)
  {
    alert("Invalid Address, please re-enter.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Address1.value.length == theForm.FirstName.value)
  {
    alert("Invalid Address, please re-enter.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Address1.value == theForm.MidName.value)
  {
    alert("Invalid Address, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Address1.value == theForm.LastName.value)
  {
    alert("Invalid Address, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.Address1.value == theForm.Organization.value)
  {
    alert("Invalid Address, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

// ======================================================================
// City
// ======================================================================
  if (theForm.City.value == "")
  {
    alert("Please enter your City.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length < 4)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.City.value.length == theForm.FirstName.value)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.City.value == theForm.MidName.value)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.City.value == theForm.LastName.value)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.City.value == theForm.Organization.value)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

  if (theForm.City.value == theForm.Address1.value)
  {
    alert("Invalid City Name, please re-enter.");
    theForm.Organization.focus();
    return (false);
  }

// ===========================
// State 
// ===========================
  if (theForm.State.value == "")
  {
    alert("Please select a \"State\".");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value == "Select State")
  {
    alert("Please select a \"State\".");
    theForm.State.focus();
    return (false);
  }

// ===========================
// Zip 
// ===========================
  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length != 5)
  {
    if (theForm.Zip.value.length != 9)
    {
      if (theForm.Zip.value.length != 10)
      {
        alert("Invalid \"Zip\".");
        theForm.Zip.focus();
        return (false);
      }
    }
  }

// ===========================
// Phone Number
// ===========================
  if (theForm.Phone.value == "")
  {
    alert("Please enter a value for the \"PhoneNumber\" field.");
    theForm.Phone.focus();
    return (false);
  }

  if (!/^[ ]*[(]{0,1}[ ]*[0-9]{3,3}[ ]*[)]{0,1}[-]{0,1}[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/.test(theForm.Phone.value))
  {
    alert("Invalid \"PhoneNumber\", please re-enter.");
    theForm.Phone.focus();
    return (false);
  } 

// ===========================
// Fax Number
// ===========================
  if (theForm.Fax.value != "")
  {  
    if (!/^[ ]*[(]{0,1}[ ]*[0-9]{3,3}[ ]*[)]{0,1}[-]{0,1}[ ]*[0-9]{3,3}[ ]*[-]{0,1}[ ]*[0-9]{4,4}[ ]*$/.test(theForm.Fax.value))
    {
      alert("Invalid \"FaxNumber\", please re-enter.");
      theForm.Fax.focus();
      return (false);
    }
  } 

// ===========================
// Email 
// ===========================
  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (!/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/.test(theForm.Email.value))
  {
    alert("Invalid \"Email Address\", please re-enter.");
    theForm.Email.focus();
    return (false);
  }

}

//-->

