
/** 
 * File Info
 * ----------------------------------
 * @filename     EmailVerify.js
 * @created      xx.xx.xxxx
 * @author       unknown
 * @description  This file checks if email address is in correct format
 *               Add onChange="return checkEmail(this);" call to input
 *
 * History
 * ---------------------------------
 * Date         Name      Note
 * 
 */

 
//---------------- VARIABLE DECLARATIONS ----------------


   var emailregex = /^[\w\_\-\.]+@[\w\_\-\.]+\.\w+$/;
  
function checkEmail(theField, emptyOK)
{
	
if(!theField.value.match(emailregex))
	{
	alert("The email address  " + theField.value + "  is not in a correct format.\n Please try again");
	theField.focus();
	theField.select();
	return false;
	}


}