//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function return_frm1()
{
	if ( (isUsername()) && (isPassword()) )
	{
		document.frm1.submit();
	}
	else
	{
		return false;
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function isUsername()
{
	var str = document.frm1.username.value;
	if (str == "")
	{
		alert("\nThe Username field is blank.\n\nPlease enter your Username.");
		document.frm1.username.select();
		document.frm1.username.focus();
		return false;
	}
	return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function isPassword()
{
	var str = document.frm1.password.value;
	if (str == "")
	{
		alert("\nThe Password field is blank.\n\nPlease enter your Password.");
		document.frm1.password.select();
		document.frm1.password.focus();
		return false;
	}
	return true;
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function return_frm2()
{
	if ( isEmail() )
	{
		document.frm2.submit();

	}
	else
	{
		return false;
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function isEmail ()
{
	var pattern1 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	var pattern2 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
	var string = eval("document.frm2.email.value");
	var result = (string.match(pattern1) && !(string.match(pattern2)));
	if (result == null)
	{
		alert("\nThe E-MAIL field is invalid.");
		document.frm2.email.select();
		document.frm2.email.focus();
		return false;;
	}
	else
	{
		return true;
	}
}
//////////////////////////////////////////////////////////////////////////////////////////////
