/*
'----------------------------------------------------------------------------
' Copyright (c) 2002 Loki Limited
' The intellectual property rights (including copyright) to this source code, 
' binaries derived from this source code and specific concepts contained in 
' this source code are and remain the property of Loki Limited.
' This information is confidential and no person may use, disclose, 
' distribute or reproduce this information without prior written permission 
' from Loki Limited.
'---------------------------------------------------------------------------*/
// use RegExp to validate an email address
// Returns true if the parameter is a valid email address
function IsEmailValid( email )
{
	var pattern = new String( "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$" );
	var re = new RegExp( pattern );

	return re.test( email );
}

// [A-Za-z0-9_]
function IsAlphaNumeric( txt )
{
	var pattern = new String( "^(\\w)*$" );
	var re = new RegExp( pattern );

	return re.test( txt );
}

// [A-Za-z0-9]
function IsAlphaNumericStrict( txt )
{
	var pattern = new String( "^([A-Za-z0-9)*$" );
	var re = new RegExp( pattern );

	return re.test( txt );
}

// [A-Za-z0-9_ ']
function IsAlphaNumericEx( txt )
{
	var pattern = new String( "^(\\w|\\s|')*$" );
	var re = new RegExp( pattern );

	return re.test( txt );
}