// Validate any of the form fields that need sanity checking, either for syntax
// (not yet implemented) or for completion (ie. required fields)

function FormValidator() {

  if(document.subForm.first_name.value == "") {
    alert("Please enter your first name.");
    document.subForm.first_name.focus();
    return(false);
  }

  if(document.subForm.last_name.value == "") {
    alert("Please enter your last name.");
    document.subForm.last_name.focus();
    return(false);
  }
    
  if(document.subForm.company.value == "") {
    alert("Please enter your company name.");
    document.subForm.company.focus();
    return(false);
  }
    
  if(document.subForm.phone.value == "") {
    alert("Please enter a telephone number.");
    document.subForm.phone.focus();
    return(false);
  }

  if(document.subForm.email.value == "") {
    alert("Please enter a contact e-mail address.");
    document.subForm.email.focus();
    return(false);
  }

  if(document.subForm.email.value.indexOf("@") < 2) {
    alert("E-mail address is not properly formatted.");
    document.subForm.email.focus();
    return(false);
  }
    
  if(document.subForm.email.value.indexOf(".") < 1) {
    alert("E-mail address is not properly formatted.");
    document.subForm.email.focus();
    return(false);
  }
    
  if(document.getElementById('00N70000001yCGY').value == "") {
    alert("Please enter a description of your issue. Include details\n\
      such as your bandwidth and latency if you know them.");
    document.getElementById('00N70000001yCGY').focus();
    return(false);
  }
	
  document.subForm.submit();
  return(true);
}
