//==============================================================================================
// Copyright Surfocracy Ltd, 2004
// Contact: info@surfocracy.com
// No part of this file may be re-used, republished or distributed under any circumstances
// without the permission of Surfocracy Ltd. Any web site found to be containing any content
// copyrighted to Surfocracy Ltd shall be reported for copyright infringement, followed by
// legal action if necessary.
//----------------------------------------------------------------------------------------------
// File   : javascript-afd.js
// Scope  : AFD  (refer to /includes/readme.txt for explanation)
// Version: 1.0
// Description: JavaScript routines specfic to the AFD postcode functions.
//
// Version control
//==============================================================================================
//   Date        | Changed by |     Description
//==============================================================================================
//  19-Oct-2004     VLD       First issue 1.0
//==============================================================================================
//
//--------------------------------------------------------------------------------------
// This function Validates the final petition form.
//--------------------------------------------------------------------------------------
function ValidateFormToSign(myForm) {
  var errorString="";
  if ((myForm.FirstName.value=="") || (myForm.LastName.value=="") || (myForm.Email.value=="")) {
    errorString = errorString + ErrMustSupplyCompulsoryFields;
  }
  if (!emailCheck(myForm,myForm.Email.value,false)) {
      myForm.Email.focus();
      errorString = errorString + "\n   " + ErrIncorrectEmailAddress
  }
  if (errorString!="") {
    alert(errorString);
    return false;
  } else {
    return true;
  }
}
//--------------------------------------------------------------------------------------
// This function Validates the step 1 petition form by simply checking that the postcode
// field has text in it. The field is not validated to see if it is a UK postcode format.
//--------------------------------------------------------------------------------------
function ValidateStepOneForm(myForm) {
  var errorString="";
  if ((myForm.Postcode.value=="")) {
    errorString = errorString + "Please provide a postcode";
  }
  if (errorString!="") {
    alert(errorString);
    return false;
  } else {
    return true;
  }
}
