/******************************************************************************************************
' Generated by: Script Generator 2
' Written by: Ardeshir (Alex) G. Battye
' Email: agb@mangroveblue.com
' URL: www.mangroveblue.com
'******************************************************************************************************
'
'******************************************************************************************************
' Global.js
'******************************************************************************************************
' Copyright (c) 2003 : MangroveBlue.com
'
' This software is provided under the terms of a License Agreement and
' may only be used and/or copied in accordance with the terms of such an
' agreement.  Neither this software nor any copy thereof may be provided
' or otherwise made available to any other person.  No title or ownership
' of this software is hereby transferred.
'******************************************************************************************************
' CHANGE HISTORY 
'******************************************************************************************************
*/

//Standard validation for the sign in form

function checkForm(oForm) {
var iError		= 0;
var sError		= "";
var sFocus		= "";
	
	sError += "Please enter ";
	
	if (!IsEmail(document.formHeaderFooter.strEmailAddress.value)) {
		iError++;
		sError += "a valid e-mail address ";
		if (sFocus == "") sFocus = document.formHeaderFooter.strEmailAddress;
	}

	if (document.formHeaderFooter.strPassword.value == "") {
		if (iError == 0)
		{
			sError += "a valid password";
		}
		else
		{
			sError += "and password";
		}

		iError++;
		if (sFocus == "") sFocus = document.formHeaderFooter.strPassword;
	}
	
   if (iError > 0) 
   {
       if (iError == 1) 
       {
		if (document.getElementById("formErrorHeaderFooter").hasChildNodes())
		{
			document.getElementById("formErrorHeaderFooter").removeChild(document.getElementById("formErrorHeaderFooter").childNodes.item(0));
		}
       document.getElementById("formErrorHeaderFooter").appendChild(document.createTextNode(sError));
       }
       else 
       {
		if (document.getElementById("formErrorHeaderFooter").hasChildNodes())
		{
			document.getElementById("formErrorHeaderFooter").removeChild(document.getElementById("formErrorHeaderFooter").childNodes.item(0));
		}
       
       document.getElementById("formErrorHeaderFooter").appendChild(document.createTextNode(sError));
       }
       sFocus.focus();
   }
   else 
   {
       return true;
   }
   return false;
}

