Ext.ns("myday","myday.main");myday.main=function(){if(top.LIF!=null&&top.LIF.Email!=null){if(top.location.hash!="#ng"){top.location.href="/view.html"}}else{var a=inf2.func.CP.get("user",""),b=inf2.func.CP.get("tokenkey","");if(a!=""&&b!=""){inf2.func.Login(a,b,true,true,function(){top.location.href="/view.html"})}}var c=new redpill.Toolbox.Form({name:"Login",remorting:null,submitText:"Login",items:[["t","txtUserName","Inf2 User Name","",true,33,{regexp:/^[a-zA-Z0-9_\u4e00-\u9fa5]{2,50}$/,text:"Username must be more than 2 characters and only include a-z0-9"}],["tp","txtPwd","Inf2 Password","",true,33,{regexp:/^.{6,}$/,text:"Password must be more than 6 characters"}],["c","chkSavePwd","","",false,[50,[{value:"1",text:"Keep me logged in on this computer"}]]]]});c.RenderTo("div-content");c.cancelEl.hide();new Ext.KeyMap($("div-content"),[{key:13,fn:function(){c.Submit()},scope:this}]);var a=inf2.func.CP.get("user","");$("txtUserName").dom.value=a;top.f=c;c.on("presubmit",function(i,h){if(!c.ValidateAll()){return false}$("txtUserName-sr").update("");$("txtPwd-sr").update("");$("div-content").mask2("Login...");var g=i.GetData();var d=true;if(g.chkSavePwd==null||g.chkSavePwd.length==0){d=false}inf2.func.Login(g.txtUserName,g.txtPwd,d,false,function(e){$("div-content").unmask();if(e.Error){switch(e.ErrorMsg){case"inv_user":$("txtUserName-sr").update("Username is not found.");$("txtUserName").addClass("error").focus();break;case"inv_pwd":$("txtPwd-sr").update("Password is invalid.");$("txtPwd").addClass("error").focus();break}}else{inf2.func.Login(g.txtUserName,g.txtPwd,d,true,function(){top.location.href="/view.html"})}});return false},this)};Ext.onReady(function(){top.inc=new myday.main()});