function FormCheck() 
{ 
if (trim(document.loginin.username.value) =="")
{
alert("请填写您的用户名！");
document.loginin.username.focus();
return false;
}
var filter=/^\s*[A-Za-z0-9]{6,20}\s*$/;
if (!filter.test(document.loginin.username.value)) { 
	alert("用户名填写不正确,请重新填写！可使用的字符为（A-Z a-z 0-9）长度不小于6个字符，不超过20个字符，注意不要使用空格。"); 
	document.loginin.username.focus();
	document.loginin.username.select();
	return false; 
} 
if (trim(document.loginin.password.value) =="") 
{
alert("请填写您的密码！");
document.loginin.password.focus();
return false; 
}
var filter=/^\s*[A-Za-z0-9]{6,20}\s*$/;
if (!filter.test(document.loginin.password.value)) { 
alert("密码填写不正确,请重新填写！可使用的字符为（A-Z a-z 0-9 ）长度不小于6个字符，不超过20个字符，注意不要使用空格。"); 
document.loginin.password.focus();
document.loginin.password.select();
return false; 
} 

if (document.loginin.ckcode.value!=document.loginin.reckcode.value ){
alert("请输入正确的验证码！"); 

return false; 
} 

return true;
}

function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

