document.write('<div id="divSinaSSOManagerContainer" style="display:none;"></div>');
var sinaSSOManager=sinaSSOManager||{};
(function(){
this.b=function(f,b){try{var m=this;return function(){var a=null;if(typeof b!="undefined"){for(var i=0;i<arguments.length;i++){b.push(arguments[i]);}a=b;}else{a=arguments;}return f.apply(m,a);};}catch(e){}};
this.l=function(u){try{var s=document.createElement("script");s.type="text/javascript";s[document.all?"onreadystatechange":"onload"]=function(){if(document.all&&this.readyState!="loaded"&&this.readyState!="complete"){return;}this[document.all?"onreadystatechange":"onload"]=null;this.parentNode.removeChild(this);};s.src=u;document.getElementsByTagName("head")[0].appendChild(s);}catch(e){}};
this.c=function(k){try{var a=document.cookie.match(new RegExp(k+"=([^;]*)"));return a!=null?a[1]:null;}catch(e){}};
this.q=function(o){try{if(typeof o!="object")return "";var a=[];for(i in o){a.push(i+"="+encodeURIComponent(o[i]));}return a.join("&");}catch(e){}};
this.t=function(s){try{return /\?/.test(this.config["feedBackUrl"])?"&":"?";}catch(e){}};
this.getSinaCookie=function(){try{var d=function(s){if(s==undefined){return "";}var r=decodeURIComponent(s);return r=="null"?"":r;};var sup=d(this.c("SUP"));if(!sup){sup=d(this.c("SUR"));}if(!sup){return null;}var a=sup.split("&");var t;var r={};for(var i=0;i<a.length;i++){t=a[i].split("=");r[t[0]]=d(t[1]);}return r;}catch(e){}};
this.login=function(b,u,p,s){clearTimeout(this.tl);this.tl=setTimeout(this.b(this["lb"],[{"retcode":-1,"reason":"登录超时"}]),6000);var inm="iframeSinaSSOManagerLogin";try{var i=document.createElement('<iframe name="'+inm+'"></iframe>');}catch(e){var i=document.createElement("iframe");i.name =inm;}i.style.display="none";i.src="about:blank";this.e.appendChild(i);this.i=i;var f=document.createElement("form");f.style.display="none";var a=function(f,n,v){var i=document.createElement("input");i.type="text";i.name=n;i.value=v;f.appendChild(i);};a(f,"username",u);a(f,"password",p);a(f,"service",this.config["service"]);a(f,"encoding",this.config["pageCharset"]);a(f,"gateway",1);var sfb=this.config["feedBackUrl"];if(sfb!=null){a(f,"url",sfb+this.t(sfb)+"framelogin=1&callback=parent."+this.config["name"]+".fub");a(f,"returntype","META");}else{document.domain="sina.com.cn";a(f,"setdomain",1);a(f,"callback","parent."+this.config["name"]+".lb");a(f,"returntype","IFRAME");}a(f,"savestate",typeof s!="undefined"?s:0);a(f,"useticket",this.config["useTicket"]);f.method="post";f.action=this.config["LoginUrl"];f.target=inm;this.e.appendChild(f);this.f=f;this.config["login"]=b;f.submit();};
this["lb"]=function(o){try{clearTimeout(this.tl);if(o["uid"]){var s={"result":true,"retcode":0,"userinfo":{"uniqueid":o["uid"]}};if(o["ticket"]){s["ticket"]=o["ticket"];}if(this.config["feedBackUrl"]!=null){this.cd("login",this.b(function(){this.cf(s);}));}else{this.cd("login",this.b(function(){this.config["login"](s);}));}}else{this.config["login"]({"result":false,"errno":o["retcode"],"reason":o["reason"]});}}catch(e){}};
this.cf=function(s){try{var r={"callback":this.config["name"]+".fub"};var t="ticket",c="retcode",f="feedBackUrl";if(s[t]){r[t]=s[t];}if(s[c]!==undefined){r[c]=s[c];}this.l(this.config[f]+this.t(this.config[f])+this.q(r));return true;}catch(e){}};
this.cd=function(a,c){try{this.cdf=c;if(this.cdu != null){this.cdr(this.cdu);}else{this.l(this.config["CrosssDomainUrl"]+"?"+this.q({"callback":this.config["name"]+".cdb","action":a,"domain":this.config["domain"]}));this.cdt=setTimeout(this.b(this.cdr),3000);}}catch(e){}};
this["cdb"]=function(r){try{if(!r||r["retcode"]!=0){return false;}var arrURL=r["arrURL"];var request={"callback":this.config["name"]+".docdb"};this.cdm=arrURL.length;this.cdc=0;if(arrURL.length==0){clearTimeout(this.cdt);this.cdr();return true;}for(var i=0;i<arrURL.length;i++){this.l(arrURL[i] + this.t(arrURL[i]) + this.q(request));}}catch(e){}};
this["docdb"]=function(r){try{this.cdc++;if(this.cdc>=this.cdm){clearTimeout(this.cdt);this.cdr();}}catch(e){}};
this.cdr=function(){try{this.cdf();}catch(e){}};
this["fub"]=function(o){clearTimeout(this.tl);try{this.e.removeChild(this.i);this.e.removeChild(this.f);}catch (e){}this.config["login"](o);};
this.setCrossDomainUrlList=function(o){try{this.cdu=o;}catch(e){}};
this.logout=function(c){try{if(typeof c!="undefined"){this.config["logout"]=c;}this.l(this.config["LogoutUrl"]+"?callback="+this.config["name"]+".lob");return true;}catch(e){}};
this["lob"]=function(){try{this.cd("logout",this.b(function(){this.config["logout"]({"result":true});}));}catch(e){}};
this.autoLogin=function(c){try{if(this.c("SUP")===null&&this.c("ALF")!==null){this.sal(c);return true;}c(this.getSinaCookie());}catch(e){}};
this.sal=function(c){this["alb"]=this.b(function(){try{clearTimeout(this.tl);c(this.getSinaCookie());}catch(e){}});this.tl=setTimeout(function(){try{c(null);}catch(e){}},6000);var salu=this.config["LoginUrl"],ssur=this.c("SUR");if(ssur==null||decodeURIComponent(ssur).indexOf("ssl=0")==-1){salu=this.config["LoginUrl"].replace(/^http/, "https");}this.l(salu+"?"+this.q({"service":this.config["service"],"encoding":"UTF-8","gateway":1,"callback":this.config["name"]+".alb","returntype":"TEXT","useticket":0}))};
this.init=function(){try{if(this.ex==true){return;}this.ex==true;this.cdu=null;this.tl=-1;this.config={"name":"sinaSSOManager","feedBackUrl":null,"service":"sso","pageCharset":"GBK","domain":"sina.com.cn","useTicket":0,"CrosssDomainUrl":"http://login.sina.com.cn/sso/crossdomain.php","LoginUrl":"http://login.sina.com.cn/sso/login.php","LogoutUrl":"http://login.sina.com.cn/sso/logout.php","login":function(){},"logout":function(){}};this.e=document.getElementById("divSinaSSOManagerContainer");}catch(e){}};
this.init.apply(this,arguments);
}).call(sinaSSOManager);
