sinaSSOConfig=new function(){this.entry='henan';this.setDomain=true;this.customLoginCallBack=function(loginStatus){DFZ.APP.DialogLogin.getLoginCallback().call(this,loginStatus);}};DFZ=window.DFZ||{};DFZ.APP=DFZ.APP||{};DFZ.APP.DialogLogin=(function(){var uniqueInstance=null;function getInstance(){if(!uniqueInstance){uniqueInstance=constructor();}
return uniqueInstance;}
function constructor(){if(!sinaSSOController){$.error("Required Object [sinaSSOController] is not found!");return;}
var customLoginCallback=null,CLOSE_DIALOG_TIME_OUT=2000,CLOSE_MESSAGE_TIME_OUT=2000,SUCCESS_TEXT="登录成功！",DIALOG=$("\
    <div >\
     <p>\
      <label for=\"dialog-login-username\" style=\"width:70px;font-size:12px\">邮箱/账号:</label>\
      <input type=\"text\" autocomplete=\"false\" id=\"dialog-login-username\" name=\"dialog-login-username\" style=\"width:160px\"/>\
     </p>\
     <p>\
      <label for=\"dialog-login-password\"  style=\"width:70px;font-size:12px\">密   码:&nbsp;</label>\
      <input type=\"password\" id=\"dialog-login-password\" name=\"dialog-login-password\" style=\"width:160px\"/>\
     </p>\
     <p class=\"extra-info\">\
      <input type=\"checkbox\" class=\"check-login-state\" name=\"check-login-state\" checked=\"checked\" value=1 />\
      <span class=\"text-login-state\">记住我的登录状态</span>\
      <a href=\"http://login.sina.com.cn/member/getpwd/getpwd0.php?entry=sso\" target=\"_blank\">忘记密码</a>\
     </p>\
    </div>\
   ").hide().appendTo(document.body).dialog({autoOpen:false,dialogClass:"dfz-app-dialog-login dfz-app-dialog",resizable:false,width:363,height:228,title:"用户登录",closeText:"",modal:true,closeOnEscape:true,zIndex:999999,buttons:{"登 录":login,"注册账号":function(){window.open("http://weibo.com/signup/signup.php?ps=u3&lang=zh","_blank");DIALOG.dialog("close");}},open:function(){},drag:function(){$("#sinaNote").hide();},close:function(){$("#sinaNote").hide();}}),DIALOG_BG=$("<div></div>").appendTo(DIALOG.dialog("widget")).addClass("dfz-app-dialog-bg"),DIALOG_MESSAGE=$("<div></div>").hide().appendTo(DIALOG.dialog("widget")).addClass("dfz-app-dialog-message"),DIALOG_MESSAGE_CONTENT=$("<div></div>").appendTo(DIALOG_MESSAGE).addClass("content"),DIALOG_MESSAGE_RIGHT=$("<div></div>").appendTo(DIALOG_MESSAGE).addClass("right"),DIALOG_MESSAGE_CONTENT_ICON=$("<div></div>").appendTo(DIALOG_MESSAGE_CONTENT).addClass("icon"),DIALOG_MESSAGE_CONTENT_TEXT=$("<div></div>").appendTo(DIALOG_MESSAGE_CONTENT).addClass("text"),DIALOG_LOADING=$("<div></div>").hide().appendTo(DIALOG.dialog("widget")).addClass("dfz-app-dialog-loading");$(DIALOG.dialog("widget").find(".ui-button")[0]).addClass("dfz-app-dialog-button-submit");$(DIALOG.dialog("widget").find(".ui-button")[1]).addClass("dfz-app-dialog-button-cancel");DIALOG.LOGIN_STATE=DIALOG.find(".check-login-state");DIALOG.USERNAME=DIALOG.find("#dialog-login-username");DIALOG.PASSWORD=DIALOG.find("#dialog-login-password");if(typeof passcardOBJ==="undefined"){$.error("The supporting object passcardOBJ is not found!",1)}else{passcardOBJ.init(DIALOG.USERNAME.get(0),{overfcolor:"#666",overbgcolor:"#d6edfb",outfcolor:"#000000",outbgcolor:""},DIALOG.PASSWORD.get(0),null,document.getElementById("SSOTipsContainer"));}
function login(){DIALOG_LOADING.show();var savestate=DIALOG.LOGIN_STATE.attr("checked")?30:1;sinaSSOController.login(DIALOG.USERNAME.val(),DIALOG.PASSWORD.val(),savestate);}
function loginCallback(loginStatus){DIALOG_LOADING.hide();showMessage(loginStatus,"success");}
function showMessage(msg,type,callback){DIALOG_MESSAGE_CONTENT_TEXT.text(msg);DIALOG_MESSAGE.show().removeClass("error").removeClass("success").addClass(type).css({left:(DIALOG.innerWidth()-DIALOG_MESSAGE.outerWidth(true))/2,top:(DIALOG.innerHeight()-DIALOG_MESSAGE.outerHeight(true))/2});setTimeout(function(){DIALOG_MESSAGE.hide();if($.isFunction(callback)){callback();}},CLOSE_MESSAGE_TIME_OUT)}
return{show:function(callback){DIALOG.dialog("open");if($.isFunction(callback)){customLoginCallback=callback;}
return this;},loginCallback:function(loginStatus){DIALOG_LOADING.hide();if(loginStatus.result){showMessage(SUCCESS_TEXT,"success",function(){DIALOG.dialog("close");if($.isFunction(customLoginCallback)){customLoginCallback();}});}else{if(loginStatus.reason)
{showMessage(loginStatus.reason,"error");}}}}}
return{open:function(callback){var instance=getInstance();instance.show(callback);},getLoginCallback:function(){return getInstance().loginCallback;},hasLogin:function()
{var u=sinaSSOManager.getSinaCookie();if(u)
{return true;}
else
{return false;}}}})();var DL_initialized=false;$(function(){if(DL_initialized){return;}
if(sinaSSOController&&sinaSSOController.getSinaCookie()){return;}
var triggers=$(".dfz-app-DialogLogin-trigger");if(triggers.length===0){triggers=$(".widgetLoginTrigger");if(triggers.length===0){return;}}
triggers.bind("click",function(){DFZ.APP.DialogLogin.open();});DL_initialized=true;});
