function chkForm()
{
	var iUserName=document.loginForm.USER_NAME
	var iUserPassword=document.loginForm.USER_PASSWORD

	if (iUserName.value=="")
	{
		alert("Please enter your username!");
		iUserName.focus();
		return false
	}

	if (iUserName.value.length<3 || iUserName.value.length>16)
	{
		alert("The length of username must be 3-16 bytes!");
		iUserName.focus();
		return false
	}

	if (iUserPassword.value=="")
	{
		alert("Please enter your password!");
		iUserPassword.focus();
		return false
	}

	if (iUserPassword.value.length<6 || iUserPassword.value.length>16)
	{
		alert("The length of password must be 6-16 bytes!");
		iUserPassword.focus();
		return false
	}

	if (!isPasswordOK(iUserPassword.value))
	{
		alert("The password can only be composed of letters, numbers and special characters!");
		iUserPassword.focus();
		return false
	}

	return true;
}

function isPasswordOK(str)
{
	var i;
	for (i=0; i<str.length; i++) {
		if (str.charCodeAt(i)>255) return false;
	}
	return true;
}