function forgot_pwd() { if (IsNull(document.form1.username.value,1,"用户名不能为空,请填写!",1)==false) { document.form1.username.focus(); return false; } document.location.href="/gx/admin/userForgotPassword.do?uid="+document.form1.username.value; } function reg() { document.location.href="/gx/gx/web/regAgreement.jsp"; } function check() { if (IsNull(document.form1.username.value,1,"用户名不能为空,请填写!",1)==false) { document.form1.username.focus(); return false; } if (IsNull(document.form1.password.value,1,"密码不能为空,请填写!",1)==false) { document.form1.password.focus(); return false; } return true; } //判断是输入栏否为空 //object_name 为对象名称,tishi=1 为是否显示对话框,word 为提示语句,kongge=1 为去除空格, function IsNull(object_name,tishi,word,kongge) { var string; string=new String(object_name); if (kongge==1) {string=JavaTrim(string);} //删除空格的字符 if (string.length==0) { if (tishi==1) { alert(word); } return false; } return true; } //删除字符开头和结尾的空格 function JavaTrim(str){ var i=0; var j; var len=str.length; trimstr=""; if(j<0) return trimstr; flagbegin= true; flagend= true; while (flagbegin== true){ if (str.charAt(i)==" "){ i++; flagbegin=true; } else { flagbegin=false; } } //前面有i个空格 j=len-1; var k=0; while (flagend==true) { if (str.charAt(j)==" ") { j--; flagend=true; k++; } else{ flagend=false; } } //后面有k个空格 if (str.length==i) { trimstr=""; return trimstr; } trimstr=str.substring(i,j+1); return trimstr; } document.write('