XN.WIDGETS={};XN.WIDGETS.notify={frequency:2,_menu:null,_lastCount:[],_lastTitle:null,_notifytimer:null,_iCanNotify:false,_checkNewNotifyTimer:null,_getNewNotifyTimer:null,_fontTimer:null,_whiteTimer:null,_isTelling:false,tellTheUser:function(){if(this._isTelling){return}this._isTelling=true;var d=this;XN.COOKIE.set("hasnotify","2",null,"/",".hi.mop.com");setTimeout(function(){XN.COOKIE.set("hasnotify","1",null,"/",".hi.mop.com")},1000);this._lastTitle=document.title;var c,b;function e(){document.title="【新提醒】- "+d._lastTitle;d._fontTimer=setTimeout(function(){a()},1000)}function a(){document.title="【　　　】- "+d._lastTitle;d._whiteTimer=setTimeout(function(){e()},1000)}e();playMusic();window.onfocus=function(){d.stopTell()}},stopTell:function(){this._isTelling=false;if(this._fontTimer){clearTimeout(this._fontTimer)}if(this._whiteTimer){clearTimeout(this._whiteTimer)}document.title=this._lastTitle;window.onfocus=null},updateUI:function(d){var c=0;var e=0;for(var b in d){if(isNumber(d[b])){c+=d[b];
if(b=="replyCount"){e+=d[b]}}}if($("friendRequestCount")&&d.friendRequest){$("friendRequestCount").innerHTML="";$("friendRequestCount").appendChild(document.createTextNode(d.friendRequest))}if($("homeNotifyCount")&&d.notify){$("homeNotifyCount").innerHTML="";$("homeNotifyCount").appendChild(document.createTextNode(d.notify))}if(c==0){$("showNewNotify").hide();return}else{$("showNewNotify").show()}$("notifyCount").innerHTML=c;if($("gossipReplyCount")){$("gossipReplyCount").innerHTML="("+e+")"}var a=[];a.push('<div class="bg_t"></div>');a.push("<ul>");a.push('<li><a href="http://'+XN.ENV.domain+'/myreplylist.do"><b>'+d.replyCount+"</b>条未读留言</a></li>");a.push('<li><a href="http://friend.'+XN.ENV.domain+'/GetGuestRequest.do"><b>'+d.friendRequest+"</b>个好友申请</a></li>");a.push('<li><a href="http://msg.'+XN.ENV.domain+'/notify/notifications.do"><b>'+d.notify+"</b>个通知</a></li>");a.push("</ul>");a.push('<div class="bg_b"></div>');$("notifydropmenu").innerHTML=a.join("")},getNewNotify:function(){var a=this;
function b(d){var e=XN.JSON.parse(d.responseText);for(var c in e){if(isNumber(e[c])&&e[c]!=0&&a._lastCount[c]!=e[c]){if(a._iCanNotify&&!isUndefined(a._lastCount[c])){a.tellTheUser()}a.updateUI(e);break}}for(var c in e){if(isNumber(e[c])){a._lastCount[c]=e[c]}}}new XN.NET.xmlhttp({url:"/getMessageInfo.do",onSuccess:b,onError:function(){if(a._checkNewNotifyTimer){clearInterval(a._checkNewNotifyTimer)}if(a._getNewNotifyTimer){clearInterval(a._getNewNotifyTimer)}$("showNewNotify").hide()}})},checkNewNotify:function(){var a=this;if(!XN.COOKIE.get("hasnotify")){clearInterval(this._checkNewNotifyTimer);this._checkNewNotifyTimer=null;XN.COOKIE.set("hasnotify","1",null,"/",".hi.mop.com");this._iCanNotify=true;this._getNewNotifyTimer=setInterval(function(){a.getNewNotify()},this.frequency*60*2000)}else{if(XN.COOKIE.get("hasnotify")=="2"){a.getNewNotify()}else{if(XN.COOKIE.get("hasnotify")=="1"){}}}},init:function(){if(!$("showNewNotify")){return}var a=this;var b;if(XN.BROWSER.IE6){b=6}else{if(XN.BROWSER.IE7){b=6
}else{b=6}}this._menu=new XN.UI.menu({bar:"showNewNotify",fireOn:"mouseover",menu:"notifydropmenu",barOnshowClass:"onhover",offsetY:b,offsetX:0});this.getNewNotify();this._checkNewNotifyTimer=setInterval(function(){a.checkNewNotify()},1000);window.onunload=window.onbeforeunload=function(){if(!a._iCanNotify){return}XN.COOKIE.del("hasnotify","/",".hi.mop.com")}}};function getLogin(){if(typeof this_app_id!="undefined"){img2=new Image(0,0);uid=0;if(currentUser&&currentUser.id){uid=currentUser.id}img2.src="http://share.hi.mop.com/op/online.jsp?appId="+this_app_id+"&id="+uid}}XN.DOM.readyDo(function(){if(!$("head_settings_link")){return}new XN.UI.menu({bar:"head_settings_link",menu:"head_settings_menu",fireOn:"mouseover"});if($("showAppMenu")){new XN.UI.menu({bar:"showAppMenu",menu:"appMenu",fireOn:"mouseover"})}});XN.DOM.readyDo(function(){window.setTimeout(function(){XN.WIDGETS.notify.init();getLogin()},10000);window.setInterval("getLogin()",200*1000)});function playMusic(){var a=document.createElement("div");
a.setAttribute("id","playMusic");document.body.appendChild(a);document.getElementById("playMusic").innerHTML='<embed height=0 width=0 src="http://img.hi.mop.com/ring.wma"></embed>'};