function login()
{
	//document.forms[0].submit();					
	return true;
}
function validateFieldCharacters (name, value, allowed, compulsory) 
{
alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-/_";
num = "0123456789.-'/()#";
alphanum = alpha + num;
username="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.,-";
password="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-+.0123456789";
email = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.,-@+";
letter="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var allowedstr;

switch (allowed)
{
	case "alpha":
		allowedstr = new String(alpha);
		break;
	case "num":
		allowedstr = new String(num);
		break;
	case "alphanum":
		allowedstr = new String(alphanum);
		break;
	case "username":
		allowedstr = new String(username)
		break;
	case "password":
		allowedstr = new String(password);
		break;
	case "email":
		allowedstr = new String(email);
		break;
	case "letter":
		allowedstr = new String(letter);
		break;
	default:
		allowedstr = new String(alphanum);
		break;
}
	var valuestr = new String(value);
	var length = valuestr.length;
	
	for (var i = 0; i < length; i++) 
	{
		if (allowedstr.indexOf(valuestr.charAt(i)) == -1)
		{
			alert(name + " " + strAlertMessage1 + ".");
			return false;
		}
	}
	return true;
}
function checkFields()
{
	var strType = "";
	var strValue = (document.forms[0].txtValue) ? TRIM(document.forms[0].txtValue.value) : "";
	
	if(document.forms[0].rdUserId)
		if(document.forms[0].rdUserId.checked)
			strType = "UserID";
		else
			strType = "EMail";
	else
		strType = document.forms[0].rdSelType.value;
	
	if(strValue == "")
		alert(strAlertMessage3); // At least one field must be filled in
	else
	{
		if((strValue != "") && (strType == "UserID"))
		{
			if (!validateFieldCharacters(strAlertMessage4, strValue, "alphanum", false)) 
				return false;
			else
				return true;
		}
		else
		{
			if (!validateFieldCharacters(strAlertMessage5, strValue, "email", false)) 
				return false;
			else	
				if(!verifyIsMailAddress(strValue))
					return false;
				else
					return true;
		}
	}
}
function verifyIsMailAddress(value)
{
	var valuestr = new String(value);
	if ((valuestr.match(/@/)!= null) && (valuestr.match(/\./)!= null))
		return true;
	else
	{
		alert(strAlertMessage6);//The email address is not valid
		return false;
	}
}
function TRIM( str )
{
	str = str.replace(/^\s+|\s+$/g,'');
	return str;
}
function ESEGUISUBMIT()
{
	if((checkFields())&&(SUBMITABLE))
	{
		SUBMITABLE = 0;
		document.forms[0].submit();
	}
	else
		return false;
}