text: /*!
   * OKHQB member sign login dialog
   * require [ jquery.js, jquery.cookie.js, artDialog.js ]
   */
  (function(a){var b={init:function(){this.event_handler();this.load_style("/","static/home/index/css/sign.css")},load_style:function(d,f){try{var g=document.getElementsByTagName("head").item(0),h;h=document.createElement("link");h.setAttribute("rel","stylesheet");h.setAttribute("type","text/css");h.setAttribute("href",d+f);g.appendChild(h)}catch(c){}},event_handler:function(){$("#OKHQB-sign .tit-tabs ul li").live("click",function(){var e=$(this);e.siblings("li").removeClass("active");e.addClass("active");$(".tg-box","#OKHQB-sign").hide();$("."+e.attr("tg")).show()});$("label.label-placeholder",".sign-in-form-item").live("click",function(){$(this).siblings("input").trigger("focus")});$("input.s-item-input",".sign-in-form-item").live("focus",function(){var e=$(this);e.removeClass("error").addClass("focus");if(!$.trim(e.val())){e.siblings("label").hide()}}).live("blur",function(){var e=$(this);e.removeClass("error").removeClass("focus");if(!$.trim(e.val())){e.siblings("label").show()}});$("input.m-item-input",".mob-sign-up-form-item").live("focus",function(){var e=$(this);e.removeClass("error").addClass("focus");if(!$.trim(e.val())){e.siblings(".label-placeholder").hide()}});$('input[name="mob-sign-up-number"]').live("blur",function(){var g=$(this),h=$.trim(g.val()),f=/^1[3|4|5|7|8]\d{9}$/,e=/^\w+((\-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|\-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$/;if(!h){g.removeClass("focus").removeClass("error");g.siblings(".label-placeholder").show()}else{if(h&&!f.test(h)){g.removeClass("focus").addClass("error");g.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span><span class="message">手机号码格式不正确</span>').show();$("input.getMoblieCaptcha",".mob-sign-up-form-item").data("disabled",true)}else{g.removeClass("focus").removeClass("error");g.siblings(".i-tips").html('<span class="tips_icon_type tips_succ"></span><span class="message">填写正确</span>').show();$("input.getMoblieCaptcha",".mob-sign-up-form-item").data("disabled",false)}}});$('input[name="mob-sign-up-moblieCaptcha"]').live("blur",function(){var h=$(this),g=h.siblings(".i-tips"),f=$.trim(h.val()),e=/^\d{6}$/i;if(!f){h.removeClass("focus").removeClass("error");h.siblings(".label-placeholder").show()}else{if(!e.test(f)){h.removeClass("focus").addClass("error");g.html('<span class="tips_icon_type tips_error"></span><span class="message">验证码错误，请重新输入</span>').show()}else{function i(j){var k=$.trim($('input[name="mob-sign-up-number"]').val());g.html("正在验证...");$.ajax({url:"http://login.okhqb.com/member/checkRegisterMobileCaptcha.json",dataType:"jsonp",jsonp:"callback",data:{mobile:k,mobileCaptcha:f},success:function(l){if(l.code=="200"){g.html('<span class="tips_icon_type tips_succ"></span><span class="message">填写正确</span>').show();j.removeClass("error")}else{j.addClass("error");g.html('<span class="tips_icon_type tips_error"></span><span class="message">'+l.msg+"</span>").show()}}})}i(h)}}});$('input[name="mob-sign-up-passwd"]').live("blur",function(){var f=$(this),e=$.trim(f.val());cfpdValue=$.trim($('input[name="conf-mob-sign-up-passwd"]').val());f.siblings(".passwd-strength").html("").hide();if(!e){f.removeClass("focus").removeClass("error");f.siblings(".label-placeholder").show()}else{if(e.length<6){f.removeClass("focus").addClass("error");f.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span>                        <span class="message">密码长度不能小于6位</span>').show()}else{f.removeClass("focus").removeClass("error");f.siblings(".i-tips").html("").hide();c(e)}}if(cfpdValue&&e!=cfpdValue){var i=$('input[name="conf-mob-sign-up-passwd"]');i.removeClass("focus").addClass("error");i.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span>                        <span class="message">密码填写不一致</span>').show()}else{if(cfpdValue&&e==cfpdValue){var i=$('input[name="conf-mob-sign-up-passwd"]');i.removeClass("focus").removeClass("error");i.siblings(".i-tips").html('<span class="tips_icon_type tips_succ"></span>                     <span class="message">填写正确</span>').show()}}});$('input[name="captchaCode"]').live("blur",function(){var g=$(this),e=$.trim(g.val());if(!e){g.removeClass("focus").removeClass("error");g.siblings(".label-placeholder").show()}});$('input[name="captchaCode"]').live("keyup",function(){var g=$(this),e=$.trim(g.val());if(e.length>=4){$.ajax({type:"get",url:"http://canvas.okhqb.com/captcha/checkCaptcha.json?captcha="+e,dataType:"jsonp",success:function(f){if(f.code==200){g.removeClass("focus").removeClass("error");g.siblings(".i-tips").html('<span class="tips_icon_type tips_succ"></span><span class="message">验证成功</span>').show()}else{g.removeClass("focus").addClass("error");g.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span><span class="message">'+f.msg+"</span>").show()}},error:function(f){g.removeClass("focus").addClass("error");g.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span><span class="message">'+f.msg+"</span>").show()}})}});$("button.blue-botton").live("mouseenter",function(){$(this).addClass("blue-botton-hover")}).live("mouseleave",function(){$(this).removeClass("blue-botton-hover")});$("input.getMoblieCaptcha",".mob-sign-up-form-item").live("click",function(){var g=$(this),h=$('input[name="mob-sign-up-number"]'),f=g.siblings(".i-tips-moblieCaptcha"),e=$.trim(h.val());if(g.data("disabled")){return}if(!e){h.addClass("error");h.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span><span class="message">请输入手机号码</span>').show();return}g.data("disabled",true);f.html("正在获取...").show();$.ajax({url:"http://login.okhqb.com/member/simpleSendMobileCaptcha.json?mobile="+e,dataType:"jsonp",success:function(i){if(i.code===200){f.html("验证码已发送").show();d(60,g,function(){f.html("").hide()})}else{if(i.code===12507){f.html("").hide();h.siblings(".i-tips").html('<span class="tips_icon_type tips_error"></span><span class="message">该手机号已被注册,请点此<a href="javascript:$(\'.tab-login\').trigger(\'click\');">登录</a></span>').show()}else{if(i.code===10784){g.data("disabled",true);f.html("操作频繁，请稍等").show()}else{g.data("disabled",false)}}}}})});function d(f,e,g){if(f>0){e.val(f+"秒后重新获取");setTimeout(function(){d(--f,e)},1000)}else{e.data("disabled",false).val("获取短息验证码");if($.isFunction(g)){g.call(e)}}}function c(e){if(!e){return}var f=$(".passwd-strength");var i=0,i=i+((e.search(/[a-zA-Z]/)!=-1)?1:0)+((e.search(/[0-9]/)!=-1)?1:0)+((e.search(/[^A-Za-z0-9]/)!=-1)?1:0);tips_txt={l:"安全等级:低",m:"安全等级:中",h:"安全等级:高"};if(i<=1){level="l"}else{if(i==2){level="m"}else{if(i==3){level="h"}}}if(level){f.html('<span class="passwd-strength-icon strength-'+level+'">                        </span><span class="t">'+tips_txt[level]+"</span>").show()}}},isSignIn:function(){try{return($.cookie("auth"))==null?false:true}catch(c){return false}},dialog:function(d){var e=$.extend({sign_in_callback:function(){},sign_up_callback:function(){}},d);var c='<div id="OKHQB-sign"><div class="OKHQB-logo"></div><div class="tit-tabs"><ul><li class="tab-login active" tg="sign-in-form-item"><a href="javascript:;">会员登录</a></li><li class="tab-mobreg" tg="mob-sign-up-form-item"><a href="javascript:;">快速注册</a></li></ul></div><div class="form-box"><div class="sign-in-form-item tg-box"><div name="sign_in_tips" class="i-tips" style="display:none;"></div><div class="i-l-item pos-relative"><input name="sign-in-account" class="s-item-input" type="text" value=""><label class="label-placeholder">请输入您的昵称/邮箱/注册手机</label></div><div class="i-l-item pos-relative"><input name="sign-in-passwd" class="s-item-input" type="password" value=""><label class="label-placeholder">请输入您的密码</label></div><div class="i-l-item"><button name="sign-in-submit" class="blue-botton">登录</button> <span class="forgot-passwd"><a href="http://login.okhqb.com/member/memberForget.html" target="_blank">忘记密码？</a></span></div><ul class="cooperation-sign"><li><a href="javascript:OKHQB_sign.QQ_sign_in();" class="u-qq"><em></em>QQ账号登录</a></li><li><a href="javascript:OKHQB_sign.SinaWeibo_sign_in();" class="u-sina-weibo"><em></em>新浪微博登录</a></li><li><a href="javascript:OKHQB_sign.wechat_sign_in();" class="u-wechat"><em></em>微信登录</a></li></ul></div><ul class="mob-sign-up-form-item tg-box" style="display:none;"><li id="mob_sign_up_nm_tips" style="padding-bottom:5px; display:none;" class="i-tips"></li><li><input name="mob-sign-up-number" class="m-item-input" type="text" value=""><label class="label-placeholder" style="display: block;">手机</label><div class="i-tips" style="display:none;"></div></li><li><input name="mob-sign-up-moblieCaptcha" class="m-item-input" type="text" value="" maxlength="6" style="width:97px;"><input name="getMoblieCaptcha" type="button" class="getMoblieCaptcha" value="获取短息验证码" /><label class="label-placeholder" style="display: block;">手机验证码</label><span class="i-tips-moblieCaptcha"></span><div class="i-tips" style="display:none;"></div></li><li><input name="mob-sign-up-passwd" class="m-item-input" type="password" value="" maxlength="16"><label class="label-placeholder" style="display: block;">密码</label><div class="i-tips" style="display:none;"></div><div class="passwd-strength" style="display:none;"></div></li><li><input name="captchaCode" id="captchaCode" class="m-item-input" type="text" value="" style="width:86px;"><label class="label-placeholder" style="display: block;">验证码</label><img src="" alt="" id="captcha_img"><span>看不清？<a href="javascript:;" id="changeCaptcha">换一张</a></span> <div class="i-tips" style="display:none;"></div></li><li><label>我已阅读并同意</label><a href="http://www.okhqb.com/help/index/1000000061_1000000145.html" target="_blank">《华强北商城服务协议》</a> <button name="mob-sign-up-submit" class="blue-botton">立即注册</button></li></ul></div></div>';art.dialog({id:"HQB_Sign_dialog",title:false,padding:0,content:c,close:function(){b.unload_submit_event()}});$("#captcha_img").attr("src","http://canvas.okhqb.com/captcha/captchaImage.html?s="+Math.random());$("#changeCaptcha,#captcha_img").live("click",function(){$("#captcha_img").attr("src","http://canvas.okhqb.com/captcha/captchaImage.html?s="+Math.random());$("#captchaCode").val("")});$('button[name="sign-in-submit"]').live("click",function(){b.sign_in_doings(e.sign_in_callback)});$('button[name="mob-sign-up-submit"]').live("click",function(){b.sign_up_doings(e.sign_in_callback)});$(window).on("keypress.sign",function(g){var h=(g.keyCode?g.keyCode:g.which),f=$("#OKHQB-sign .tit-tabs .active");if(h=="13"){g.preventDefault();if(f.hasClass("tab-login")){b.sign_in_doings(e.sign_in_callback)}else{if(f.hasClass("tab-mobreg")){b.sign_up_doings(e.sign_in_callback)}}}})},sign_in_doings:function(g){var j=$('input[name="sign-in-account"]'),h=$('input[name="sign-in-passwd"]'),f=$.trim(j.val()),d=$.trim(h.val());if(f.length<1){c("请输入您的昵称/邮箱/注册手机","error","sign-in-account");return false}else{if(d.length<1){c("请输入您的密码","error","sign-in-passwd");return false}else{try{$.ajax({url:"http://login.okhqb.com/member/boxLogin.json",data:{userName:f,passWord:d},type:"POST",dataType:"jsonp",jsonpCallback:"signInCallback",beforeSend:function(){c("正在为您努力登录...","info")},success:function(k){if(k.code==200){var e=$.parseJSON(k.data);art.dialog.get("HQB_Sign_dialog").close();b.render_toolbar(e.nickname,e.total_points);if(g&&typeof g=="function"){g.apply()}}else{c(k.msg,"error")}}})}catch(i){c("登录失败：系统异常","error")}}}function c(e,n,m){var l=$('div[name="sign_in_tips"]',".sign-in-form-item"),k=$('input[name="'+m+'"]');if(!e||!n){l.html("").hide();$("input.s-item-input").each(function(){$(this).removeClass("focus").removeClass("error")})}else{l.html('<span class="tips_icon_type tips_'+n+'"></span>                     <span class="message">'+e+"</span>").show();k.focus().delay(100)}}},sign_up_doings:function(j){var l=$('input[name="mob-sign-up-number"]'),k=$('input[name="mob-sign-up-passwd"]'),d=$('input[name="mob-sign-up-moblieCaptcha"]'),p=$.trim($("#captchaCode").val()),g=$.trim(l.val()),o=$.trim(d.val()),m=$.trim(k.val()),B=$(".passwd-strength"),A=$('button[name="mob-sign-up-submit"]'),h=/^1[3|4|5|7|8]\d{9}$/,f=/^\w+((\-\w+)|(\.\w+))*@[A-Za-z0-9]+((\.|\-)[A-Za-z0-9]+)*.[A-Za-z0-9]+$/;if(!g.length){n("手机号码不能为空","error","mob-sign-up-number");return false}else{if(!h.test(g)){n("手机号码格式错误","error","mob-sign-up-number");return false}}if(!o.length){n("手机验证码不能为空","error","mob-sign-up-moblieCaptcha");return false}else{if(!/^\d{6}$/i.test(o)){n("请输入正确的手机验证码","error","mob-sign-up-moblieCaptcha");return false}}if(!m.length){n("密码不能为空","error","mob-sign-up-passwd");return false}else{if(m.length<6&&m.length>16){n("密码长度应为6-16个字符","error","mob-sign-up-passwd");return false}}if(p.length<4){n("请输入验证码","error","captchaCode");return false}n(false);B.html("").hide();if(A.hasClass("disable")){return}A.addClass("disable");try{$.ajax({url:"http://login.okhqb.com/member/create.json",data:{userName:g,moblieCaptcha:o,password:m,safety:1,imgcode:p},type:"POST",dataType:"jsonp",jsonpCallback:"mobSignUpCallback",beforeSend:function(){i("数据提交中...","info")},success:function(e){A.removeClass("disable");if(e.code==200){art.dialog({title:false,content:"注册成功",icon:"succeed_s",time:3});art.dialog.get("HQB_Sign_dialog").close();b.render_toolbar(e.data.mobile,e.data.total_points);if(j&&typeof j=="function"){j.apply()}}else{i(e.msg,"error")}}})}catch(c){i("注册失败：系统异常","error")}function n(t,s,q){var r=$('input[name="'+q+'"]'),e=r.siblings(".i-tips");if(!t||!s||!q){$(".i-tips",".mob-sign-up-form-item").each(function(){$(this).html("").hide()});$("input.m-item-input").each(function(){$(this).removeClass("focus").removeClass("error")})}else{e.html('<span class="tips_icon_type tips_'+s+'"></span>                     <span class="message">'+t+"</span>").show();r.removeClass("focus").addClass("error")}}function i(r,q){if(!r){return}var e=$("#mob_sign_up_nm_tips");if(r=="hide"){e.html("").hide()}else{e.html('<span class="tips_icon_type tips_'+q+'"></span>                     <span class="message">'+r+"</span>").show()}}},QQ_sign_in:function(){var d=window.location.href,c="http://login.okhqb.com/member/union/qq.html?forward=";window.location.href=c+d;return false},SinaWeibo_sign_in:function(){var d=window.location.href,c="http://login.okhqb.com/member/union/sina.html?forward=";window.location.href=c+d;return false},wechat_sign_in:function(){var d=window.location.href,c="http://login.okhqb.com/member/toWechatUnoinLogin.html?forward=";window.location.href=c+d;return false},AliPay_sign_in:function(){var d=window.location.href,c="http://login.okhqb.com/member/union/alipay.html?forward=";window.location.href=c+d;return false},unload_submit_event:function(){try{$('button[name="sign-in-submit"]').unbind("click");$('button[name="mob-sign-up-submit"]').unbind("click");$(window).unbind(".sign")}catch(c){}},render_toolbar:function(f,d){var g=$("#toolbar_bg")||$("#toolbar"),f=f||"强粉";try{g.find(".notloggedin").hide();g.find(".thelogged").html('您好，<a class="u_name" rel="nofollow" href="'+_href+'">'+nickname+'</a>  欢迎回来  <a href="http://www.okhqb.com/member/logout.html" class="logout"> 退出</a><a href="http://my.okhqb.com/my/home.html?ad=dd_id" class="signEveryday"><span>签到赚小强币</span></a>').show()}catch(c){}}};a.OKHQB_sign=b})(window);OKHQB_sign.init();