view={api:new ec.api("register"),init:function(){this.btn=$("#btn_submit");Account.change(function(){view.validate.account()});if(window.Country)ec.country()},validate:{account:function(){var info=Account.get();if(info){view.api.put("/validateAccount?account="+info,function(r){if(r=="Email"&&window.Email)Email.set(info);else if(r=="Phone"&&window.FixedNum)FixedNum.set(info)})}},filed:function(){var msg=ec.validate(Password,Checkpwd);if(!msg&&Password.get()!=Checkpwd.get()){msg=L.G("两次输入的密码不一致,请重新输入");ec.notifyQ(msg);return msg}var items=ke.ui.findControls("#register","input");msg=ec.validate(items);return msg}},showVcode:function(){var info=Account.get();if(!info){ec.notifyQ(L.G("请输入邮箱或者手机号"));return}this.api.put("/validateAccount?account="+info,function(r){ec.showImageVcode(function(code){ec.hideWindow();ec.toggleValidateCode(true);this.api.put("getvcode?account="+Account.get()+"&imageVcode="+code,null,function(r){ec.btnTimeout(60)},function(r){ec.toggleValidateCode(false)})})})},getInfo:function(){var info=ke.createObject("#register");return info},confirm:function(){var msg=view.validate.filed();if(msg){ec.notifyQ(msg);return}ec.btnLoading(this.btn,L.G("正在注册..."),true);var info=this.getInfo();this.api.put("confirm",info,function(r){$.cookie("token",r,{path:"/",expires:3});var redirect=document.referrer;if(redirect.length>0&&redirect.indexOf("account")==-1)window.location.href=redirect;else window.location.href=L.route+"/user"})}};L.push(["两次输入的密码不一致,请重新输入","The passwords entered twice do not match. Please re-enter","请输入邮箱或者手机号","Please enter your email or phone number","正在注册...","Registering..."]);