/**
 * The common code used for FOC form validations and submission
 * Depends on,
 * 1. validator; The validating object.
 * @author Pawandeep Singh(c) Versata 2006
 */
 
/**
 * The submit action for basic contact form.
 * Expects validator variable.
 * @param strFormName the form name
 */

function focFormSubmit(strFormName)
{
  var formElement = document.forms[strFormName];

  if(!validator.checkFirstName(formElement['firstName'].value))
  {
    return;
  }

  if(!validator.checkLastName(formElement['lastName'].value))
  {
    return;
  }

  if(!validator.checkAddress(formElement['street'].value))
  {
    return;
  }

  if(!validator.checkZip(formElement['postalCode'].value))
  {
    return;
  }

  if(!validator.checkPhone(formElement['phone'].value))
  {
    return;
  }

  if(!validator.checkEmail(formElement['email'].value))
  {
    return;
  }

  // Build the service comments
  document.forms[strFormName].submit();
}
