String.prototype.trim = function ()
{
	return this.replace(/^\s+|\s+$/g, "");
}

$(document).ready(function ()
{
   // register a submit handler for the customer login formm
   $("#freesitesurvey_form").submit(function()
   {
      if($("#name", this).val().trim().length < 1)
      {
         alert("Please enter your full name.");
         $("#name", this).focus().select();
         return false;
      }
      
      if($("#address1", this).val().trim().length < 1)
      {
         alert("Please enter your address.");
         $("#address1", this).focus().select();
         return false;
      }
      
      if($("#city", this).val().trim().length < 1)
      {
         alert("Please enter your city.");
         $("#city", this).focus().select();
         return false;
      }
      
      if($("#state", this).val().trim().length < 1)
      {
         alert("Please enter your state.");
         $("#state", this).focus().select();
         return false;
      }
      
      if($("#zip_code", this).val().trim().length < 1)
      {
         alert("Please enter your ZIP code.");
         $("#zip_code", this).focus().select();
         return false;
      }
      
      if($("#phone", this).val().trim().length < 1)
      {
         alert("Please enter your phone number.");
         $("#phone", this).focus().select();
         return false;
      }
      
      if($("#email", this).val().trim().length < 1)
      {
         alert("Please enter your e-mail address.");
         $("#email", this).focus().select();
         return false;
      }
   });
});