function isEmailAddr(txtEmail)
{
  var result = false
  var theStr = new String(txtEmail)
  var index = theStr.indexOf("@");
  if (index > 0)
  {

    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function login_form_val(theForm)
{

  if (theForm.f_email.value == "")
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.f_email.value))
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (theForm.f_email.value.length < 3)
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }
  
  return (true);
}

function newuser_form_val(theForm)
{

  if (theForm.f_email.value == "")
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.f_email.value))
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (theForm.f_email.value.length < 3)
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }
  
  return (true);
}

function ContactFormValidator1(theForm)
{

  if (theForm.f_name.value == "")
  {
    alert("Please enter your name.");
    theForm.f_name.focus();
    return (false);
  }

  if (theForm.f_email.value == "")
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.f_email.value))
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (theForm.f_email.value.length < 3)
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }
  
  
  if (theForm.f_comments.value == "")
  {
    alert("Please enter a message.");
    theForm.f_comments.focus();
    return (false);
  }
  
  if (theForm.strCAPTCHA.value.length < 5)
  {
    alert("Please enter the security code.");
    theForm.strCAPTCHA.focus();
    return (false);
  }
  
  return (true);
}

function ContactFormValidator2(theForm)
{

  if (theForm.f_name.value == "")
  {
    alert("Please enter your name.");
    theForm.f_name.focus();
    return (false);
  }

  if (theForm.f_email.value == "")
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.f_email.value))
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (theForm.f_email.value.length < 3)
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }
  
  if (theForm.f_address.value == "")
  {
    alert("Please enter your address.");
    theForm.f_address.focus();
    return (false);
  }
  
  if (theForm.f_city.value == "")
  {
    alert("Please enter your city.");
    theForm.f_city.focus();
    return (false);
  }
  
  if (theForm.f_state.value == "")
  {
    alert("Please enter your state.");
    theForm.f_state.focus();
    return (false);
  }
  
  if (theForm.f_zip.value == "")
  {
    alert("Please enter your zip.");
    theForm.f_zip.focus();
    return (false);
  }
  
  if (theForm.f_country.value == "")
  {
    alert("Please enter your country.");
    theForm.f_country.focus();
    return (false);
  }
  
  if (theForm.strCAPTCHA.value.length < 5)
  {
    alert("Please enter the security code.");
    theForm.strCAPTCHA.focus();
    return (false);
  }
  
  return (true);
}

function ContactFormValidator3(theForm)
{

  if (theForm.f_name.value == "")
  {
    alert("Please enter your name.");
    theForm.f_name.focus();
    return (false);
  }

  if (theForm.f_email.value == "")
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (!isEmailAddr(theForm.f_email.value))
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }

  if (theForm.f_email.value.length < 3)
  {
    alert("Please enter your email address in the form: yourname@yourdomain.com");
    theForm.f_email.focus();
    return (false);
  }
  
  if (theForm.f_address.value == "")
  {
    alert("Please enter your address.");
    theForm.f_address.focus();
    return (false);
  }
  
  if (theForm.f_city.value == "")
  {
    alert("Please enter your city.");
    theForm.f_city.focus();
    return (false);
  }
  
  if (theForm.f_state.value == "")
  {
    alert("Please enter your state.");
    theForm.f_state.focus();
    return (false);
  }
  
  if (theForm.f_zip.value == "")
  {
    alert("Please enter your zip.");
    theForm.f_zip.focus();
    return (false);
  }
  
  if (theForm.f_country.value == "")
  {
    alert("Please enter your country.");
    theForm.f_country.focus();
    return (false);
  }
  
  if (theForm.f_price.value == "")
  {
    alert("Please enter the amount offered.");
    theForm.f_price.focus();
    return (false);
  }
  
  if (theForm.strCAPTCHA.value.length < 5)
  {
    alert("Please enter the security code.");
    theForm.strCAPTCHA.focus();
    return (false);
  }
  
  return (true);
}

