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:document.location.href.indexOf("abc.hi")>0?"/getMessageInfo.jsp":"/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")}}};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"})}window.setTimeout(function(){XN.WIDGETS.notify.init()},10000)});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://mopimg.cn/ring.wma"></embed>'}(function(c){var b=c.cookie("mop_logon");
var a=b?parseInt(b):0;if(a>0){window.currentUser=window.currentUser||{};window.currentUser.id=a}})(jQuery);(function(g){window.showRequestFriendDialog=function(r,m,n,q,p){var o={id:r,name:m,head:n,from:q};if(p==false){d(o)}else{l(o)}};window.requestStarFriend=function(p,m,n,o){g.getJSON("http://hi.mop.com/ajax_request_friend.do?callback=?",{id:p,from:o},function(){XN.Do.alert({msg:"恭喜，"+m+"已成为你的好友",autoHide:2,callBack:function(){window.location.reload()}});window.setTimeout(function(){window.location.reload()},3000)})};var b;var k;function l(m){b=m;k=null;var p=f();p.clear();p.setHeader("添加好友");var n='<div class="friend-request" style="padding-bottom:0"><div class="avatar"><img src="'+m.head+'"/></div><div class="msg" id="addFriendAlert"><a href="http://hi.mop.com/profile.do?id='+m.id+'">'+m.name+'</a><br/><div id="friendDetailBox" style="display:block; line-height:1.7em"></div></div><div style="float:left; clear:both"><b style="display:block; margin:10px 0 5px; color:#333; width:300px">对TA说点什么，让TA加你为好友吧~</b><textarea id="addFriendMessage" name="message" class="textarea" style="width:395px; height:40px"></textarea></div></div>';
if(XN.BROWSER.IE6||XN.BROWSER.IE7){var o=new Image();o.src=m.head;o.onload=function(){p.setBody("");p.setBody(n)}}p.setBody(n);g.getJSON("http://hi.mop.com/ajaxGetRequestFriendDetail.do?id="+m.id+"&callback=?",e);i(p,m);p.show();g("#addFriendMessage").get(0).focus()}function e(n){var o=[];if(n.description){o.push(n.description)}if(n.interests){o.push(n.interests)}var m=o.join("<br>");if(n.commFriendsCount>0){m+='<br><div style="padding-top:10px">你们有'+n.commFriendsCount+'个共同好友：</div><div style="width:290px">';g.each(n.commFriends,function(p,q){m+='<a style="padding:0 3px; overflow:hidden; display:inline-block; height:70px; text-align:center; width:65px; text-decoration:none" href="http://hi.mop.com/profile.do?id='+q.id+'" target="_blank"><img src="'+q.tiny+'"><br>'+q.name+"</a>"});m+="</div>"}g("#friendDetailBox").html(m)}function i(n,m){n.setFooter(new XN.UI.button({text:"确定",onclick:function(){var o=g("#addFriendMessage").val();if(o.length>45){XN.DO.showError("您输入的信息不能超过45个字符");return}h(m.id,o,m.from)
}}));n.setFooter(new XN.UI.button({text:"取消",className:"gray",onclick:function(){n.remove()}}))}function h(o,m,n){g("#addFriendAlert").html("请求发送中~");c.footer.hide();g.getJSON("http://hi.mop.com/ajax_request_friend.do?callback=?",{id:o,why:m||"",from:n||""},j)}function j(m){if(m.code==3){d(b)}else{if(m.code==2){a()}else{g("#addFriendAlert").html(m.message);setTimeout(function(){c.remove();c=null},1000)}}}var c;function f(){try{if(c){c.remove()}}catch(m){}c=new XN.UI.panel();c.setWidth(465);c.frame.style.zIndex=9999;return c}function d(m){var p=window.addFriendDialog=f();p.clear();p.setHeader("添加好友");var n='<div class="friend-request"><div class="avatar"><img src="'+m.head+'"/></div><div class="msg" id="addFriendAlert"><br/><br/><a href="http://hi.mop.com/profile.do?id='+m.id+'">'+m.name+'</a>：<br/><br/>&nbsp;加我为好友，需要先上传头像。<br/><br/><div class="dialog_buttons" style="background:none"><a href="http://head.hi.mop.com/Upload.do" target="_blank" style="background:#F0F0F0 none repeat scroll 0 0;border-color:#FFFFFF #848484 #848484 #FFFFFF;border-style:solid;border-width:1px;color:#333333; padding:3px 5px;text-decoration:none;">现在去传头像</a><a href="javascript:addFriendDialog.remove();" style="background:#F0F0F0 none repeat scroll 0 0;border-color:#FFFFFF #848484 #848484 #FFFFFF;border-style:solid;border-width:1px;color:#333333; padding:3px 5px;text-decoration:none;margin-left:6px;">以后再说</a></div></div></div>';
if(XN.BROWSER.IE6||XN.BROWSER.IE7){var o=new Image();o.src=m.head;o.onload=function(){p.setBody("");p.setBody(n)}}p.setBody(n);p.show()}function a(){var m=XN.staticPath+"imgpro/icons/realPortraitSample.jpg";var p=window.addFriendDialog=f();p.clear();p.setHeader("申请已发送，请等待对方确认");var n='你还不是真实头像，对方可能不会通过您的好友申请哦！<div class="friend-request"><div class="avatar"><img src="'+m+'"/></div><div class="msg" id="addFriendAlert"><br/><p style="font-size:16px;color:#000;font-weight:bold">上传真实头像<br>免费成为星级用户</p><br/><img src='+XN.staticPath+"images/right.gif /> 好友申请更容易被通过<br/><img src="+XN.staticPath+'images/right.gif /> 游戏中可获得额外奖励<br/><div class="dialog_buttons" style="background:none"><a href="http://head.hi.mop.com/Upload.do" target="_blank" style="background:#F0F0F0 none repeat scroll 0 0;border-color:#FFFFFF #848484 #848484 #FFFFFF;border-style:solid;border-width:1px;color:#333333; padding:3px 5px;text-decoration:none;">现在去传头像</a><a href="javascript:addFriendDialog.remove();" style="background:#F0F0F0 none repeat scroll 0 0;border-color:#FFFFFF #848484 #848484 #FFFFFF;border-style:solid;border-width:1px;color:#333333; padding:3px 5px;text-decoration:none;margin-left:6px;">以后再说</a></div></div></div>';
if(XN.BROWSER.IE6||XN.BROWSER.IE7){var o=new Image();o.src=m;o.onload=function(){p.setBody("");p.setBody(n)}}p.setBody(n);p.show()}})(jQuery);MopHi.MP=MopHi.MP||{};MopHi.MP.getAwardByType=function(b){MopHi.MP.awardMpType={};MopHi.MP.awardMpType.share="发起分享";MopHi.MP.awardMpType.voted="参与投票";MopHi.MP.awardMpType.createVote="创建投票";MopHi.MP.awardMpType.uploadPhoto="上传照片";MopHi.MP.awardMpType.blog="发表日志";MopHi.MP.awardMpType.visit="访问别人（幸运）";var a=b.split("|");if(a.length==3){MopHi.MP.showMsg(MopHi.MP.awardMpType[a[0]],a[1],a[2])}};MopHi.MP.award=function(){var a="Hi_MP_Award";var b=jQuery.cookie(a);if(b){MopHi.MP.getAwardByType(b);jQuery.cookie(a,null,{path:"/",domain:"hi.mop.com"})}};MopHi.MP.showMsg=function(e,d,c){var a='<span style="width:201px; height:20px; line-height:20px; float:left; margin-top:2px;text-align:center; color:#fff">因为您还没有 <a href="http://reg.hi.mop.com/reactivate.do" target="_blank">居住证</a> ，无法奖励MP</span>';if(c>0){a='<span style="width:201px; height:20px; line-height:20px; float:left; margin-top:2px;text-align:center; color:#fff">本周期内，您还有'+d+"次机会</span>"
}var b=jQuery('<div style="position: absolute; z-index: 999999;background:url(http://mopimg.cn/images/addmp.gif) no-repeat 0 0;padding:10px;float:left" ></div>');b.html('<h2 style="font-size:12px; color:#ffffff; text-align:center; width:201px;float:left; height:20px; font-weight:normal">'+e+'</h2><div style="width:201px;float:left;height:50px; line-height:50px; font-size:18px;color:#555555; text-align:center"><img align="absmiddle" style="margin-right: 4px;" src="http://mopimg.cn/images/mop_mp.gif">MP<font style="color: rgb(255, 102, 0); font-size: 30px;">+'+c+"</font></div>"+a);b.appendTo("body").animate({left:"480px",top:"240px",width:"201px",height:"93px"},800).fadeOut(5000)};MopHi.MP.show=function(){var a=arguments[0]||1000;var d=arguments[1]||5000;var c=arguments[2]||"480px";var e=arguments[3]||"240px";var b=jQuery('<div style="position: absolute; z-index: 999999;background:url(http://mopimg.cn/images/addmp.gif) no-repeat 0 0;padding:10px;float:left" ></div>');b.html('<h2 style="font-size:12px; color:#ffffff; text-align:center; width:201px;float:left; height:20px; font-weight:normal">奖励MP</h2><div style="width:201px;float:left;height:50px; line-height:50px; font-size:18px;color:#555555; text-align:center"><img align="absmiddle" style="margin-right: 4px;" src="http://mopimg.cn/images/mop_mp.gif">MP<font style="color: rgb(255, 102, 0); font-size: 30px;">+10</font></div>');
b.appendTo("body").animate({left:c,top:e,width:"201px",height:"93px"},a).fadeOut(d)};jQuery(window).load(function(){MopHi.MP.award()});function showModifyCity(){var a=XN.DO.confirm({title:"修改所在城市",msg:"<center><img src="+XN.staticPath+"img/indicator.gif /> 正在载入</center>",width:500,callBack:function(c){if(c){if(!($("ajax_home_province").value&&$("ajax_home_city").value)){XN.Do.alert({msg:"请填写正确的省份和城市",autoHide:2});return false}var b=this;var d=XN.FORM.serialize("actform","string");d+="&type=city";this.show();this.footer.hide();this.body.setContent("<center><img src="+XN.staticPath+"img/indicator.gif /> 正在修改，请稍候 ..........</center>");new XN.NET.xmlhttp({url:"/AjaxModifyInfo.do",data:d,onSuccess:function(e){if(e.responseText){b.body.setContent(e.responseText)}else{b.body.setContent("寒，出错了")}setTimeout(function(){b.hide();if(typeof showSeeUsers=="function"){showSeeUsers(5,0,true)}else{location.reload()}},2000)}})}}});a.footer.hide();new XN.NET.xmlhttp({url:"/pages/account/ajaxModifyCity.jsp",onSuccess:function(b){a.body.setContent(b.responseText);
a.footer.show();if(MopHi.ProvinceBox){MopHi.ProvinceBox.init()}else{jQuery.ajax({url:"http://mopimg.cn/hijs/inc/hi.ajax.provincebox.js?v=0305",dataType:"script"})}}});return false}function showModifyBirthday(){var a=XN.DO.confirm({title:"修改生日",msg:"<center><img src="+XN.staticPath+"img/indicator.gif /> 正在载入</center>",width:500,callBack:function(c){if(c){if(!($("birthyear").value&&$("birthmonth").value&&$("birthday").value)){XN.Do.alert({msg:"请填写正确的生日",autoHide:2});return false}var b=this;var d=XN.FORM.serialize("actform","string");d+="&type=birthday";this.show();this.footer.hide();this.body.setContent("<center><img src="+XN.staticPath+"img/indicator.gif /> 正在修改，请稍候 ..........</center>");new XN.NET.xmlhttp({url:"/AjaxModifyInfo.do",data:d,onSuccess:function(e){if(e.responseText){b.body.setContent(e.responseText)}else{b.body.setContent("寒，出错了")}setTimeout(function(){b.hide();if(typeof showSeeUsers=="function"){showSeeUsers(6,0,true)}else{location.reload()}},2000)}})}}});a.footer.hide();new XN.NET.xmlhttp({url:"/pages/account/ajaxModifyBirthday.jsp",onSuccess:function(b){a.body.setContent(b.responseText);
a.footer.show()}});return false}function chgTab(a){for(var b=1;b<=2;b++){if(b==a){$("dongtaDiv_"+b).style.display="block";$("tabs_"+b).className="selected"}else{$("dongtaDiv_"+b).style.display="none";$("tabs_"+b).className=""}}}function choosePoke(c,e,b){var a=new Array();var d='<a href="#">'+e.name+"</a>";if(c>10){a.push('<div><img align="absmiddle" alt="亲" src="http://mopimg.cn/imgpro/poke/pokeact_'+c+'.gif"/></div>')}a.push("<div></div>");a.push('<p style="text-align: left;">我');a.push(b.description.replace(/B/g,d));a.push("</p>");if(b.price>0){a.push('<p><b>要花费<font style="color: rgb(255, 102, 0);">'+b.price+"</font>MP</b></p>")}$("pokeDiv").innerHTML=a.join("")}function doPoke(c,b){MopHi.loads(XN.staticPath+"csspro/module/poke.css");var a=XN.DO.confirm({msg:'<center><img src="http://mopimg.cn/img/indicator.gif" /> 正在载入好友列表</center>',width:500,callBack:function(e){if(e){var d=this;var f=XN.FORM.serialize("actform","string");f+="&id="+b+"&submit=1&js=true&t="+new Date().getTime();this.show();
this.footer.hide();this.body.setContent('<center><img src="http://mopimg.cn/img/indicator.gif" /> 请稍候 ..........</center>');new XN.NET.xmlhttp({url:"/Poke.do",data:f,onSuccess:function(h){if(!h.responseText){return}var g=XN.JSON.parse(h.responseText);d.body.setContent(g.msg);setTimeout(function(){d.hide()},3000)}})}}});a.footer.hide();jQuery.ajax({type:"GET",cache:true,url:"/AjaxPoke.do",data:"id="+b,success:function(d){a.body.setContent(d);a.header.setContent("向"+$("homePage").innerHTML+"打招呼");a.footer.show()}});return false}function delPoke(b,a){XN.DO.confirm({msg:"确定要删除这个招呼吗?",callBack:function(c){if(c){new XN.NET.xmlhttp({url:"/DelPoke.do",data:"id="+a,onSuccess:function(){$("pl_"+a).remove()},onError:function(){XN.DO.showError("删除失败")}})}}});return false}function doPokeAndDel(c,b,d){var a=XN.DO.confirm({msg:'<center><img src="http://mopimg.cn/img/indicator.gif" /> 正在载入好友列表</center>',width:500,callBack:function(f){if(f){var e=this;var g=XN.FORM.serialize("actform","string");g+="&id="+b+"&submit=1&js=true&t="+new Date().getTime();
this.show();this.footer.hide();this.body.setContent('<center><img src="http://mopimg.cn/img/indicator.gif" /> 请稍候 ..........</center>');new XN.NET.xmlhttp({url:"/Poke.do",data:g,onSuccess:function(i){if(!i.responseText){return}var h=XN.JSON.parse(i.responseText);e.body.setContent(h.msg);setTimeout(function(){e.hide()},1000);new XN.NET.xmlhttp({url:"/DelPoke.do",data:"id="+d,onSuccess:function(){$("pl_"+d).remove()},onError:function(){}})}})}}});a.footer.hide();new XN.NET.xmlhttp({url:"/AjaxPoke.do",data:"id="+b,onSuccess:function(e){a.body.setContent(e.responseText);a.header.setContent("向"+$("homePage").innerHTML+"打招呼");a.footer.show()}});return false}function showVafTrigger(a){document.getElementById(a).src="http://mopimg.cn/imgpro/bg/ico_xjt1.gif"}function hideVafTrigger(a){document.getElementById(a).src="http://mopimg.cn/img/transparent.gif"}jQuery(function(){window.setTimeout(function(){var vafPrefixs=["footprint","newuser","friends"];jQuery.each(vafPrefixs,function(i,prefix){eval(prefix+"menus = [];");
for(var i=0;i<100;i++){if(!$(prefix+"trigger_"+i)){break}var menu=new XN.UI.menu({bar:prefix+"trigger_"+i,menu:prefix+"tip_"+i,fireOn:"mouseover",alignType:((i%2==0)?"4-1":"3-2")});eval(prefix+"menus[i] = menu;")}})},1000)});