function Scroll(options){var cssCore=function(testCss){switch(true){case testCss.webkitTransition==="":return"webkit";break;case testCss.MozTransition==="":return"Moz";break;case testCss.msTransition==="":return"ms";break;case testCss.OTransition==="":return"O";break;default:return""}}(document.createElement("ComicView").style),translate=function(){if(cssCore!=="")return function(o,x,y){o[cssCore+"Transform"]="translate("+x+"px,"+y+"px) translateZ(0)"};else return function(o,x,y){o.left=x+"px";o.top=
y+"px"}}(),addClass=function(o,cls){var oN=o.className;if(oN.indexOf(cls)===-1)o.className=oN+" "+cls},removeClass=function(o,cls){var oN=o.className,arrName,arrNow;if(oN.indexOf(cls)===-1)return;arrName=oN.split(" ");arrNow=arrName.length;while(arrNow--)if(arrName[arrNow]===cls)arrName.splice(arrNow,1);o.className=arrName.join(" ")},$$=function(s){return document.getElementById(s)};var c=$$(options.contain),w=$$(options.wrap),sb=$$(options.scrollBg),sk=$$(options.scrollBlock),fd=options.factHeightDiff||
0,fh=options.scrollBarHeightDiff||0,fx=options.heightFix||0,H=c.offsetHeight,cs=c.style,bs=sk.style,ws=w.style,gs=sb.style,isValidDrag=false,start={},delta={},nowTop=0,o=w,max,h,S,s,_top,_thisScroll;cs.position="absolute";while(o.tagName.toUpperCase()!=="BODY"){_thisScroll=o.getAttribute("data-scroll");if(_thisScroll){scrollArr.push(_thisScroll);break}else o=o.parentNode}function pull(){if(_top<0)_top=0;else if(_top>max)_top=max;try{bs.top=_top+"px";translate(cs,0,_top/max*(h-H)>>0)}catch(e){}}sk.onmousedown=
function(e){isValidDrag=true;body.onmousemove=goScroll;addClass(sb,"scroll-scrolling");removeClass(c,"moved");e=e||window.event;start={X:e.clientX,Y:e.clientY,time:+new Date};delta={}};sb.onmousedown=function(e){e=e||window.event;if((e.target||e.srcElement)===sk)return;_top=e.offsetY<nowTop?nowTop-s*0.7>>0:nowTop+s*0.7>>0;pull();nowTop=_top};return{init:function(width,height){H=c.offsetHeight||H;h=fx?fx:height-fd;h=H-1<h?H:h;S=h-fh;s=h/H*S;s=s>S?S+1:s;ws.width=c.offsetWidth+"px";ws.height=h+"px";
try{gs.height=S+"px";bs.height=s+"px"}catch(e){}if(H===h)gs.display="none";else gs.display="block";max=~~(S-s+1);setTimeout(function(){pull()},0)},set:function(p){_top=(S-s)*p;pull();nowTop=_top},reStart:function(){isValidDrag=false;removeClass(sb,"scroll-scrolling");addClass(c,"moved");if(!delta.Y)return;nowTop=_top},isValid:function(){return isValidDrag},nowTop:function(){return nowTop},runScroll:function(e){_t=this;delta={X:e.clientX-start.X,Y:e.clientY-start.Y};_top=nowTop+delta.Y;pull()},wheelMove:function(dir){_top=
nowTop+~~(s*0.1)*dir;pull();nowTop=_top}}}
var body=document.body,scrollArr=[],goScroll=function(e){var len=scrollArr.length,o;e=e||window.event;if(e.preventDefault)e.preventDefault();else e.returnValue=false;while(len--){o=(new Function("return "+scrollArr[len]))();if(o.isValid())o.runScroll(e)}},wheelScroll=function(e){var isFromScroll=false,direct,thisScroll,o;e=e||window.event;o=e.target||e.srcElement;while(o.tagName.toUpperCase()!=="BODY"){thisScroll=o.getAttribute("data-scroll");if(thisScroll){isFromScroll=true;break}else o=o.parentNode}if(!isFromScroll)return;
if(e.preventDefault)e.preventDefault();else e.returnValue=false;direct=-e.wheelDelta||e.detail;direct=direct<0?-1:1;(new Function("return "+thisScroll))().wheelMove(direct)},_t;body.onmouseup=function(){body.onmousemove=null;if(_t)_t.reStart()};if(window.addEventListener)document.addEventListener("DOMMouseScroll",wheelScroll,false);window.onmousewheel=document.onmousewheel=wheelScroll;AC.namespace("AC.NavRight");
AC.NavRight={isHomeLeftNav:document.getElementById("mod-fixed-left-wr")?1:0,cookie:function(name,value,options){if(typeof value!="undefined"){options=options||{};if(value===null){value="";options.expires=-1}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date;date.setTime(date.getTime()+options.expires*24*60*60*1E3)}else date=options.expires;expires="; expires="+date.toUTCString()}var path=options.path?
"; path="+options.path:"";var domain=options.domain?"; domain="+options.domain:"";var secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("")}else{var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==name+"="){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}},
checkSkey:function(){var c=AC.NavRight.cookie("skey");if(c!=null&&c!="")return true;return false},getUserCookie:function(){var c=AC.NavRight.cookie("nav_userinfo_cookie");if(c!=null&&c!=""){var object=JSON.parse(c);if(typeof object!="object")return false;AC.NavRight.Core.uin=object.uin;AC.NavRight.Core.uinCrypt=object.uinCrypt;AC.NavRight.Core.nick=object.nick;AC.NavRight.Core.avatar=object.avatar;AC.NavRight.Core.hasLogin=object.hasLogin;AC.NavRight.Core.token=object.token}return AC.NavRight.Core.uin>
0},setUserCookie:function(){var object={"uin":AC.NavRight.Core.uin,"uinCrypt":AC.NavRight.Core.uinCrypt,"nick":AC.NavRight.Core.nick,"avatar":AC.NavRight.Core.avatar,"hasLogin":AC.NavRight.Core.hasLogin,"token":AC.NavRight.Core.token};var date=new Date;date.setTime(date.getTime()+36E5);AC.NavRight.cookie("nav_userinfo_cookie",JSON.stringify(object),{path:"/",expires:date})},processUrl:function(url){if(url=="http://ac.qq.com"||url=="http://ac.qq.com/")url="http://ac.qq.com/index?auth=1";else if(url.indexOf("?")!=
-1)url=url+(url.indexOf("auth=1")!=-1?"":"&auth=1");else url=url+(url.indexOf("auth=1")!=-1?"":"?auth=1");return url},showLogin:function(url,target){pgvSendClick({hottag:"AC.NAVRIGHT.LOGIN"});if(undefined==url||url=="")url=location.href;else{var httpPos=url.indexOf("http");if(httpPos<0)url=location.protocol+"//"+location.hostname+url+location.search}url=AC.NavRight.processUrl(url);if(undefined==target||target=="")target="top";else target="self";$.blockUI({message:$("#loginframe"),css:{top:"30%",left:"55%",
border:"none"}});document.domain="qq.com";$("#login_ifr").attr("src","http://ui.ptlogin2.qq.com/cgi-bin/login?target="+target+"&style=0&appid=637009801&daid=43&s_url="+encodeURIComponent(url));$(".blockPage").css({"height":"368px","left":"50%","top":"50%","width":"622px","margin":"-184px 0 0 -311px"})},showUserImage:function(){var data={};data.avatar=AC.NavRight.Core.avatar;data.hasLogin=AC.NavRight.Core.hasLogin;data.nick=AC.NavRight.Core.nick;data.uin=AC.NavRight.Core.uin;data.token=AC.NavRight.Core.token;
$("#sidebarComTabMe").find("img").attr("src",data.avatar)},LoadUserBaseInfo:function(){if(AC.NavRight.checkSkey()&&AC.NavRight.getUserCookie()){AC.NavRight.showUserImage();return}if(!AC.Page.cookie("skey")){$("#sidebarComTabMe").find("img").attr("src","http://ac.gtimg.com/media/images/top_face_no_bg.jpg");return}$.ajax({type:"GET",url:"http://ac.qq.com/MyPersonalCenter/getUserBaseInfo",async:false,cache:false,timeout:2E3,success:function(data){var data=$.parseJSON(data);if(data.status==2){AC.NavRight.Core.hasLogin=
"1";AC.NavRight.Core.avatar=data.data.avatar;AC.NavRight.Core.nick=data.data.shortNick;AC.NavRight.Core.token=data.data.token;AC.NavRight.Core.uin=data.data.uin;AC.NavRight.setUserCookie();$("#sidebarComTabMe").find("img").attr("src",data.data.avatar);AC.NavRight.Core.hasLoadUserBase=1}else if(data.status==-99||data.status==-97)$("#sidebarComTabMe").find("img").attr("src","http://ac.gtimg.com/media/images/top_face_no_bg.jpg")}})},loadCollectPanel:function(){$("#sideComColLoading").show();$("#sidebarComCollectData").hide();
if(AC.NavRight.Core.hasLoadCollect){var d=AC.NavRight.Core.collectList;$("#sidebarComCollectData").html(template.render("sidebarComScriptCollect",d));$("#sideComColLoading").hide();$("#sidebarComCollectData").show();if(d.data.length>0){var winHeight=document.documentElement.clientHeight||window.innerHeight;var doc=document.documentElement;window.navComScrollCollect=Scroll({contain:"navComColScrollList",wrap:"navComColScrollWrap",scrollBg:"navComColScrollBg",scrollBlock:"navComColscrollBlock"});function ScrollResize(){navComScrollCollect.init(doc.clientWidth,
doc.clientHeight-120)}ScrollResize();$("#navComColScrollList .panel-comic-item-cont a").click(function(){if($(this).hasClass("panel-collect-update")){var updateTotal=AC.NavRight.Core.updateLen,updateSeq=$(this).find(".collect-update").html(),readObj=$(this).parent().find(".collect-read"),href=$(readObj).parent().attr("href");if($(this).parent().attr("data-type")=="update"){$(this).next().hide();$(this).parents("li").find(".update-dot").hide();$(readObj).html(updateSeq);$(readObj).parent().attr("href",
href.split("seqno")[0]+"seqno/"+updateSeq);$(readObj).parent().attr("title","\u7b2c"+updateSeq+"\u8bdd");$("#sidebarComColUpdate").html(updateTotal-1);AC.NavRight.Core.updateLen--;if(updateTotal-1);else $("#sidebarComColDotLen").hide();$(this).parent().attr("data-type","")}}else $(this).parents("li").find(".update-dot").hide();var dataType=$(this).attr("data-type");if(dataType=="comic-detail")pgvSendClick({hottag:"AC.NAVRIGHT.COLLECT.COMICDETAIL"});else pgvSendClick({hottag:"AC.NAVRIGHT.COLLECT.COMICBROWSE"})})}}},
loadHistoryPanel:function(isLocal){var sideComPopBox=$("#sideComPopBox");$("#sideComHisLoading").show();$("#sidebarComHistoryData").hide();var d=AC.NavRight.Core.historyList;d.rankList=AC.NavRight.Core.rankList||[];$("#sidebarComHistoryData").html(template.render("sidebarComScriptHistory",d));$("#sideComHisLoading").hide();$("#sidebarComHistoryData").show();if(d.list&&d.list.length>0||d.localList&&d.localList.length>0){var winHeight=document.documentElement.clientHeight||window.innerHeight;var doc=
document.documentElement;window.navComScrollHistory=Scroll({contain:"navComHisScrollList",wrap:"navComHisScrollWrap",scrollBg:"navComHisScrollBg",scrollBlock:"navComHisscrollBlock"});$("#sidebarComTimeLine").css("min-height",winHeight);function ScrollResize(){if($("#sidebarComTimeLine").height()>$("#navComHisScrollWrap").height()+500&&$("#sidebarComTimeLine").height()!=doc.clientHeight)$("#sideComHistoryBottom").show();else $("#sideComHistoryBottom").hide();if(isLocal==2)navComScrollHistory.init(doc.clientWidth,
doc.clientHeight-140);else navComScrollHistory.init(doc.clientWidth,doc.clientHeight-80)}ScrollResize();$("#navComHisScrollList .panel-history-item a").click(function(){if($(this).hasClass("panel-collect-update")){var updateTotal=AC.NavRight.Core.updateLen,updateSeq=$(this).find(".collect-update").html(),parentNode=$(this).parent(),readObj=$(parentNode).find(".collect-read"),href=$(readObj).parent().attr("href");if($(parentNode).attr("data-type")=="update"){$(parentNode).find(".update-dot").hide();
$(readObj).html(updateSeq);$(readObj).parent().attr("href",href.split("seqno")[0]+"seqno/"+updateSeq);$(readObj).parent().attr("title","\u7b2c"+updateSeq+"\u8bdd");$(this).next().remove();if($(parentNode).find(".panel-history-collect").hasClass("collected"))if(updateTotal-1);else $("#sidebarComColDotLen").hide();$(parentNode).attr("data-type","")}pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.COMICBROWSE"})}else if(!$(this).hasClass("panel-history-collect")&&!$(this).hasClass("panel-history-delete"))$(this).parent().find(".update-dot").hide();
var dataType=$(this).attr("data-type");if(dataType=="go-anm")pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.ANM"});else if(dataType=="comic-detail")pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.COMICDETAIL"});else if(dataType=="comic-browse")pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.COMICBROWSE"})});function deleteHistory(obj){var parentNode=$(obj).parent();var prevNode=$(parentNode).prev();var nextNode=$(parentNode).next();if($(obj).hasClass("delete-local"))if($(prevNode).hasClass("panel-history-clear"))if(!$(nextNode).hasClass("panel-history-item"))$("#sidebarComHistoryData .scroll-me").slideUp(function(){$(this).remove();
AC.NavRight.loadRankList()});else $(nextNode).addClass("bdt0");else $(parentNode).slideUp(function(){$(this).remove();ScrollResize()});if($(prevNode).hasClass("history-title-time")){$(parentNode).slideUp(function(){$(this).remove();ScrollResize()});if(!$(nextNode).hasClass("panel-history-item"))$(prevNode).slideUp(function(){$(this).remove();ScrollResize()});else $(nextNode).addClass("bdt0");if($(prevNode).hasClass("mgt0"))if(!$(nextNode).hasClass("panel-history-item")&&!$(nextNode).hasClass("history-title-time"))$("#sidebarComHistoryData .scroll-me").slideUp(function(){$(this).remove();
AC.NavRight.loadRankList()});else $(nextNode).addClass("mgt0")}else $(parentNode).slideUp(function(){$(this).remove();ScrollResize()})}$("#navComHisScrollList .panel-history-delete").click(function(){var _this=$(this);if($(this).hasClass("delete-comic"))ajax.post({url:"http://ac.qq.com/MyPersonalCenter/delUserComicHistory",data:"tokenKey="+AC.NavRight.Core.token+"&comicId="+$(this).attr("data-id"),callback:function(data){var d=JSON.parse(data);if(d.status==2){deleteHistory($(_this));pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.DELETE"})}else if(d.status==
-99||d.status==-97)AC.NavRight.showLogin()}});else if($(this).hasClass("delete-anm"))ajax.post({url:"http://ac.qq.com/MyPersonalCenter/delUserAnimationHistory",data:"tokenKey="+AC.NavRight.Core.token+"&animationId="+$(this).attr("data-id"),callback:function(data){var d=JSON.parse(data);if(d.status==2)deleteHistory($(_this));else if(d.status==-99||d.status==-97)AC.NavRight.showLogin()}});else if($(this).hasClass("delete-local")){var id=$(this).attr("data-id"),recordList=JSON.parse(AC.NavRight.cookie("readRecord"))||
[],total=recordList.length,i=0,newRecordList;if(total)for(;i<total;++i)if(id==recordList[i][0]){recordList.splice(i,1);break}recordList.splice(20);newRecordList=JSON.stringify(recordList);AC.NavRight.cookie("readRecord",newRecordList,{path:"/",expires:30});deleteHistory($(_this))}});$("#sidebarComHisClear").click(function(){$(sideComPopBox).attr("data-type",$(this).attr("data-type")).fadeIn("fast")});$("#sideComPopBox .confirm-btn").click(function(){pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.CLEAR"});
if($(sideComPopBox).attr("data-type")=="local-clear"){AC.NavRight.cookie("readRecord","[]",{path:"/",expires:30});$("#sideComPopBox").fadeOut("fast");$("#sidebarComHistoryData .scroll-me").slideUp(function(){$(this).remove();AC.NavRight.loadRankList()})}else ajax.post({url:"http://ac.qq.com/MyPersonalCenter/delUserHistory",data:"tokenKey="+AC.NavRight.Core.token,callback:function(data){var d=JSON.parse(data);if(d.status==-99||d.status==-97){AC.NavRight.showLogin();return}$("#sideComPopBox").fadeOut("fast");
$("#sidebarComHistoryData .scroll-me").slideUp(function(){$(this).remove();AC.NavRight.loadRankList()})}})});$("#sideComPopBox .cancel-btn").click(function(){$(sideComPopBox).fadeOut("fast")});var animationFrame=function(){var lastTime=0,i=0,vendors=["webkit","moz","ms"],len=vendors.length;for(;i<len&&!window.requestAnimationFrame;i++){window.requestAnimationFrame=window[vendors[i]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[vendors[i]+"CancelAnimationFrame"]||window[vendors[i]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame||
!cancelAnimationFrame){window.requestAnimationFrame=function(callback,element){var currTime=+new Date,timeToCall=Math.max(0,16.7-currTime+lastTime),id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};window.cancelAnimationFrame=function(id){clearTimeout(id)}}}();function UnitBezier(p1x,p1y,p2x,p2y){this.cx=3*p1x;this.bx=3*(p2x-p1x)-this.cx;this.ax=1-this.cx-this.bx;this.cy=3*p1y;this.by=3*(p2y-p1y)-this.cy;this.ay=1-this.cy-this.by}UnitBezier.prototype=
{epsilon:0.01,sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(x,epsilon){var t0,t1,t2,x2,d2,i;for(t2=x,i=0;i<8;i++){x2=this.sampleCurveX(t2)-x;if(Math.abs(x2)<epsilon)return t2;d2=this.sampleCurveDerivativeX(t2);if(Math.abs(d2)<epsilon)break;t2=t2-x2/d2}t0=0;t1=1;t2=x;if(t2<t0)return t0;if(t2>t1)return t1;while(t0<t1){x2=
this.sampleCurveX(t2);if(Math.abs(x2-x)<epsilon)return t2;if(x>x2)t0=t2;else t1=t2;t2=(t1-t0)*0.5+t0}return t2},solve:function(x,epsilon){return this.sampleCurveY(this.solveCurveX(x,epsilon))}};function collectAnm(e){var $$=function(i){return document.getElementById(i)},bookshelf=$$("sidebarComTabCollect"),smallHeart=$$("sideComSmallHeart"),smallHeartStyle=smallHeart.style,start={},end={},cruveY=new UnitBezier(0.09,0.6,0.63,0.98),doc=document.documentElement,getRect=function(ele){var rect=ele.getBoundingClientRect(),
top=doc.clientTop,left=doc.clientLeft;return{top:rect.top-top,bottom:rect.bottom-top,left:rect.left-left,right:rect.right-left}},animationTime=600,timeStamp,endTime,move,_requestMove;e=e||window.event;if(e.pageX==null&&e.clientX!=null){e.pageX=e.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);e.pageY=e.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}start={x:e.pageX-smallHeart.offsetWidth/2,
y:e.pageY-smallHeart.offsetHeight/2};end={x:getRect(bookshelf).left+(doc&&doc.scrollLeft||body&&body.scrollLeft||0),y:getRect(bookshelf).top+(doc&&doc.scrollTop||body&&body.scrollTop||0)};end.y=end.y<0?0:end.y;diff={x:end.x-start.x,y:end.y-start.y};move=function(){var percent=(new Date-timeStamp)/animationTime,pFix=1;percent=percent>1?1:percent;if(percent===1){smallHeartStyle.cssText="";return 0}pFix=cruveY.solve(percent,0.0010);smallHeartStyle.cssText="top:"+~~(start.y+diff.y*pFix)+"px;left:"+~~(start.x+
diff.x*percent)+"px;opacity:"+~~(140-percent*100)/100+";";return 1};_requestMove=function(){requestAnimationFrame(function(){if(move())_requestMove()})};smallHeartStyle.cssText="top:"+start.y+"px;left:"+start.x+"px;";timeStamp=+new Date;endTime=timeStamp+animationTime,_requestMove()}$("#navComHisScrollList .panel-history-collect").click(function(e){var _this=$(this);if(!$(this).hasClass("collected"))ajax.post({url:"http://ac.qq.com/MyPersonalCenter/addUserCollection",data:"tokenKey="+AC.NavRight.Core.token+
"&comicId="+$(this).next().attr("data-id")+"&seqNo="+$(this).parent().find(".collect-read").html(),callback:function(data){var d=JSON.parse(data);if(d.status==2||d.status==3){$(_this).addClass("collected").attr("data-type","collect-delete");$(_this).attr("title","\u5df2\u6536\u85cf");collectAnm(e);if($(_this).parent().attr("data-type")=="update"){if(!AC.NavRight.Core.updateLen)$("#sidebarComColDotLen").show();AC.NavRight.Core.updateLen+=1}pgvSendClick({hottag:"AC.NAVRIGHT.HISTORY.COLLECT"})}else if(d.status==
-99||d.status==-97)AC.NavRight.showLogin()}})})}},loadMePanel:function(){$("#sideComMeLoading").show();$("#sidebarComMeData").hide();var d=AC.NavRight.Core.userList;d.avatar=AC.NavRight.Core.avatar;d.nick=AC.NavRight.Core.nick;$("#sidebarComMeData").html(template.render("sidebarComScriptMe",d));$("#sideComMeLoading").hide();$("#sidebarComMeData").show();$("#sidebarComPanelMeLogout").click(function(){AC.NavRight.logout()})},loadVipPanel:function(){$("#sideComVipLoading").show();$("#sidebarComVipData").hide();
var d=AC.NavRight.Core.userList;d.avatar=AC.NavRight.Core.avatar;d.nick=AC.NavRight.Core.nick;d.vipFree=AC.NavRight.Core.vipFree;$("#sidebarComVipData").html(template.render("sidebarComScriptVip",d));$("#sideComVipLoading").hide();$("#sidebarComVipData").show();$(".sidebar-common .pay-btn").click(function(){pgvSendClick({hottag:"AC.NAVRIGHT.VIP.PAY"});AC.NavRight.miniPay()})},cleanUserCookie:function(){AC.NavRight.cookie("nav_userinfo_cookie","",{path:"/","expires":1})},cleanCookie:function(){var i=
{};i.domain="ac.qq.com";i.path="/";this.cookie("p_skey","",i);this.cookie("p_uin","",i)},logout:function(){pt_logout.logout();AC.NavRight.cleanCookie();AC.NavRight.cleanUserCookie();AC.NavRight.Core.hasLogin=0;setTimeout(function(){location.reload()},500)},miniPay:function(){var aid="nav_charge_month";var channel=AC.Page.cookie("ac_channel");if(channel!=null)aid=channel;cashier.dialog.buy({type:"service",scene:"minipay",codes:"MHVIP",aid:aid,channels:"qdqb,kj,weixin",defaultChannel:"qdqb",amount:"3",
amountType:"month",size:{w:682,h:450},target:"",context:"",onSuccess:function(opt){},onError:function(opt){},onClose:function(opt){self.hideMask()},onNotify:function(opt){},actid:""})},loadRankList:function(){if(AC.NavRight.Core.hasLoadRank){$("#sidebarComHistoryData").hide();$("#sidebarComRankData").show()}else{$("#sidebarComHistoryData").hide();$("#sideComHisLoading").show();ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getTopRankComicInfo",callback:function(data){if(JSON.parse(data).status==
2){var d=JSON.parse(data).data;AC.NavRight.Core.rankList=d;AC.NavRight.Core.hasLoadRank=1;var dataOutput={};dataOutput.rankList=d;$("#sidebarComRankData").html(template.render("sidebarComScriptRank",dataOutput));$("#sideComHisLoading").hide();$("#sidebarComRankData").show()}}})}},requestLocalHistory:function(){ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserComicHistoryByLocal",callback:function(data){var d=JSON.parse(data);if(d.status==2){var recordList=JSON.parse(AC.NavRight.cookie("readRecord"))||
[];AC.NavRight.Core.historyList.localList=new Array;for(var i=0,recordLen=recordList.length;i<recordLen;i++)for(var j=0,dataLen=d.data.length;j<dataLen;j++)if(recordList[i][0]==d.data[j].id)AC.NavRight.Core.historyList.localList.push(d.data[j]);if(d.data.length==0)AC.NavRight.loadRankList();else{AC.NavRight.loadHistoryPanel(2);$("#sidebarComRankData").hide();$("#sidebarComHistoryData").show()}}}})}};AC.namespace("AC.NavRight.Core");AC.NavRight.Core={nick:"",avatar:"",uin:"",historyList:{}};
!function(){AC.NavRight.LoadUserBaseInfo();window.navComScrollHistory;window.navComScrollCollect;ajax={_createXMLHttpRequest:function(oldVersion,newVersion){return function(){if(oldVersion)return new ActiveXObject("Microsoft.XMLHTTP");else if(newVersion)return new XMLHttpRequest}}(window.ActiveXObject,window.XMLHttpRequest),get:function(settings){var xhr=this._createXMLHttpRequest(),data=settings.data||"",async=settings.async||true;xhr.open("GET",settings.url,async);xhr.onreadystatechange=function(){if(xhr.readyState===
4&&xhr.status===200)settings.callback(xhr.responseText)};xhr.send(data)},post:function(settings){var xhr=this._createXMLHttpRequest(),data=settings.data||"";if(data)data=data.replace(/\+/g,"%2B");xhr.open("POST",settings.url);xhr.onreadystatechange=function(){if(xhr.readyState===4&&xhr.status===200)if(typeof settings.callback==="function")if(settings.argu)settings.callback(xhr.responseText,settings.argu);else settings.callback(xhr.responseText)};xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.send(data)}};var lastTime=0;var requestAnimationFrame=function(callback,element){var currTime=+new Date,timeToCall=Math.max(0,16.7-currTime+lastTime),id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id},addClass=function(o,cls){if(!o)return;var oN=o.className;if(oN.indexOf(cls)===-1)o.className=oN+" "+cls};var winHeight=document.documentElement.clientHeight||window.innerHeight,$$=function(i){return document.getElementById(i)},isIE=
function(ua){return ua.indexOf("MSIE")!==-1}(navigator.userAgent),removeClass=function(o,cls){if(!o)return;var oN=o.className,arrName,arrNow;if(oN.indexOf(cls)===-1)return;arrName=oN.split(" ");arrNow=arrName.length;while(arrNow--)if(arrName[arrNow]===cls)arrName.splice(arrNow,1);o.className=arrName.join(" ")},navBindEvent=function(o,e,f){if(window.addEventListener)return function(o,e,f){if(!o)return;o.addEventListener(e,f,false)};else if(window.attachEvent)return function(o,e,f){if(!o)return;o.attachEvent("on"+
e,f)};else{if(!o)return;o["on"+e]=f}}(),changeLeft=function(){if(isIE)return function(o,y,t){if(o.currentStyle.left==="auto")o.style.left="-190px";var cs=o.currentStyle||window.getComputedStyle(o,null),s=o.style,cy=parseInt(s.left||cs.left||0,10),dy=y-cy,ft=+new Date,end=ft+t,pos=0,diff,_trans=function(){if(+new Date>end){s.left=y+"px";return 0}else{diff=end-new Date;pos=diff/t;s.left=cy+dy*(1-pos)+"px"}return 1},_requestTrans=function(){requestAnimationFrame(function(){if(_trans())_requestTrans()})};
_requestTrans()};else return function(o,to){o.style.left=to+"px"}}();var hasShowCode=0,leftActiveIndex=-1,leftActiveIndexUpdate=-1;if(AC.NavRight.isHomeLeftNav){var positionMap={"0":$("#in-strong-wr").offset().top-200,1:$("#in-anishe-wrap").offset().top-200,2:$("#in-anishe-xtwo").offset().top-200,3:$("#in-sign-wr").offset().top-200,4:$("#in-video-wr").offset().top-200,5:$("#in-vip-wr").offset().top-200,6:$("#in-teen-list-wr").offset().top-200,7:$("#in-top70").offset().top-200,8:$("body").height()-
$(window).height()-100};setTimeout(function(){positionMap={"0":$("#in-strong-wr").offset().top-200,1:$("#in-anishe-wrap").offset().top-200,2:$("#in-anishe-xtwo").offset().top-200,3:$("#in-sign-wr").offset().top-200,4:$("#in-video-wr").offset().top-200,5:$("#in-vip-wr").offset().top-200,6:$("#in-teen-list-wr").offset().top-200,7:$("#in-top70").offset().top-200,8:$("body").height()-$(window).height()-100}},2E3)}function topHandler(){var scrollTop=document.documentElement.scrollTop||window.pageYOffset||
document.body.scrollTop;if(scrollTop>winHeight){$$("sidebarComTabTop").style.display="block";if(!hasShowCode){$(codeImg).fadeIn("normal");showCode=1;$(body).bind("click",codeHide);hasShowCode=1}}else $$("sidebarComTabTop").style.display="none";if(AC.NavRight.isHomeLeftNav){if(scrollTop>positionMap["7"]+70)$("#mod-fixed-left-wr").addClass("mod-fixed-left-stop");else $("#mod-fixed-left-wr").removeClass("mod-fixed-left-stop");if(scrollTop>positionMap["0"])leftActiveIndexUpdate=0;else leftActiveIndexUpdate=
-1;if(scrollTop>positionMap["1"])leftActiveIndexUpdate=1;if(scrollTop>positionMap["2"])leftActiveIndexUpdate=2;if(scrollTop>positionMap["3"])leftActiveIndexUpdate=3;if(scrollTop>positionMap["4"])leftActiveIndexUpdate=4;if(scrollTop>positionMap["5"])leftActiveIndexUpdate=5;if(scrollTop>positionMap["6"])leftActiveIndexUpdate=6;if(scrollTop>positionMap["7"])leftActiveIndexUpdate=7;if(scrollTop>positionMap["8"])leftActiveIndexUpdate=8;if(leftActiveIndexUpdate!==leftActiveIndex&&leftActiveIndexUpdate!==
-1)$("#mod-fixed-left-tags").find("li").eq(leftActiveIndexUpdate).addClass("active").siblings().removeClass("active");else if(leftActiveIndexUpdate===-1)$("#mod-fixed-left-tags").find("li").removeClass("active");leftActiveIndex=leftActiveIndexUpdate}}function resizeHandler(){winHeight=document.documentElement.clientHeight||window.innerHeight;winWidth=document.documentElement.clientWidth||window.innerWidth;if(window.navComScrollHistory)window.navComScrollHistory.init(winWidth,winHeight-80);if(window.navComScrollCollect)window.navComScrollCollect.init(winWidth,
winHeight-120);if(winHeight<706)$("#sidebarComTab .tab-avatar").css({"margin-top":25});else $("#sidebarComTab .tab-avatar").css({"margin-top":225})}navBindEvent(window,"scroll",topHandler);navBindEvent(window,"resize",resizeHandler);resizeHandler();var sidebarComTab=$$("sidebarComTab");var panelList=$("#sidebar-common .side-panel");navBindEvent($$("sidebarComPanelMeClose"),"click",function(e){e=e||window.event;target=e.target||e.srcElement;if(target.getAttribute("data-type")=="panel-close"){removeClass(sidebarComTab,
"active");changeLeft(target.parentNode,0,200);$(tabMeParent).removeClass("active");activePanel=0}});navBindEvent($$("sidebarComPanelCollectClose"),"click",function(e){e=e||window.event;target=e.target||e.srcElement;if(target.getAttribute("data-type")=="panel-close"){removeClass(sidebarComTab,"active");changeLeft(target.parentNode,0,200);$(tabCollectParent).removeClass("active");activePanel=0}});navBindEvent($$("sidebarComPanelHistoryClose"),"click",function(e){e=e||window.event;target=e.target||e.srcElement;
if(target.getAttribute("data-type")=="panel-close"){removeClass(sidebarComTab,"active");changeLeft(target.parentNode,0,200);$(tabHistoryParent).removeClass("active");activePanel=0}});navBindEvent($$("sidebarComPanelVipClose"),"click",function(e){e=e||window.event;target=e.target||e.srcElement;if(target.getAttribute("data-type")=="panel-close"){removeClass(sidebarComTab,"active");changeLeft(target.parentNode,0,200);$(tabVipParent).removeClass("active");activePanel=0}});window.goTop=function(acceleration,
time){acceleration=acceleration||0.1;time=time||0;var x1=0;var y1=0;var x2=0;var y2=0;var x3=0;var y3=0;if(document.documentElement){x1=document.documentElement.scrollLeft||0;y1=document.documentElement.scrollTop||0}if(document.body){x2=document.body.scrollLeft||0;y2=document.body.scrollTop||0}var x3=window.scrollX||0;var y3=window.scrollY||0;var x=Math.max(x1,Math.max(x2,x3));var y=Math.max(y1,Math.max(y2,y3));var speed=1+acceleration;window.scrollTo(Math.floor(x/speed),Math.floor(y/speed));if(x>
0||y>0){var invokeFunction="goTop("+acceleration+", "+time+")";window.setTimeout(invokeFunction,time)}};var activePanel=0;var sidebarComPanelMe=$("#sidebarComPanelMe"),sidebarComPanelVIP=$("#sidebarComPanelVIP"),sidebarComPanelCollect=$("#sidebarComPanelCollect"),sidebarComPanelHistory=$("#sidebarComPanelHistory"),tabHistory=$("#sidebarComTabHistory"),tabCollect=$("#sidebarComTabCollect"),tabVip=$("#sidebarComTabVIP"),tabMeParent=$("#sidebarComTabMe"),tabHistoryParent=$("#sidebarComTabHistory").parent(),
tabCollectParent=$("#sidebarComTabCollect").parent(),tabVipParent=$("#sidebarComTabVIP").parent(),codeWrap=$("#sideComCodeWrap"),codeImg=$("#sideComCodeImg"),showCode=0;function blankPanelShrink(e){var _con=$("#sidebar-common");if(!_con.is(e.target)&&_con.has(e.target).length===0){removeClass(sidebarComTab,"active");switch(activePanel){case 1:changeLeft($$("sidebarComPanelMe"),0,200);$(tabMeParent).removeClass("active");break;case 2:changeLeft($$("sidebarComPanelCollect"),0,200);$(tabCollectParent).removeClass("active");
break;case 3:changeLeft($$("sidebarComPanelHistory"),0,200);$(tabHistoryParent).removeClass("active");break;case 4:changeLeft($$("sidebarComPanelVIP"),0,200);$(tabVipParent).removeClass("active");break}activePanel=0;$(body).unbind("click",blankPanelShrink)}}function codeHide(e){var _con1=$(codeImg);var _con2=$(codeWrap);if(!_con1.is(e.target)&&_con1.has(e.target).length===0&&!_con2.is(e.target)&&_con2.has(e.target).length===0){$(codeImg).fadeOut("normal");$(body).unbind("click",codeHide);showCode=
0}}navBindEvent($$("sidebarComTabMe"),"click",function(e){if(AC.NavRight.Core.hasLogin!="1"||!AC.NavRight.cookie("nav_userinfo_cookie"))AC.NavRight.showLogin();else{pgvSendClick({hottag:"AC.NAVRIGHT.PANEL.USER"});$(tabMeParent).addClass("active");addClass(sidebarComTab,"active");addClass($$("sidebarComPanelMe"),"active");switch(activePanel){case 0:$(sidebarComPanelMe).show(0,function(){changeLeft($$("sidebarComPanelMe"),-207,200)});break;case 2:$(sidebarComPanelMe).removeClass("nav-anm").css("left",
-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelCollect).hide().css("left",0);$(tabCollectParent).removeClass("active");break;case 3:$(sidebarComPanelMe).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelHistory).hide().css("left",0);$(tabHistoryParent).removeClass("active");break;case 4:$(sidebarComPanelMe).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelVIP).hide().css("left",
0);$(tabVipParent).removeClass("active");break}activePanel=1;ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserDetailInfo",callback:function(data){if(JSON.parse(data).status==2){var userList=JSON.parse(data).data;var d=JSON.parse(data);AC.NavRight.Core.userList=userList;AC.NavRight.Core.hasLoadUser=1;ajax.get({url:"http://ac.qq.com/Ajax/getMessageNotify",callback:function(data){var d=JSON.parse(data);if(d.state==1){AC.NavRight.Core.userList.news=d.msgList.length;AC.NavRight.loadMePanel()}}})}else if(JSON.parse(data).status==
-99||JSON.parse(data).status==-97)AC.NavRight.showLogin()}})}$(body).bind("click",blankPanelShrink)});navBindEvent($$("sidebarComTabVIP"),"click",function(e){if(AC.NavRight.Core.hasLogin!="1"||!AC.NavRight.cookie("nav_userinfo_cookie"))AC.NavRight.showLogin();else{pgvSendClick({hottag:"AC.NAVRIGHT.PANEL.VIP"});$(tabVipParent).addClass("active");addClass(sidebarComTab,"active");addClass($$("sidebarComPanelVIP"),"active");switch(activePanel){case 0:$(sidebarComPanelVIP).show(0,function(){changeLeft($$("sidebarComPanelVIP"),
-207,200)});break;case 1:$(sidebarComPanelVIP).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelMe).hide().css("left",0);$(tabMeParent).removeClass("active");break;case 2:$(sidebarComPanelVIP).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelCollect).hide().css("left",0);$(tabCollectParent).removeClass("active");break;case 3:$(sidebarComPanelVIP).removeClass("nav-anm").css("left",-207).show(0,
function(){$(this).addClass("nav-anm")});$(sidebarComPanelHistory).hide().css("left",0);$(tabHistoryParent).removeClass("active");break}activePanel=4;ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserDetailInfo",callback:function(data){if(JSON.parse(data).status==2){var userList=JSON.parse(data).data;AC.NavRight.Core.userList=userList;ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getVipFreeComicCount",callback:function(data){if(JSON.parse(data).status==2){var d=JSON.parse(data).data;AC.NavRight.Core.vipFree=
d;AC.NavRight.Core.hasLoadUser=1;AC.NavRight.loadVipPanel()}else if(JSON.parse(data).status==-99||JSON.parse(data).status==-97)AC.NavRight.showLogin()}})}else if(JSON.parse(data).status==-99||JSON.parse(data).status==-97)AC.NavRight.showLogin()}})}$(body).bind("click",blankPanelShrink)});navBindEvent($$("sidebarComTabCollect"),"click",function(e){if(AC.NavRight.Core.hasLogin!="1"||!AC.NavRight.cookie("nav_userinfo_cookie"))AC.NavRight.showLogin();else{pgvSendClick({hottag:"AC.NAVRIGHT.PANEL.COLLECT"});
$(tabCollectParent).addClass("active");addClass(sidebarComTab,"active");addClass($$("sidebarComPanelCollect"),"active");switch(activePanel){case 0:$(sidebarComPanelCollect).show(0,function(){changeLeft($$("sidebarComPanelCollect"),-207,200)});break;case 1:$(sidebarComPanelCollect).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelMe).hide().css("left",0);$(tabMeParent).removeClass("active");break;case 3:$(sidebarComPanelCollect).removeClass("nav-anm").css("left",
-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelHistory).hide().css("left",0);$(tabHistoryParent).removeClass("active");break;case 4:$(sidebarComPanelCollect).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelVIP).hide().css("left",0);$(tabVipParent).removeClass("active");break}activePanel=2;var updateLen=0;ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserCollection",callback:function(data){if(JSON.parse(data).status==
2){var collectList=JSON.parse(data).data;for(var i=0,len=collectList.length;i<len;i++)if(collectList[i].updateFlag==1)updateLen++;AC.NavRight.Core.updateLen=updateLen;if(updateLen>0)$("#sidebarComColDotLen").show();else $("#sidebarComColDotLen").hide();var d=JSON.parse(data);d["updateLen"]=updateLen;AC.NavRight.Core.collectList=d;AC.NavRight.Core.hasLoadCollect=1;AC.NavRight.loadCollectPanel()}else if(JSON.parse(data).status==-99||JSON.parse(data).status==-97)AC.NavRight.showLogin()}})}$(body).bind("click",
blankPanelShrink)});navBindEvent($$("sidebarComTabHistory"),"click",function(e){pgvSendClick({hottag:"AC.NAVRIGHT.PANEL.HISTORY"});$(tabHistoryParent).addClass("active");addClass(sidebarComTab,"active");addClass($$("sidebarComPanelHistory"),"active");switch(activePanel){case 0:$(sidebarComPanelHistory).show(0,function(){changeLeft($$("sidebarComPanelHistory"),-207,200)});break;case 1:$(sidebarComPanelHistory).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});
$(sidebarComPanelMe).hide().css("left",0);$(tabMeParent).removeClass("active");break;case 2:$(sidebarComPanelHistory).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelCollect).hide().css("left",0);$(tabCollectParent).removeClass("active");break;case 4:$(sidebarComPanelHistory).removeClass("nav-anm").css("left",-207).show(0,function(){$(this).addClass("nav-anm")});$(sidebarComPanelVIP).hide().css("left",0);$(tabVipParent).removeClass("active");
break}activePanel=3;if(AC.NavRight.Core.hasLogin!="1"||!AC.NavRight.cookie("nav_userinfo_cookie"))AC.NavRight.requestLocalHistory();else ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserHistory",callback:function(data){if(JSON.parse(data).status==2){var d=JSON.parse(data);AC.NavRight.Core.historyList=d.data;if(d.data.list.length==0)AC.NavRight.loadRankList();else{AC.NavRight.loadHistoryPanel();$("#sidebarComRankData").hide();$("#sidebarComHistoryData").show()}}else if(JSON.parse(data).status==
-99||JSON.parse(data).status==-97)AC.NavRight.requestLocalHistory()}});$(body).bind("click",blankPanelShrink)});var updateLen=0;if(AC.Page.cookie("skey"))ajax.get({url:"http://ac.qq.com/MyPersonalCenter/getUserCollection",callback:function(data){if(JSON.parse(data).status==2){var collectList=JSON.parse(data).data;for(var i=0,len=collectList.length;i<len;i++)if(collectList[i].updateFlag==1)updateLen++;AC.NavRight.Core.updateLen=updateLen;if(updateLen>0)$("#sidebarComColDotLen").show();var d=JSON.parse(data);
d["updateLen"]=updateLen;AC.NavRight.Core.collectList=d;AC.NavRight.Core.hasLoadCollect=1}}});navBindEvent($$("sidebarComTabTop"),"click",function(e){$("html, body").animate({scrollTop:0},100)});$("#sidebarComCode").mouseenter(function(){if(showCode===0){$(codeImg).fadeIn("normal");showCode=1;$(body).bind("click",codeHide)}});$("#sidebarComCode").mouseout(function(){showCode=0});$("#sidebarComCode").click(function(){if(showCode===1){$(codeImg).fadeOut("normal");showCode=2;$(body).unbind("click",codeHide)}else{$(codeImg).fadeIn("normal");
showCode=1;$(body).bind("click",codeHide)}})}();
