(function(){var K={version:"1.2.5 Build 201001271335",cookie:{global:".163.com",sInfo:"S_INFO",pInfo:"P_INFO",nickname:"NTES_REPLY_NICKNAME"},url:{login:"http://<#=host#>/reply/check.jsp?url=<#=url#>",copy:"http://<#=host#>/<#=boardId#>/<#=path#>.html",addCopy:"/reply/addCopy.jsp",addPush:"/reply/addPush.jsp",addStore:"/reply/addStore.jsp",addFocus:"/reply/addFocus.jsp",cancelFocus:"/reply/cancelFocus.jsp"},nickname:{noEmpty:"\u6635\u79f0\u4e0d\u80fd\u4e3a\u7a7a",invalid:"\u6635\u79f0\u53ea\u80fd\u4e3a\u4e2d\u6587\uff0c\u82f1\u6587\u6216\u4e0b\u5212\u7ebf",tooLong:"\u6635\u79f0\u957f\u5ea6\u4e0d\u80fd\u8d85\u8fc76\u4e2a\u4e2d\u6587\u5b57\u621612\u4e2a\u82f1\u6587\u5b57\u6bcd"},favDocTitle:"\u300a<#=title#>\u300b\u7684\u7f51\u6613\u8ddf\u8d34",criticalLayer:10},O=window.tieUser={nickname:"",myfocus:0,focusme:0,myreply:0,init:function(){var _=this,B=$.cookie.get(K.cookie.pInfo);if(B!=""){B=B.split("|");_.userid=B[0].replace(/@163\.com$/i,"");if(B.length>3)_.hasLogin=1==B[2]||(0==B[2]&&$.cookie.get(K.cookie.sInfo))}var C=$.cookie.get(K.cookie.nickname);if(C){C=C.split("|");var A=C.length;if(B[2]==0&&A>=6&&C[5]!="null")_.hasLogin=true;if(_.hasLogin&&A>=5){_.nickname=C[1];!isNaN(C[2])&&(_.myfocus=parseInt(C[2]));!isNaN(C[3])&&(_.focusme=parseInt(C[3]));!isNaN(C[4])&&(_.myreply=parseInt(C[4]))}else if(1==C.length)_.nickname=C[0]}}};O.init();var Q={};Q["oneLayerTie"]="<div style=\"line-height: 21px; margin-bottom: 3px; zoom: 1; word-wrap: break-word;\"><#=b#></div>";Q["frontOfFloor"]="<div style=\"padding: 3px; background: #ffffee; border: 1px solid #999; overflow: hidden; margin-bottom: 3px; word-wrap: break-word;\">\n            <#=innerFloor#>\n            <div style=\"line-height: 20px; height: 20px; overflow: hidden; position: relative; font-size: 12px; margin: 0 3px; clear: both;\">\n                <span style=\"color: #1e50a2; padding: 5px 3px 0 0;\"><#=author#></span>\n                <span style=\"color: #666; position: absolute; right: 3px; top: 0;\"><#=seq#></span>\n            </div>\n            <p style=\"margin: 8px 3px; line-height: 20px; clear: both; font-size: 14px;\"><#=content#></p>\n        </div>";Q["midOfFloor"]="<div style=\"padding: 3px; background: #ffffee; border: 1px solid #999; border-top: none; overflow: hidden; margin-bottom: 3px; word-wrap: break-word;\">\n            <div style=\"margin: 0 3px; overflow: hidden; line-height: 20px; height: 20px; position: relative; font-size: 12px; clear: both;\">\n                <span style=\"padding: 5px 3px 0 0; color:#1E50A2;\"><#=author#></span>\n                <span style=\"color:#666666; position: absolute; right: 3px; top: 0;\"><#=seq#></span>\n            </div>\n            <p style=\"margin: 8px 3px; line-height: 20px; clear: both; font-size: 14px;\"><#=content#></p>\n        </div>";Q["endOfFloor"]="<div style=\"padding: 3px; background: #ffffee; border: 1px solid #999; overflow: hidden; margin-bottom: 12px; word-wrap: break-word;\">\n            <#=innerFloor#>\n            <div style=\"line-height: 20px; height: 20px; overflow: hidden; position: relative; font-size: 12px; margin: 0 3px; clear: both;\">\n                <span style=\"color: #1e50a2; padding: 5px 3px 0 0;\"><#=author#></span>\n                <span style=\"color: #666; position: absolute; right: 3px; top: 0;\"><#=seq#></span>\n            </div>\n            <p style=\"margin: 8px 3px; line-height: 20px; clear: both; font-size: 14px;\"><#=content#></p>\n        </div>";Q["lastFloor"]="<#=wholeFloor#>\n        <p style=\"margin: 9px 3px; line-height: 20px; text-align: left; clear: both; word-wrap: break-word;\"><#=content#></p>";Q["summaryFloor"]="<div class=\"commentBox\">\n            <div class=\"commentBox\">\n                <div class=\"commentInfo\">\n                \t<span class=\"author\"><#=author#></span>\n                    <span class=\"floorCount\">1</span>\n                </div>\n                <p class=\"content\"><#=content#></p>\n            </div>\n            <p class=\"hideTips\" onclick=\"return Tie.data['<#=autoId#>'].expand();\" title=\"\u70b9\u51fb\u5c55\u5f00\">\u5df2\u7ecf\u9690\u85cf\u91cd\u590d\u76d6\u697c <span>[\u70b9\u51fb\u5c55\u5f00]</span></p>\n        </div>\n        <p class=\"content\"><#=lastContent#></p>";Q["pages"]="<#\tfor (var i = 0, len = pages.length; i < len; i++) {\n\t\tif (pages[i]) {\n\t\t\tif (currentPage == pages[i].page || pages[i].isOff) {\t#>\n\t\t<li><span class=\"<#=(currentPage == pages[i].page ? \"current\" : i === 0 || i === len - 1 ? \"beginEnd\" : \"\")#>\"><#=pages[i].text#></span></li>\n<#\t\t\t} else {\t#>\n\t\t<li><a href=\"#\" class=\"<#=(i === 0 || i === len - 1 ? \"beginEnd\" : \"\")#>\" title=\"\u7b2c<#=pages[i].page#>\u9875\" onclick=\"return tiePage.showPage(<#=pages[i].page#>);\"><#=pages[i].text#></a></li>\n<#\t\t\t}\n\t\t} else {\t#>\n\t\t<li class=\"dotted\">...</li>\n<#\t\t}\n\t}\t#>";Q["aboutMe"]="<div class=\"name\"><a href=\"http://tie.163.com/reply/myindex.jsp?username=<#=userid#>\" target=\"_blank\"><#=nickname || userid#></a></div>\n<ul class=\"relations clearFix\">\n\t<li><a href=\"http://tie.163.com/reply/listFocus.jsp?focusType=myFocus&username=<#=userid#>\"><em><#=myfocus#></em>\u5173\u6ce8</a></li>\n<li><a href=\"http://tie.163.com/reply/listFocus.jsp?focusType=focusMe&username=<#=userid#>\"><em><#=focusme#></em>\u88ab\u5173\u6ce8</a></li>\n\t<li class=\"last\"><a href=\"http://tie.163.com/reply/myaction.jsp?action=reply&username=<#=userid#>\"><em><#=myreply#></em>\u8ddf\u8d34</a></li>\n</ul>";if(O.hasLogin){window.tieUser.logout=function(){$.cookie.del(K.cookie.nickname,K.cookie.global,"/")};window.tieUser.addFocus=function(_,A){$.ajax.send(K.url.addFocus,"POST",{suserid:_,userid:this.userid,fuserid:this.userid,ip:A||""})};window.tieUser.cancelFocus=function(_){$.ajax.send(K.url.cancelFocus,"POST",{suserid:_,userid:this.userid,fuserid:this.userid})};var G=$("#aboutMe");if(G)G.addCss("display:block;").attr("innerHTML",$.util.parseTpl(Q["aboutMe"],O))}else window.tieUser={userid:$.cookie.get("P_INFO").split("|")[0].replace(/@163\.com$/i,""),nickname:$.cookie.get(K.cookie.nickname),setNickname:function(_){this.nickname=_;$.cookie.set(K.cookie.nickname,_,"1M",K.cookie.global,"/")}};window.tieUser.checkNickname=function($){if(""==$)return K.nickname.noEmpty;if(!/^[\u4e00-\u9fa5\w]+$/.test($))return K.nickname.invalid;if(S($)>12)return K.nickname.tooLong};function S($){return $.replace(/[^\x00-\xff]/g,"**").length}String.prototype.right=function($){return this.slice(-$)};Date.prototype.format=function($){a=this.getFullYear();N=this.getMonth()+1;X=this.getDate();W=this.getHours();E=this.getMinutes();M=this.getSeconds();return $.replace(/y+|m+|d+|h+|s+|H+|M+/g,T)};function H($){return $<10?"0"+$:$}var a,N,X,W,E,M;function T($){switch($){case"yyyy":return a;case"yy":return a.toString().slice(-2);case"MM":return H(N);case"M":return N;case"dd":return H(X);case"d":return X;case"HH":return H(W);case"H":return W;case"hh":return H(W>12?W-12:W);case"h":return W>12?W-12:W;case"mm":return H(E);case"m":return E;case"ss":return H(M);case"s":return M;default:return $}}var U=/<#=(\w+)#>/g;$.util.simpleParse=function(_,$){return $?String(_).replace(U,function(_,A){return $[A]!=null?$[A]:_}):_};$.dom.replaceNode=function(_,$){if($.replaceNode)$.replaceNode(_);else if($.parentNode.replaceChild)$.parentNode.replaceChild(_,$);return _};$.style.getAbsPosition=function($){var B={};if($.getBoundingClientRect){var _=$.getBoundingClientRect();B.y=_.top+(A.scrollTop||Z.scrollTop);B.x=_.left+(A.scrollLeft||Z.scrollLeft)}else{B.y=$.offsetTop;B.x=$.offsetLeft}return B};$.ui.DragHandler=function(B,J){this.constructor=arguments.callee;var C=$.style.getCurrentStyle(B,"position").toLowerCase()==="fixed",I={x:B.offsetLeft||0-(C?A.scrollLeft:0),y:B.offsetTop||0-(C?A.scrollTop:0)},K,F,E,G;function H($){var _={x:Math.max(0,Math.min(Z.scrollWidth-B.offsetWidth,$.pageX-K.x)),y:Math.max(0,Math.min(Z.scrollHeight-B.offsetHeight,$.pageY-K.y))};B.style.left=_.x+"px";B.style.top=_.y+"px";I={x:_.x-(C?A.scrollLeft:0),y:_.y-(C?A.scrollTop:0)};E&&E(B,this,_);$.cancelBubble=true}function _(){if(B.releaseCapture)B.releaseCapture();else if(window.releaseEvents)window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);A.removeEvent("mousemove",H);A.removeEvent("mouseup",_);G&&G(B)}function D($){if(B.setCapture)B.setCapture();else if(window.captureEvents)window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);K={x:$.pageX-B.offsetLeft,y:$.pageY-B.offsetTop};A.addEvent("mousemove",H);A.addEvent("mouseup",_);F&&F(B,this);$.preventDefault()}this.setOnDragStart=function($){F=$};this.setOnMove=function($){onMove=$};this.setOnStopMove=function($){onStopMove=$};this.init=function(){$.event.addEvent(J,"mousedown",D)}};$.ui.Win=function(A){if(!arguments.length)return;var _=this;_.constructor=arguments.callee;_._wrapper=A;_._isShowed=$.style.getCurrentStyle(A,"visibility").toLowerCase()!="hidden";_._isFixed=$.style.getCurrentStyle(A,"position").toLowerCase()=="fixed";(new $.ui.DragHandler(A,A.$("> .title"))).init();A.$("a.close, input.close").addEvent("click",function($){_.hide();$.cancelBubble=true;return false}).addEvent("drag",function($){$.cancelBubble=true})};$.ui.Win.prototype={getWidth:function(){return this._wrapper.offsetWidth},getHeight:function(){return this._wrapper.offsetHeight},show:function(G,E,D){var _=this;if(!_._isShowed){var B=_._wrapper;if($.browser.msie&&$.browser.version<7){_._tempTop=Z.scrollTop;_._tempScroll=_._scroll.bind(_);window.addEvent("scroll",_._tempScroll)}var C,F;if(_._isFixed){C=null==G||isNaN(G)?parseInt((Z.clientWidth-B.offsetWidth)/2):G-Z.scrollLeft;F=null==E||isNaN(E)?parseInt((Z.clientHeight-B.offsetHeight)/2.3):E-(Z.scrollTop==0?A.scrollTop:Z.scrollTop)}else{C=null==G||isNaN(G)?parseInt((Z.clientWidth-B.offsetWidth)/2+Z.scrollLeft):G;F=null==E||isNaN(E)?parseInt((Z.clientHeight-B.offsetHeight)/2.3+Z.scrollTop):E}B.style.left=C+"px";B.style.top=F+"px";B.style.visibility="visible";_.onShow&&_.onShow();_._isShowed=true;D&&(_._hideTimer=setTimeout(function(){_.hide()},D*1000))}},hide:function(){var _=this;if(_._isShowed){$.style.addCss(_._wrapper,"visibility:hidden;left:0;top:0;");_._tempScroll&&window.removeEvent("scroll",_._tempScroll);_.onHide&&_.onHide();_._isShowed=false;if(_._hideTimer){clearTimeout(_._hideTimer);_._hideTimer=null}}},_scroll:function(){var $=this;$._wrapper.style.top=parseInt($._wrapper.style.top)+Z.scrollTop-$._tempTop;$._tempTop=Z.scrollTop}};$.ui.buildPages=function(D,A,C){var _=Math.ceil(D/A),E,B;data={pages:[{text:"\u4e0a\u4e00\u9875",page:C-1,isOff:C==1},{text:"1",page:1}],currentPage:C};if(_<=4){for(E=2;E<=_;E++)data.pages.push({text:E,page:E})}else if(C>=3){if(4==C)data.pages.push({text:2,page:2});else if(C>3)data.pages.push(null);B=Math.min(_,C+1);for(E=C-1;E<=B;E++)data.pages.push({text:E,page:E});if(E<_)data.pages.push(null)}else{for(E=2;E<=4;E++)data.pages.push({text:E,page:E});data.pages.push(null)}data.pages.push({text:"\u4e0b\u4e00\u9875",page:C+1,isOff:C==_});return $.util.parseTpl(Q["pages"],data)};var Z=document.documentElement,A=$(document.body),J=/^(.*?)(?:\s|&nbsp;)/i,C=/<a[^<>]*>(.*?)<\/a>/i,L=/<span[^<>]*>(.*?)<\/span>/i,P=/^(TELE_)?(.*?)(_\{\})?$/,B=/^([^@]+@[^@]+?)(?:\.\w*)?$/,D=/(\w{16})\.html/i,Y=/(\w+)\.163\.com/i,F=0;function V(B){var $=this;$.autoId=++F;$.data=B;$.length=0;$.isMobile=false;$.author="";$.nickname="";$.relatedPost=null;$.ip="";$.docId="";$.isNew=B.isNew||false;$.flag=false;while($.data[++$.length]!=null);$.length--;if($.length){var A=$.data[$.length];if(A.s&&A.k){$.relatedPost={href:A.k,title:A.s};D.test(A.k)&&($.docId=RegExp.$1);Y.test(A.k)&&($.channel=RegExp.$1)}$.docId=$.docId||V.parentId;if(A.pi)$.id=A.pi;else if(A.p)$.id=A.p.indexOf("_")>=0?A.p:$.docId+"_"+A.p;$.boardId=A.bi||V.boardId;if(!$.id)throw"Invalid tie id";$.postTime=A.t;$.againstCount=A.a||0;$.supportCount=A.v||0;A.ip&&($.ip=A.ip);if(A.l!=null)$.isShrink=A.l==="1";else $.isShrink=$.length>=4;if(A.u&&P.test(A.u)){if(RegExp.$1)$.isMobile=true;$.author=RegExp.$2}else $.author=A.u;if(C.test(A.f)){RegExp.$1&&($.nickname=RegExp.$1);if($.nickname===$.author)$.nickname="";if(J.test(A.f))$.from=RegExp.$1}else{var _=A.f.indexOf("]");if(_>=0)$.from=A.f.substr(0,_+1);else if(J.test(A.f))$.from=RegExp.$1;if(L.test(A.f))$.ip=RegExp.$1}$.hasFocus=A.sf==="1";if($.id!=0){V.data[$.id]=$;V.data[$.autoId]=$}}else throw"Empty reply data"}V.prototype={expand:function(){var _=$("#tie_"+this.id)||$("#tie_"+this.autoId);_&&$("div.body",_).attr("innerHTML",this.toWholeFloor());return false},toFloor:function(A){var _=this;if(null==A)A=_.isShrink;return 1==_.length?$.util.parseTpl(Q["oneLayerTie"],_.data["1"]):_[A&&_.length>2?"toSummaryFloor":"toWholeFloor"]()},toWholeFloor:function(){var B=this,C=B.data,A="",_,E=B.length,F=1,D;for(D=Math.min(E,K.criticalLayer);F<D;F++)A=$.util.parseTpl(Q["frontOfFloor"],{content:C[F].b,seq:F,author:C[F].f,innerFloor:A});D=E-K.criticalLayer;if(D>0){_=[];for(;F<D;F++)_.push($.util.parseTpl(Q["midOfFloor"],{content:C[F].b,seq:F,author:C[F].f}));A+=_.join("")}for(;F<E;F++)A=$.util.parseTpl(Q["endOfFloor"],{content:C[F].b,innerFloor:A,seq:F,author:C[F].f});return $.util.parseTpl(Q["lastFloor"],{content:C[E].b,author:B.author,from:B.from,ip:B.ip,wholeFloor:A})},toSummaryFloor:function(){var _=this;return $.util.parseTpl(Q["summaryFloor"],{from:_.from,ip:_.ip,author:_.data["1"].f,content:_.data["1"].b,lastContent:_.data[this.length].b,id:_.id,autoId:_.autoId})},copy:function(C,B){var E=$("#copyWin"),_=E.$("a.favUrl")[0],A=$.util.simpleParse(K.favDocTitle,{title:this.relatedPost?this.relatedPost.title:V.parentTitle}),D=$.util.simpleParse(K.url.copy,{host:this.channel?"comment."+this.channel+".163.com":document.location.host,boardId:this.boardId,path:this.id.replace("_","/")});_.href=D;_.innerHTML=D;if(window.clipboardData){window.clipboardData.clearData();window.clipboardData.setData("Text",D+"#\r\n"+$.util.simpleParse(K.favDocTitle,{title:A}))}else E.$("span.docTitle").attr("innerHTML",A);R.show();O.hasLogin&&V.sendAction("Copy",C||this.author,this.id,this.author,B||"copy",this.boardId);return false},addFocus:function(A,B){if(O.hasLogin){O.addFocus(B||this.author,this.ip);var C=document.createElement("em");C.className="focus";C.style.display="block";C.innerHTML="[\u5df2\u5173\u6ce8]";$.dom.replaceNode(C,A);var D=$.style.getAbsPosition(C);I.show("\u5173\u6ce8\u6210\u529f","\u53bb\u201c\u6211\u7684\u7f51\u6613\u8ddf\u8d34\u201d\u5b9e\u65f6\u67e5\u770b\u8be5\u7f51\u53cb\u7cbe\u5f69\u597d\u8d34",D.x,D.y)}else _.show("\u767b\u5f55\u52a0\u5173\u6ce8","\u767b\u5f55\u540e\u5373\u53ef\u5173\u6ce8\u8be5\u7f51\u53cb\uff0c\u8bf7\u5148\u767b\u5f55\u3002");return false},addStore:function(A,C,B){if(O.hasLogin){V.sendAction("Store",C||this.author,this.id,this.author,B||"store",this.boardId);var E=document.createElement("span");E.innerHTML="\u5df2\u6536\u85cf";$.dom.replaceNode(E,A);var D=$.style.getAbsPosition(E);I.show("\u6536\u85cf\u6210\u529f","\u8be5\u8d34\u5df2\u88ab\u6536\u85cf\u81f3\u201c\u6211\u7684\u7f51\u6613\u8ddf\u8d34\u201d\u4e2d",D.x+E.offsetWidth-I.getWidth(),D.y+E.offsetHeight-I.getHeight())}else _.show("\u767b\u5f55\u6536\u85cf","\u767b\u5f55\u540e\u5373\u53ef\u5173\u6ce8\u8be5\u8d34\uff0c\u8bf7\u5148\u767b\u5f55\u3002");return false},addPush:function(A,C,B){if(O.hasLogin){V.sendAction("Push",C||this.author,this.id,this.author,B||"push",this.boardId);var E=document.createElement("span");E.innerHTML="\u5df2\u8f6c\u53d1";$.dom.replaceNode(E,A);var D=$.style.getAbsPosition(E);I.show("\u8f6c\u53d1\u6210\u529f","\u53bb\u201c\u6211\u7684\u7f51\u6613\u8ddf\u8d34\u201d\u5b9e\u65f6\u67e5\u770b\u597d\u53cb\u52a8\u6001",D.x+E.offsetWidth-I.getWidth(),D.y+E.offsetHeight-I.getHeight())}else _.show("\u767b\u5f55\u8f6c\u53d1","\u767b\u5f55\u540e\u53ef\u8f6c\u53d1\u8be5\u8d34\u7ed9\u5173\u6ce8\u4f60\u7684\u7f51\u53cb\uff0c\u8bf7\u5148\u767b\u5f55\u3002");return false}};V.sendAction=function(D,C,B,E,A,_){$.ajax.send(K.url["add"+D],"POST",{suserid:C,fromPostid:B,fromUserid:E,stype:A,boardid:_||"",userid:O.userid,fuserid:O.userid})};V.data={};window.Tie=V;var R=$("#copyWin"),I=$("#tipsWin"),_=$("#loginWin");if(R){if(window.clipboardData){R.$("span.success")[0].style.display="";R.$("span.failed, p.replyCopy").addCss("display:none;")}else{R.$("span.success")[0].style.display="none";R.$("span.failed")[0].style.display=""}R=new $.ui.Win($("#copyWin"))}if(I){I=window.tipsWin=new $.ui.Win(I);I.show=function(A,_,C,B){$("div.title > .text",this._wrapper).attr("innerHTML",A);$("em.msg",this._wrapper).attr("innerHTML",A);$("span.description",this._wrapper).attr("innerHTML",_);$.ui.Win.prototype.show.call(this,C,B,2)}}if(_){_=window.loginWin=new $.ui.Win(_);_.show=function(){var A=Array.prototype.slice.call(arguments),_=A.shift(),B=A.shift();$("div.title span.text",this._wrapper).attr("innerHTML",_);$("p.tips",this._wrapper).attr("innerHTML",B);$.ui.Win.prototype.show.apply(this,A)};_.onShow=function(){var _=$("#loginWin input[name=username]")[0];if(_.value.trim()!="")$("#loginWin input[name=password]")[0].focus();else _.focus()}}$("form.login input[name=url]").attr("value",$.util.simpleParse(K.url.login,{host:document.location.host,url:document.location.href.replace(/\?.*$/,"")}));$("form.login input[name=username]").attr("value",O.userid)})()