$(function(){var a=function(){var a=_.random(0,1e3);$("#code-img-enti").attr("src","/Public/verify?r="+a)},b=function(){var b=$("#ipt_account"),c=$("#ipt_pwd"),d=$("#ipt_code"),e=b.val(),f=c.val(),g=d.val();return""==e?(LoginShowError(b,"请输入用户名！"),void b.select().focus()):""==f?(LoginShowError(c,"请输入密码!"),void c.select().focus()):""==g?(LoginShowError(d,"请输入验证码！"),void d.select().focus()):($.ajax({url:"/Public/login",type:"post",dataType:"json",data:{username:e,password:f,verify:g},beforeSend:function(){$.jBox.showloading()},success:function(g){if(1==g.status)$.cookie("cache_account",e,{expires:30,path:"/"}),$("#rd_remember").is(":checked")?($.cookie("cache_pwd",f,{expires:30,path:"/"}),$.cookie("cache_pwd_checked",!0,{expires:30,path:"/"})):($.cookie("cache_pwd","",{expires:30,path:"/"}),$.cookie("cache_pwd_checked",!1,{expires:30,path:"/"})),window.location.href=g.url;else{switch(g.tab){case"username":LoginShowError(b,g.msg),b.select().focus();break;case"password":LoginShowError(c,g.msg),c.select().focus();break;case"verify":LoginShowError(d,g.msg),d.select().focus();break;case"unknown":alert(g.msg)}a()}$.jBox.hideloading()}}),!1)};$("#ipt_account").val($.cookie("cache_account")).focus(),$("#ipt_pwd").val($.cookie("cache_pwd")),$("#rd_remember").attr("checked","true"==$.cookie("cache_pwd_checked")?!0:!1),$(".j-codeReresh").click(a),$("#btn_login").click(b),$(".clearError").bind("keypress click",function(a){var c=window.event?a.keyCode:a.which;return 13==c?void b():void LoginClearError($(this))})});