function check(a){if(a.username.value==""){alert("请输入用户名");a.username.focus();return false}if(a.password.value==""){alert("请输入密码");a.password.focus();return false}if(a.code.value==""){alert("请输入验证码");a.code.focus();return false}return true}function changeImage(){document.getElementById("code_img").src="/validate.php?"+Math.random();document.getElementById("code").onfocus=""}function CtoH(c){var d=c.value;var a="";for(var b=0;b<d.length;b++){if(d.charCodeAt(b)==12288){a+=String.fromCharCode(d.charCodeAt(b)-12256);continue}if(d.charCodeAt(b)>65280&&d.charCodeAt(b)<65375){a+=String.fromCharCode(d.charCodeAt(b)-65248)}else{a+=String.fromCharCode(d.charCodeAt(b))}}c.value=a}function code_CtoH(){CtoH(document.getElementById("code"))}var code=document.getElementById("code");var code_img=document.getElementById("code_img");var code_refresh=document.getElementById("code_refresh");if(code){code.onfocus=changeImage;code.onblur=code_CtoH}if(code_img){code_img.onclick=changeImage}if(code_refresh){code_refresh.onclick=changeImage};
