
function isvalidmail(txtemail) 
{
	var returncode=true;

// look for one or more "word" characters to start, optionally
// followed by a period or hyphen,
// followed by one or more word characters, repeated zero
// or more times,
// followed by a '@',
// followed by at least one word character, followed by at
// least one period, followed by two or three word characters,
// repeated one or more times,
// anchored to end of string

     
	var      re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/ 
	if ( re.test(txtemail) )
		return true;  // it passes
	else
	     return  false;  // it fails

}	// end of validate function

