// Form Validation for Standard Vacation Form
function FormStandard_Validator(theForm)
{
  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email address\" field.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex < 0)
  {
    alert("Please select one of the \"State / Province\" options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex == 0)
  {
    alert("The first \"State / Province\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zip / postal code\" field.");
    theForm.zip.focus();
    return (false);
  }
  return (true);
  if (theForm.dayPhone.value == "")
  {
    alert("Please enter a value for the \"Daytime phone\" field.");
    theForm.dayPhone.focus();
    return (false);
  }
  if (theForm.evnPhone.value == "")
  {
    alert("Please enter a value for the \"Evening phone\" field.");
    theForm.evnPhone.focus();
    return (false);
  }
}


// Form Validation for Custom Vacation Form
function FormCustom_Validator(theForm)
{
  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email address\" field.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex < 0)
  {
    alert("Please select one of the \"State / Province\" options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex == 0)
  {
    alert("The first \"State / Province\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zip / postal code\" field.");
    theForm.zip.focus();
    return (false);
  }
  return (true);
  if (theForm.dayPhone.value == "")
  {
    alert("Please enter a value for the \"Daytime phone\" field.");
    theForm.dayPhone.focus();
    return (false);
  }
  if (theForm.evnPhone.value == "")
  {
    alert("Please enter a value for the \"Evening phone\" field.");
    theForm.evnPhone.focus();
    return (false);
  }
}


// Form Validation for Custom Vacation Form
function FormBid_Validator(theForm)
{
  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.firstname.value == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.firstname.focus();
    return (false);
  }
  if (theForm.lastname.value == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.lastname.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"Email address\" field.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.address.value == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.address.focus();
    return (false);
  }
  if (theForm.city.value == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.city.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex < 0)
  {
    alert("Please select one of the \"State / Province\" options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.stateProv.selectedIndex == 0)
  {
    alert("The first \"State / Province\" option is not a valid selection.  Please choose one of the other options.");
    theForm.stateProv.focus();
    return (false);
  }
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zip / postal code\" field.");
    theForm.zip.focus();
    return (false);
  }
  return (true);
  if (theForm.dayPhone.value == "")
  {
    alert("Please enter a value for the \"Daytime phone\" field.");
    theForm.dayPhone.focus();
    return (false);
  }
  if (theForm.evnPhone.value == "")
  {
    alert("Please enter a value for the \"Evening phone\" field.");
    theForm.evnPhone.focus();
    return (false);
  }
  if (theForm.price.value == "")
  {
    alert("Please enter a value for the \"Bid amount\" field.");
    theForm.price.focus();
    return (false);
  }

  var checkOK="0123456789-.,";
  var checkStr=theForm.price.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;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"Bid amount\" field.");
    theForm.price.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Please enter a valid number in the \"price\" field.");
    theForm.price.focus();
    return (false);
  }
}
