function validate_form(theForm)
{

  if (theForm.txtName.value == "")
  {
    alert("Please enter a Business Name.");
    theForm.txtName.focus();
    return (false);
  }

  if (theForm.txtAddress.value == "")
  {
    alert("Please enter a business address.");
    theForm.txtAddress.focus();
    return (false);
  }

 if (theForm.txtCity.value == "")
  {
    alert("Please enter a City.");
    theForm.txtCity.focus();
    return (false);
  }

  if (theForm.txtState.selectedIndex == 0)
  {
    alert("Please select a State.");
    theForm.txtState.focus();
    return (false);
  }

  if (theForm.txtZip.value == "")
  {
    alert("Please enter a Zip Code.");
    theForm.txtZip.focus();
    return (false);
  }


  if (theForm.txtZip.value.length < 5)
  {
    alert("Zip Code should be at least 5 characters.");
    theForm.txtZip.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.txtZip.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digits in the \"Zip Code\" field.");
    theForm.txtZip.focus();
    return (false);
  }

  if (theForm.txtPhone.value == "")
  {
    alert("Please enter a Phone Number.");
    theForm.txtPhone.focus();
    return (false);
  }

  if (theForm.txtPhone.value.length < 10)
  {
    alert("Phone Number should be at least 10 characters.");
    theForm.txtPhone.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.txtPhone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digits in the \"Phone Number\" field.");
    theForm.txtPhone.focus();
    return (false);
  }

  
  }
function validate_regform(theForm)
{
  if (theForm.txtFirstName.value == "")
  {
    alert("Please enter your First Name.");
    theForm.txtFirstName.focus();
    return (false);
  }

 if (theForm.txtLastName.value == "")
  {
    alert("Please enter your Last Name.");
    theForm.txtLastName.focus();
    return (false);
  }

  if (theForm.txtEmail.value == "")
  {
    alert("Please enter your E-mail address.You'll be using it as your user name.");
    theForm.txtEmail.focus();
    return (false);
  }

  if (theForm.txtPassword.value == "")
  {
    alert("Please enter your password.");
    theForm.txtPassword.focus();
    return (false);
  }
}
