//==============================================================================================
// 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-site-specific.js
// Scope  : SITE SPECIFIC  (refer to /includes/readme.txt for explanation)
// Version: 1.0
//
//--------------------------------------------------------------------------------------
// This function Validates the Account login form fields.
// pwchars = the minimum password characters
//--------------------------------------------------------------------------------------
function ValidateAccountLoginForm(myForm, pwchars) {
  var errorString="";
  if ((myForm.Email.value=="") || (myForm.RegistrationPassword.value=="")) {
    errorString = errorString + ErrMustSupplyCompulsoryFields;
  }
  if (myForm.RegistrationPassword.value.length < pwchars) {
         myForm.RegistrationPassword.focus();
          errorString = errorString + "\n   " + "Need to provide a password with at least " + pwchars + " characters"
  }
  if (errorString!="") {
    alert(errorString);
    return false;
  } else {
    return true;
  }
}
//--------------------------------------------------------------------------------------
// This function updates a string into the given container ID.
//--------------------------------------------------------------------------------------
function updateMessage(str,container){
    document.getElementById(container).innerHTML = str+"";
}
//--------------------------------------------------------------------------------------
// This function Validates the Email form field
//--------------------------------------------------------------------------------------
function ValidateEmail(myForm) {
  var errorString="";
  if ((myForm.Email.value=="")) {
    errorString = errorString + "Must provide an e-mail address";
  }
  if (!emailCheck(myForm,myForm.Email.value,false)) {
      myForm.Email.focus();
      errorString = errorString + "\n   " + ErrIncorrectEmailAddress
  }
  if (errorString!="") {
    alert(errorString);
    return false;
  } else {
    return true;
  }
}
