/*
 *	These methods are used for client-side data validation.  They aren't aware of the forms
 *	on various pages so display templates may need a small bit of script to use these in any
 *	custom fashion.
 *
 *	isValidEmail()			;	is it a properly formatted email address.
 *
 */


/*
 *	function isValidEmail( string )
 *
 *	Takes an email address and returns true if it's properly formatted and false if
 *	it's not.
 */
function isValidEmail( Email )
{
	//alert( "isValidEmail(" + Email + ")" );
	// regex for a valid email address
	var EmailFilter  = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.([A-Za-z0-9]{2,4})+$/;
	if ( !EmailFilter.test( Email ) )
	{
		return false;
	}
	return true;
}