function checkEmailStructure(emailAddrs)
/*****************************
* author:	dgale
* edits:	sheraz
*			kellyber 10/11/2004; removed from iris form into .js file
* purpose:	validate the character values and structure of an email
* usage:	ref script SRC= .js file and use function
*****************************/
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailAddrs)){
		return true;
	}
	else{
		return false;
	}
}//end checkEmail	

function isValidEmail(strEmail) {
//**************************************
//* Author: Krassimir Dimov 04.09.2002
//* editor:	Kelly Berger 5.12.2003
//* purpose: This function checks for valid email characters (@ .)
//*		- inputs
//*			strEmail = email value to check
//*		- outputs
//*			var result = true if its valid, false (Default) if not
//****************************************	
	var chkDot = true;
	var usEmail = true;
	var lenSuffix = (usEmail) ? 4 : 3;
	var emailResult = false; //-- initialize --
	var ndxAt = ndxDot =  0;
	var chkSpaces = " ";
     
	ndxAt  = strEmail.indexOf('@');
	ndxDot = strEmail.indexOf('.') ;
	ndxDotSecond = strEmail.lastIndexOf('.') ;
        
	if ((ndxDot < 0) || (ndxAt < 0)) {
		alert('Your email address lacks \'.\' or \'@\'.\n\nThe format is \'you Email Address @domain name.com\'.\n\nExample: Venkat@Vtech.com'); 
	}
	else if (chkDot && (ndxDot < ndxAt) ) {
		emailResult = confirm('You entered a \'dot\' before the \'@\'\nAre you sure that is right?');
	}
	else if ( (ndxDotSecond - 3) <= ndxAt) {
		alert('You may be missing your domain name.\n\nThe format is \'you Email Address @domain name.com\'.\n\nExample: Venkat@Vtech.com');
	}
	else if (strEmail.indexOf(chkSpaces) > -1){
		alert('Spaces are not allowed in the email address');
	}
    else {
        emailResult=true; 
    }
        
    //alert(emailResult); //-- for debug --
    return emailResult; 
}