var ExaminerBinding={EditSame:{initData:function(c,d){var b=this.DataAssembly,a=this.ElemAssembly;b.Post.用户操作类型=c;b.Post.用户绑定类型=d;if(c==1)b.Backup.用户操作类型="本地修改";else b.Backup.用户操作类型="引用添加";Global.LoadIng.ready(function(){a.Post.账号=$("#账号");a.Post.密码=$("#密码");a.Post.确认密码=$("#确认密码");a.Post.邮箱=$("#邮箱");a.Post.验证码=$("#验证码");a.Other.提交按钮=$("#提交按钮");Global.HTML.ImageCode.init("图片验证码");Global.Object.Tag.inputFS(a.Post.账号);Global.AccessKey.KeyDown.enter(function(){Global.Object.Tag.onClick(a.Other.提交按钮)})})},ElemAssembly:{Post:{账号:0,密码:0,确认密码:0,邮箱:0,验证码:0},Other:{提交按钮:0}},DataAssembly:{Post:{账号:"",密码:"",确认密码:"",邮箱:"",用户操作类型:0,用户绑定类型:0},Backup:{用户操作类型:""}},Handle:{Type:{本地添加:"本地添加",引用添加:"引用添加",本地修改:"本地修改"},name:function(){return ExaminerBinding.EditSame.DataAssembly.Backup.用户操作类型=="本地修改"?"更改":"绑定"},embedBoxyHide:function(){parent&&parent.ExaminerEmbedHandle&&parent.ExaminerEmbedHandle.Binding.Boxy.hide()},embedBoxyBtn:function(a){switch(ExaminerBinding.EditSame.DataAssembly.Backup.用户操作类型){case"引用添加":case"本地修改":parent&&parent.ExaminerEmbedHandle&&parent.ExaminerEmbedHandle.Binding.Boxy.setCloseVis(a)}},completed:function(){switch(ExaminerBinding.EditSame.DataAssembly.Backup.用户操作类型){case"引用添加":case"本地修改":parent&&parent.ExaminerEmbedHandle&&parent.ExaminerEmbedHandle.Binding.Update.userInfo()}}},Format:{账号:function(c){var a=ExaminerBinding.EditSame.ElemAssembly.Post.账号,b=a.val().trim(),e=ExaminerBinding.EditSame.DataAssembly.Post.用户绑定类型;if(e==0){var d=/^[a-zA-Z0-9]{4,16}$/;if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入帐号！",a)}else if(!d.exec(b)){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"帐号只允许使用4到16位字符的英文、数字组合！",a)}else Global.CallBack.true_1(c,b)}else if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入帐号！",a)}else Global.CallBack.true_1(c,b)},密码:function(c){var a=ExaminerBinding.EditSame.ElemAssembly.Post.密码,b=a.val(),d=ExaminerBinding.EditSame.DataAssembly.Post.用户绑定类型;if(d==0)if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入新密码！",a)}else if(b.length<6||b.length>16){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入6～16位字符的密码！",a)}else Global.CallBack.true_1(c,b);else if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入密码！",a)}else Global.CallBack.true_1(c,b)},确认密码:function(c){var a=ExaminerBinding.EditSame.ElemAssembly.Post.确认密码,b=a.val();if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入确认密码！",a)}else if(b.length<6||b.length>16){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入6～16位字符的密码！",a)}else if(b!=ExaminerBinding.EditSame.ElemAssembly.Post.密码.val()){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"两次输入的密码不一样，请重输！",a)}else Global.CallBack.true_1(c,b)},邮箱:function(c){var a=ExaminerBinding.EditSame.ElemAssembly.Post.邮箱,b=a.val().trim();Global.Format.email(b,null,false,a,c)},验证码:function(c){var a=ExaminerBinding.EditSame.ElemAssembly.Post.验证码,b=a.val();if(b==""){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"请输入验证码！",a)}else if(Global.String.upperCase(b)!=Global.Cookies.imageCode()){Global.Object.Tag.onFocus(a);Global.CallBack.false_3(c,"验证码错误了，请重新填写！",a)}else Global.CallBack.true_1(c,b)}},postAjax:function(c){var d="ExaminerBinding-EditSame-Edit",e=Global.Boxy.Topics.Examiner.binding(c.用户绑定类型,c.账号),b=this.Handle,a=b.name(),f=this.ElemAssembly.Other.提交按钮;b.embedBoxyBtn(false);Global.Boxy.wait(d,{newTitle:a,dtHtml:a+e,triggerBtn:f});Global.AjaxServer.Post.json("/Binding/Validate/",c,function(c){if(c.result)Global.Boxy.success(d,{newTitle:a+"成功",dtHtml:e+"已"+a+"成功.",boxyOptions:{beforeHide:function(){b.embedBoxyHide()},afterHide:function(){b.completed()}}});else{b.embedBoxyBtn(true);Global.Boxy.failure(d,{newTitle:a+"失败",dtHtml:e+a+"失败",newMessage:c.info})}})},submit:function(){var b=ExaminerBinding.EditSame.DataAssembly.Post.用户绑定类型,a=b==0?["账号","密码","确认密码","邮箱","验证码"]:["账号","密码","验证码"];Global.MsgBox.submit(this,a)}}}