function validateSubscription(){
	var ok;
	
	if ( frmSubscribe.txtUserEmail.value.replace(/ /g, "") == "" && frmSubscribe.txtUserEmail.value.replace(/ /g, "") == "") {
		alert("Please enter your email address.");
		frmSubscribe.txtUserEmail.focus();
		frmSubscribe.txtUserEmail.select();
		ok=false;
	} else if (!validateEmail(frmSubscribe.txtUserEmail.value)) {
		alert("Please use correct email format.");
		frmSubscribe.txtUserEmail.focus();
		frmSubscribe.txtUserEmail.select();
		ok=false;
	} else {	
		ok=true;	
	}	
	if (ok==true){	
		document.frmSubscribe.submit();	
	}	
}//end validateSubscription function

function validateUnSubscription(){
	var ok;

	if ( frmUnSubscribe.txtUserEmail.value.replace(/ /g, "") == "" && frmUnSubscribe.txtUserEmail.value.replace(/ /g, "") == "") {	
		alert("Please enter your email address.");
		frmUnSubscribe.txtUserEmail.focus();
		frmUnSubscribe.txtUserEmail.select();
		ok=false;		
	} else if (!validateEmail(frmUnSubscribe.txtUserEmail.value)) {
		alert("Please use correct email format.");
		frmUnSubscribe.txtUserEmail.focus();
		frmUnSubscribe.txtUserEmail.select();
		ok=false;
	} else{	
		ok=true;	
	}	
	if (ok==true){	
		document.frmUnSubscribe.submit();	
	}	
}//end validateSubscription function


/************************************************
DESCRIPTION: Validates that a string contains a 
  valid email pattern. 
  
 PARAMETERS:
   strValue - String to be tested for validity
   
RETURNS:
   True if valid, otherwise false.
   
REMARKS: Accounts for email with country appended
  does not validate that email contains valid URL
  type (.com, .gov, etc.) and optionally,
  a valid country suffix.  Since email has many
  forms this expression only tests for near valid
  address.  Some additional validation may be
  required.
*************************************************/
function validateEmail(strValue) {
	var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
  //check for valid email
  return objRegExp.test(strValue);
}
