
// Function   : checkFormData
// Module     : My Account
// Action     : Forgot Password
// Purpose    : To validate form data before submitting to server.
function checkFormData()
{
	var emailAddress= document.getElementById("txtEmailAddress").value;
	if(emailAddress=='')
	{
		alert(errorMessageArray['errEmptyEmail']);
		document.getElementById("txtEmailAddress").focus();
		return false;
	}
	else if(!isValidData(emailAddress))
	{
		alert(errorMessageArray['errInvalidEmail']);
		document.getElementById("txtEmailAddress").focus();
		return false;
	}	 
	return true;
}


// Function   : isValidData
// Module     : My Account
// Action     : Forgot Password
// Purpose    : To check email address 
// Parameters : string data
// Return     : True if no error else flase.
function isValidData(strObj)
{
	
	var regExPattern= /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	if(strObj.match(/^[\s]+$/) || strObj.match(/^[\s]+/) || strObj.match(/[\s]+$/) || !strObj.match(regExPattern))
		 return false;	
	else 
		return true;
}