//<!--
var reWhitespace = /^\s+$/

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}


// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)

{   // Is s empty?
    return (isEmpty(s) || reWhitespace.test(s));
}

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return false;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}


function Check(form)
 {
    var cost
     
    cost = 0;
  if (isEmail(form.Email.value) != true)
       {
         alert("We need an email address to send the information too.  Please enter your email address.  If you have entered your email address, make sure that it is typed correctly.");
		}
  else if (form.phone.value == "")
       {
         alert("It is often much easier for us to help you, if we can call you.  Please enter your phone number.");
		} 	
  else if (form.FirstName.value == "")
       {
         alert("Please provide your first name.");
		} 	
  else if (form.LastName.value == "")
       {
         alert("Please provide your last name.");
		 }
  else if (form.LocationInformation0.value == "")
       {
         alert("Please provide your State so that we may avoid contacting you outside of normal business hours.");
		} 	
  else if (form.LocationInformation.value == "")
       {
         alert("Please provide your Country so that we may avoid contacting you outside of normal business hours.");
		} 	
 }
// -->

