function Form_Validator(theForm)
{

	function trim(a)
	{
	  return a.replace(/^\s+/,'').replace(/\s+$/,'')
   }

  if (trim(theForm.FirstName.value) == "")
  {
    alert("Please enter a value for the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FirstName.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (trim(theForm.LastName.value) == "")
  {
    alert("Please enter a value for the \"Last Name\" field.");
    theForm.LastName.focus();
    return (false);
  }

   if (theForm.LastName.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Last Name\" field.");
    theForm.LastName.focus();
    return (false);
  }
  
  
	if (trim(theForm.Email.value) == "")
  {
    alert("Please enter a value for the \"Email\" field. If no email address enter noemail!");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length > 60)
  {
    alert("Please enter at most 60 characters in the \"Email\" field. ");
    theForm.Email.focus();
    return (false);
  }  

  if (trim(theForm.PhoneNumber.value) == "")
  {
    alert("Please enter a value for the \"Phone Number\" field.");
    theForm.PhoneNumber.focus();
    return (false);
  }


  if (theForm.PhoneNumber.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Phone Number\" field.");
    theForm.PhoneNumber.focus();
    return (false);
  }
  
 
  if (trim(theForm.Address.value) == "")
  {
    alert("Please enter a value for the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }

  if (theForm.Address.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Address\" field.");
    theForm.Address.focus();
    return (false);
  }
  
 if (trim(theForm.City.value) == "")
  {
    alert("Please enter a value for the \"City\" field.");
    theForm.City.focus();
    return (false);
  }  

  if (theForm.City.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"City\" field.");
    theForm.City.focus();
    return (false);
  }

	 if (theForm.State.selectedIndex < 0)
		 {
			alert("Please select one of the \"State\" options.");
			theForm.State.focus();
			return (false);
		 }

		 if (trim(theForm.State.value) == "")
			 {
			  alert("Please select one of the \"State\" options.");
			  theForm.State.focus();
			  return (false);
			}

  if (trim(theForm.Zip.value) == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }
  
 if (theForm.ReceiveInfoOn.selectedIndex < 0)
		 {
			alert("Please select one of the \"Receive Information on\" options.");
			theForm.ReceiveInfoOn.focus();
			return (false);
		 }

		 if (trim(theForm.ReceiveInfoOn.value) == "")
			 {
			  alert("Please select one of the \"Receive Information on\" options.");
			  theForm.ReceiveInfoOn.focus();
			  return (false);
			}  

  if (trim(theForm.EventDate.value) == "")
  {
    alert("Please enter a value for the \"Event Date\" field.");
    theForm.EventDate.focus();
    return (false);
  }


  if (theForm.EventDate.value.length > 20)
  {
    alert("Please enter at most 20 characters in the \"Event Date\" field.");
    theForm.EventDate.focus();
    return (false);
  }

 
  if (trim(theForm.NumberofGuests.value) == "")
  {
    alert("Please enter a value for the \"Number of Guests\" field.");
    theForm.NumberofGuests.focus();
    return (false);
  }

  if (theForm.NumberofGuests.value.length > 3)
  {
    alert("Please enter at most 20 characters in the \"Number of Guests\" field.");
    theForm.NumberofGuests.focus();
    return (false);
  }

 
   return (true);
}
