"),s.shift();c.innerHTML=a.join("").replace(/pInfo/g,n.encode(userInfo.userMail))},logout=function(){a.innerHTML="",c.innerHTML="",m.href=Constant.Path.DEFAULT_MAIL_PATH,u.href="javascript: void(0)",i.style.display="block",s.style.display="none",p.href=p.href.replace("&logined=true","");for(var e=0,t=v.length;t>e;e++)v[e].href=v[e].href.replace("&logined=true","");userInfo=null,setMailInfo(null),setLofterInfo(null),setHuatianInfo(null),setBoBoInfo(null)},setMsg=function(e,n,r){var i=t(o,e).get(0);r||(n>99&&(n="99+"),0>n&&(n=0)),i&&e&&(n?(i.innerHTML=n,e.style.display="block"):(i.innerHTML="",e.style.display="none"))},setHuatianInfo=function(e){huatianNavShow=e,setMsg(huatianMsg,e?"N":"",!0)},setLofterInfo=function(e){setMsg(f,e?e.count:0),e&&e.count>0?p.href=p.href.replace("qb163sydl_20140917_01","qb163sydl_20140917_02"):p.href=p.href.replace("qb163sydl_20140917_02","qb163sydl_20140917_01"),lofterInfo=e},setBoBoInfo=function(e){setMsg(g,e?"N":"",!0)},setMailInfo=function(e){setMsg(h,e?e.newCount:0),mailInfo=e},unFoldUserCenter=function(){d.style.display="block",setTimeout(function(){d.style.display=""},4e3)},init(),e.extend({login:function(e){login(e)},logout:function(){logout()},setLofterInfo:function(e){setLofterInfo(e)},setMailInfo:function(e){setMailInfo(e)},setHuatianInfo:function(e){setHuatianInfo(e)},setBoBoInfo:function(e){setBoBoInfo(e)},unFoldUserCenter:function(){unFoldUserCenter()}}),e},NTESCommonNavigator.namespace("NTESCommonNavigator.ui"),NTESCommonNavigator.ui.Login=function(){var e=NTESCommonNavigator.base.UI(),t=NTES,n=t("#js_N_navHighlight"),o=(t("#js_loginframe_username"),t.util),r=(o.extend,250),i=t("#js_passportUserNameList"),s=t("#js_N_navHighlight .ntes-nav-login-title"),a=t("#js_N_navHighlight .ntes-nav-loginframe-pop"),u=!1,l=t(document.body),c=null,d=!1;return animateType={shake:"ue-shake"},currentAnimateType="",init=function(){u=isElmHasShow(a),n.addCss("ntes-nav-login-normal"),s.addEvent("click",onShowLoginClick),s.addEvent("mouseover",onShowLoginBtnMouseover),s.addEvent("mouseout",onShowLoginBtnMouseout),a.addEvent("mouseover",onShowloginPopMouseover),l.addEvent("click",onBodyClick),window.addEvent("scroll",onBodyScroll),i=i?i.get(0):null},isElmHasShow=function(e){return"none"!=t.style.getCurrentStyle(e,"display")?!0:!1},onShowLoginClick=function(e){return isElmHasShow(a)?hidePop():showPop(),!1},clearTimer=function(){c&&(clearTimeout(c),c=null)},setTimer=function(e){c=setTimeout(function(){e&&e()},r)},onShowLoginBtnMouseover=function(e){clearTimer(),showPop()},onShowLoginBtnMouseout=function(e){clearTimer(),setTimer(function(){hidePop()})},onShowloginPopMouseover=function(e){clearTimer()},onBodyClick=function(e){if(u){for(var t=e.target||e.srcElement,n=a.get(0),o=s.get(0);t;){if(t==n||t==o||t==i)return;t=t.parentNode}return hidePop(),!1}},onBodyScroll=function(e){u&&hidePop()},success=function(e){hidePop()},fail=function(e){animatePop("shake")},hidePop=function(){a.get(0).style.display="none",u=!1,n.addCss("ntes-nav-login-normal"),n.removeCss("ntes-nav-login-active"),a.removeCss("ue-animation"),currentAnimateType&&a.removeCss(currentAnimateType)},showPop=function(){if(!d){new URS("js_N_navHighlight","mouseover",window.login_config);d=!0}a.get(0).style.display="block",u=!0,n.addCss("ntes-nav-login-active"),n.removeCss("ntes-nav-login-normal"),a.addCss("ue-animation")},animatePop=function(e){var t=animateType[e]||"";currentAnimateType&&a.removeCss(currentAnimateType),t&&a.addCss(t),currentAnimateType=t,currentAnimateType&&setTimeout(function(){a.removeCss(currentAnimateType)},1e3)},setUserName=function(e){},init(),e.extend({show:function(){showPop()},hide:function(){hidePop()},success:function(){success()},fail:function(){fail()},setUserName:function(e){setUserName(e)}}),e},NTESCommonNavigator.namespace("NTESCommonNavigator.core"),NTESCommonNavigator.core.Model=function(){var e=NTESCommonNavigator.base.Class(),t=NTESCommonNavigator.core.Event.Base,n=NTESCommonNavigator.core.Event.Model,o=NTESCommonNavigator.data.UserInfo(),r=NTESCommonNavigator.data.MailInfo(),i=NTESCommonNavigator.data.LofterInfo(),s=NTESCommonNavigator.utils.ChangeCookie(),a=function(){r.bind(t.DATA_LOADED,c),i.bind(t.DATA_LOADED,d),o.bind(t.DATA_CHANGED,l)},u=function(){var e=o.getUserInfo();r.refresh(e.userName,e.userDomain),i.refresh(e.userMail)},l=function(n){n.userLogin&&(o.getSInfo()?u():s.invoke(function(){u()})),e.trigger(t.DATA_CHANGED,n)},c=function(t){e.trigger(n.MAIL_INFO_LOADED,t)},d=function(t){e.trigger(n.LOFTER_INFO_LOADED,t)},m=function(){return o.getUserInfo()};return a(),e.extend({refresh:function(){o.refresh()},getUserInfo:function(){return m()}}),e},NTESCommonNavigator.namespace("NTESCommonNavigator.core"),NTESCommonNavigator.core.View=function(e){var t=NTESCommonNavigator.base.Class(),n=NTESCommonNavigator.ui.NavBar(),o=NTESCommonNavigator.ui.Login(),r=NTESCommonNavigator.core.Event.Model,i=NTESCommonNavigator.core.Event.Base,s=function(){e.bind(r.MAIL_INFO_LOADED,a),e.bind(r.LOFTER_INFO_LOADED,u),e.bind(i.DATA_CHANGED,l)},a=function(e){n.setMailInfo(e)},u=function(e){n.setLofterInfo(e)},l=function(e){e.userLogin?n.login(e):n.logout()},c=function(){o.success(),n.unFoldUserCenter()},d=function(){o.fail()};return s(),t.extend({loginSuccess:function(){c()},loginFail:function(){d()}}),t},NTESCommonNavigator.namespace("NTESCommonNavigator.core"),NTESCommonNavigator.core.Controller=function(){var e=NTESCommonNavigator.base.Class(),t=NTESCommonNavigator.core.Model(),n=NTESCommonNavigator.core.View(t),o=NTESCommonNavigator.core.Event.Base,r=NTESCommonNavigator.core.Event.Model,i=function(){t.bind(o.DATA_CHANGED,u),t.bind(r.MAIL_INFO_LOADED,s),t.bind(r.LOFTER_INFO_LOADED,a)},s=function(t){e.trigger(r.MAIL_INFO_LOADED,t)},a=function(t){e.trigger(r.LOFTER_INFO_LOADED,t)},u=function(t){e.trigger(o.DATA_CHANGED,t)},l=function(){t.refresh(),n.loginSuccess()};return window.login_config={product:"163",promark:"MODXOXd",host:"www.163.com",isHttps:1,includeBox:"urs-login-block",page:"login",placeholder:{account:"\u7f51\u6613\u90ae\u7bb1/\u5e38\u7528\u90ae\u7bb1",pwd:"\u8bf7\u8f93\u5165\u5bc6\u7801"},needUnLogin:1,defaultUnLogin:0,needPrepare:1,single:1,regUrl:"http://reg.163.com/reg/reg.jsp?product=urs",cssDomain:"http://temp.163.com/special/00804C4H/",cssFiles:"urs_style.css?12",frameSize:{width:260,height:214},logincb:function(e){l()},regcb:function(e){}},i(),e.extend({refresh:function(){t.refresh()},getUserInfo:function(){return t.getUserInfo()}}),e};
(function() {
var nav_value = {
platform : ""
};
var nav = {
detect : function() {
if (navigator.platform.indexOf("Win") > -1) {
nav_value.platform = "ua-win";
} else if (navigator.platform.indexOf("Mac") > -1) {
nav_value.platform = "ua-mac";
} else if (navigator.platform.indexOf("iPad") > -1 || navigator.platform.indexOf("iPhone") > -1) {
nav_value.platform = "ua-ios";
} else {
return false
}
;
},
init : function() {
this.detect();
if (nav_value.platform) {
NTES("html").addCss(nav_value.platform);
};
}
};
nav.init();
})();