// JavaScript Document
// ew 6/24/04

function sweepformCheck(theForm) { // formerly decalformCheck

  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.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.state.value == "0")
  {
    alert("Please select a value for the \"State\" field.");
    theForm.state.focus();
    return (false);
  }
  
  if (theForm.zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.zip.focus();
    return (false);
  }
  
  if (theForm.emailAddress.value == "")
  {
    alert("Please enter a value for the \"E-mail Address\" field.");
    theForm.emailAddress.focus();
    return (false);
  }
  
  var validEmail = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
  if (!theForm.emailAddress.value.match(validEmail))
    {
    alert("The e-mail address you have provided is invalid.");
    theForm.emailAddress.focus();
    return (false);
  }
    
  if (theForm.yearsHunting.value == "")
  {
    alert("Please enter a value for the \"Number of Years Hunting\" field.");
    theForm.yearsHunting.focus();
    return (false);
  }
  
  if (theForm.favoritHunting.value == "")
  {
    alert("Please select a \"Favorite Type of Hunting\" category.");
    theForm.favoritHunting.focus();
    return (false);
  }
 
 }