/*3.6.0*/ (function(b){"function"===typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(G){var i=!1,u=!1,g=0,e=2000,k=0,m=["webkit","ms","moz","o"],r=window.requestAnimationFrame||!1,q=window.cancelAnimationFrame||!1;if(!r){for(var d in m){var p=m[d];r||(r=window[p+"RequestAnimationFrame"]);q||(q=window[p+"CancelAnimationFrame"]||window[p+"CancelRequestAnimationFrame"])}}var n=window.MutationObserver||window.WebKitMutationObserver||!1,j={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:0.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var s=document.getElementsByTagName("script"),s=s[s.length-1].src.split("?")[0];return 0M?H.getScrollLeft()>=H.page.maxw:0>=H.getScrollLeft())&&(L=M,M=0));M&&(H.scrollmom&&H.scrollmom.stop(),H.lastdeltax+=M,H.debounced("mousewheelx",function(){var O=H.lastdeltax;H.lastdeltax=0;H.rail.drag||H.doScrollLeftBy(O)},15));if(L){if(H.opt.nativeparentscrolling&&N&&!H.ispage&&!H.zoomactive){if(0>L){if(H.getScrollTop()>=H.page.maxh){return !0}}else{if(0>=H.getScrollTop()){return !0}}}H.scrollmom&&H.scrollmom.stop();H.lastdeltay+=L;H.debounced("mousewheely",function(){var O=H.lastdeltay;H.lastdeltay=0;H.rail.drag||H.doScrollBy(O)},15)}w.stopImmediatePropagation();return w.preventDefault()}var H=this;this.version="3.6.0";this.name="nicescroll";this.me=E;this.opt={doc:G("body"),win:!1};G.extend(this.opt,j);this.opt.snapbackspeed=80;if(y){for(var J in H.opt){"undefined"!=typeof y[J]&&(H.opt[J]=y[J])}}this.iddoc=(this.doc=H.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(H.opt.win?H.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==H.opt.win;this.win=H.opt.win||(this.ispage?G(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?G(window):this.win;this.body=G("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=H.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.isrtlmode="auto"==this.opt.rtlmode?"rtl"==(this.win[0]==window?this.body:this.win).css("direction"):!0===this.opt.rtlmode;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do{this.id="ascrail"+e++}while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=H.opt.overflowx;this.overflowy=H.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=c();var C=G.extend({},this.detected);this.ishwscroll=(this.canhwscroll=C.hastransform&&H.opt.hwacceleration)&&H.haswrapper;this.hasreversehr=this.isrtlmode&&!C.iswebkit;this.istouchcapable=!1;!C.cantouch||C.isios||C.isandroid||!C.iswebkit&&!C.ismozilla||(this.istouchcapable=!0,C.cantouch=!1);H.opt.enablemouselockapi||(C.hasmousecapture=!1,C.haspointerlock=!1);this.debounced=function(w,K,M){var L=H.delaylist[w];H.delaylist[w]=K;L||setTimeout(function(){var N=H.delaylist[w];H.delaylist[w]=!1;N.call(H)},M)};var f=!1;this.synched=function(w,K){H.synclist[w]=K;(function(){f||(r(function(){f=!1;for(var L in H.synclist){var M=H.synclist[L];M&&M.call(H);H.synclist[L]=!1}}),f=!0)})();return w};this.unsynched=function(w){H.synclist[w]&&(H.synclist[w]=!1)};this.css=function(w,K){for(var L in K){H.saved.css.push([w,L,w.css(L)]),w.css(L,K[L])}};this.scrollTop=function(w){return"undefined"==typeof w?H.getScrollTop():H.setScrollTop(w)};this.scrollLeft=function(w){return"undefined"==typeof w?H.getScrollLeft():H.setScrollLeft(w)};var t=function(w,L,P,O,N,M,K){this.st=w;this.ed=L;this.spd=P;this.p1=O||0;this.p2=N||1;this.p3=M||0;this.p4=K||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};t.prototype={B2:function(w){return 3*w*w*(1-w)},B3:function(w){return 3*w*(1-w)*(1-w)},B4:function(w){return(1-w)*(1-w)*(1-w)},getNow:function(){var w=1-((new Date).getTime()-this.ts)/this.spd,K=this.B2(w)+this.B3(w)+this.B4(w);return 0>w?this.ed:this.st+Math.round(this.df*K)},update:function(w,K){this.st=this.getNow();this.ed=w;this.spd=K;this.ts=(new Date).getTime();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};C.hastranslate3d&&C.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(w){if(!w){if(w=B()){return 16==w.length?-w[13]:-w[5]}if(H.timerscroll&&H.timerscroll.bz){return H.timerscroll.bz.getNow()}}return H.doc.translate.y};this.getScrollLeft=function(w){if(!w){if(w=B()){return 16==w.length?-w[12]:-w[4]}if(H.timerscroll&&H.timerscroll.bh){return H.timerscroll.bh.getNow()}}return H.doc.translate.x};this.notifyScrollEvent=function(w){var K=document.createEvent("UIEvents");K.initUIEvent("scroll",!1,!0,window,1);K.niceevent=!0;w.dispatchEvent(K)};var F=this.isrtlmode?1:-1;C.hastranslate3d&&H.opt.enabletranslate3d?(this.setScrollTop=function(w,K){H.doc.translate.y=w;H.doc.translate.ty=-1*w+"px";H.doc.css(C.trstyle,"translate3d("+H.doc.translate.tx+","+H.doc.translate.ty+",0px)");K||H.notifyScrollEvent(H.win[0])},this.setScrollLeft=function(w,K){H.doc.translate.x=w;H.doc.translate.tx=w*F+"px";H.doc.css(C.trstyle,"translate3d("+H.doc.translate.tx+","+H.doc.translate.ty+",0px)");K||H.notifyScrollEvent(H.win[0])}):(this.setScrollTop=function(w,K){H.doc.translate.y=w;H.doc.translate.ty=-1*w+"px";H.doc.css(C.trstyle,"translate("+H.doc.translate.tx+","+H.doc.translate.ty+")");K||H.notifyScrollEvent(H.win[0])},this.setScrollLeft=function(w,K){H.doc.translate.x=w;H.doc.translate.tx=w*F+"px";H.doc.css(C.trstyle,"translate("+H.doc.translate.tx+","+H.doc.translate.ty+")");K||H.notifyScrollEvent(H.win[0])})}else{this.getScrollTop=function(){return H.docscroll.scrollTop()},this.setScrollTop=function(w){return H.docscroll.scrollTop(w)},this.getScrollLeft=function(){return H.detected.ismozilla&&H.isrtlmode?Math.abs(H.docscroll.scrollLeft()):H.docscroll.scrollLeft()},this.setScrollLeft=function(w){return H.docscroll.scrollLeft(H.detected.ismozilla&&H.isrtlmode?-w:w)}}this.getTarget=function(w){return w?w.target?w.target:w.srcElement?w.srcElement:!1:!1};this.hasParent=function(w,K){if(!w){return !1}for(var L=w.target||w.srcElement||w||!1;L&&L.id!=K;){L=L.parentNode||!1}return !1!==L};var I={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(H.isfixed){var w=H.win.offset(),K=H.getDocumentScrollOffset();w.top-=K.top;w.left-=K.left;return w}w=H.win.offset();if(!H.viewport){return w}K=H.viewport.offset();return{top:w.top-K.top,left:w.left-K.left}};this.updateScrollBar=function(w){if(H.ishwscroll){H.rail.css({height:H.win.innerHeight()-(H.opt.railpadding.top+H.opt.railpadding.bottom)}),H.railh&&H.railh.css({width:H.win.innerWidth()-(H.opt.railpadding.left+H.opt.railpadding.right)})}else{var K=H.getOffset(),N=K.top,M=K.left-(H.opt.railpadding.left+H.opt.railpadding.right),N=N+D(H.win,"border-top-width",!0),M=M+(H.rail.align?H.win.outerWidth()-D(H.win,"border-right-width")-H.rail.width:D(H.win,"border-left-width")),L=H.opt.railoffset;L&&(L.top&&(N+=L.top),H.rail.align&&L.left&&(M+=L.left));H.railslocked||H.rail.css({top:N,left:M,height:(w?w.h:H.win.innerHeight())-(H.opt.railpadding.top+H.opt.railpadding.bottom)});H.zoom&&H.zoom.css({top:N+1,left:1==H.rail.align?M-20:M+H.rail.width+4});if(H.railh&&!H.railslocked){N=K.top;M=K.left;if(L=H.opt.railhoffset){L.top&&(N+=L.top),L.left&&(M+=L.left)}w=H.railh.align?N+D(H.win,"border-top-width",!0)+H.win.innerHeight()-H.railh.height:N+D(H.win,"border-top-width",!0);M+=D(H.win,"border-left-width");H.railh.css({top:w-(H.opt.railpadding.top+H.opt.railpadding.bottom),left:M,width:H.railh.width})}}};this.doRailClick=function(w,K,M){var L;H.railslocked||(H.cancelEvent(w),K?(K=M?H.doScrollLeft:H.doScrollTop,L=M?(w.pageX-H.railh.offset().left-H.cursorwidth/2)*H.scrollratio.x:(w.pageY-H.rail.offset().top-H.cursorheight/2)*H.scrollratio.y,K(L)):(K=M?H.doScrollLeftBy:H.doScrollBy,L=M?H.scroll.x:H.scroll.y,w=M?w.pageX-H.railh.offset().left:w.pageY-H.rail.offset().top,M=M?H.view.w:H.view.h,K(L>=w?M:-M)))};H.hasanimationframe=r;H.hascancelanimationframe=q;H.hasanimationframe?H.hascancelanimationframe||(q=function(){H.cancelAnimationFrame=!0}):(r=function(w){return setTimeout(w,15-Math.floor(+new Date/1000)%16)},q=clearInterval);this.init=function(){H.saved.css=[];if(C.isie7mobile||C.isoperamini){return !0}C.hasmstouch&&H.css(H.ispage?G("html"):H.win,{"-ms-touch-action":"none"});H.zindex="auto";H.zindex=H.ispage||"auto"!=H.opt.zindex?H.opt.zindex:x()||"auto";!H.ispage&&"auto"!=H.zindex&&H.zindex>k&&(k=H.zindex);H.isie&&0==H.zindex&&"auto"==H.opt.zindex&&(H.zindex="auto");if(!H.ispage||!C.cantouch&&!C.isieold&&!C.isie9mobile){var U=H.docscroll;H.ispage&&(U=H.haswrapper?H.win:H.doc);C.isie9mobile||H.css(U,{"overflow-y":"hidden"});H.ispage&&C.isie7&&("BODY"==H.doc[0].nodeName?H.css(G("html"),{"overflow-y":"hidden"}):"HTML"==H.doc[0].nodeName&&H.css(G("body"),{"overflow-y":"hidden"}));!C.isios||H.ispage||H.haswrapper||H.css(G("body"),{"-webkit-overflow-scrolling":"touch"});var Q=G(document.createElement("div"));Q.css({position:"relative",top:0,"float":"right",width:H.opt.cursorwidth,height:"0px","background-color":H.opt.cursorcolor,border:H.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":H.opt.cursorborderradius,"-moz-border-radius":H.opt.cursorborderradius,"border-radius":H.opt.cursorborderradius});Q.hborder=parseFloat(Q.outerHeight()-Q.innerHeight());Q.addClass("nicescroll-cursors");H.cursor=Q;var T=G(document.createElement("div"));T.attr("id",H.id);T.addClass("nicescroll-rails nicescroll-rails-vr");var S,P,O=["left","right","top","bottom"],V;for(V in O){P=O[V],(S=H.opt.railpadding[P])?T.css("padding-"+P,S+"px"):H.opt.railpadding[P]=0}T.append(Q);T.width=Math.max(parseFloat(H.opt.cursorwidth),Q.outerWidth());T.css({width:T.width+"px",zIndex:H.zindex,background:H.opt.background,cursor:"default"});T.visibility=!0;T.scrollable=!0;T.align="left"==H.opt.railalign?0:1;H.rail=T;Q=H.rail.drag=!1;!H.opt.boxzoom||H.ispage||C.isieold||(Q=document.createElement("div"),H.bind(Q,"click",H.doZoom),H.bind(Q,"mouseenter",function(){H.zoom.css("opacity",H.opt.cursoropacitymax)}),H.bind(Q,"mouseleave",function(){H.zoom.css("opacity",H.opt.cursoropacitymin)}),H.zoom=G(Q),H.zoom.css({cursor:"pointer","z-index":H.zindex,backgroundImage:"url("+H.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),H.opt.dblclickzoom&&H.bind(H.win,"dblclick",H.doZoom),C.cantouch&&H.opt.gesturezoom&&(H.ongesturezoom=function(M){1.5M.scale&&H.doZoomOut(M);return H.cancelEvent(M)},H.bind(H.win,"gestureend",H.ongesturezoom)));H.railh=!1;var N;H.opt.horizrailenabled&&(H.css(U,{"overflow-x":"hidden"}),Q=G(document.createElement("div")),Q.css({position:"absolute",top:0,height:H.opt.cursorwidth,width:"0px","background-color":H.opt.cursorcolor,border:H.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":H.opt.cursorborderradius,"-moz-border-radius":H.opt.cursorborderradius,"border-radius":H.opt.cursorborderradius}),C.isieold&&Q.css({overflow:"hidden"}),Q.wborder=parseFloat(Q.outerWidth()-Q.innerWidth()),Q.addClass("nicescroll-cursors"),H.cursorh=Q,N=G(document.createElement("div")),N.attr("id",H.id+"-hr"),N.addClass("nicescroll-rails nicescroll-rails-hr"),N.height=Math.max(parseFloat(H.opt.cursorwidth),Q.outerHeight()),N.css({height:N.height+"px",zIndex:H.zindex,background:H.opt.background}),N.append(Q),N.visibility=!0,N.scrollable=!0,N.align="top"==H.opt.railvalign?0:1,H.railh=N,H.railh.drag=!1);H.ispage?(T.css({position:"fixed",top:"0px",height:"100%"}),T.align?T.css({right:"0px"}):T.css({left:"0px"}),H.body.append(T),H.railh&&(N.css({position:"fixed",left:"0px",width:"100%"}),N.align?N.css({bottom:"0px"}):N.css({top:"0px"}),H.body.append(N))):(H.ishwscroll?("static"==H.win.css("position")&&H.css(H.win,{position:"relative"}),U="HTML"==H.win[0].nodeName?H.body:H.win,G(U).scrollTop(0).scrollLeft(0),H.zoom&&(H.zoom.css({position:"absolute",top:1,right:0,"margin-right":T.width+4}),U.append(H.zoom)),T.css({position:"absolute",top:0}),T.align?T.css({right:0}):T.css({left:0}),U.append(T),N&&(N.css({position:"absolute",left:0,bottom:0}),N.align?N.css({bottom:0}):N.css({top:0}),U.append(N))):(H.isfixed="fixed"==H.win.css("position"),U=H.isfixed?"fixed":"absolute",H.isfixed||(H.viewport=H.getViewport(H.win[0])),H.viewport&&(H.body=H.viewport,0==/fixed|absolute/.test(H.viewport.css("position"))&&H.css(H.viewport,{position:"relative"})),T.css({position:U}),H.zoom&&H.zoom.css({position:U}),H.updateScrollBar(),H.body.append(T),H.zoom&&H.body.append(H.zoom),H.railh&&(N.css({position:U}),H.body.append(N))),C.isios&&H.css(H.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),C.isie&&H.opt.disableoutline&&H.win.attr("hideFocus","true"),C.iswebkit&&H.opt.disableoutline&&H.win.css({outline:"none"}));!1===H.opt.autohidemode?(H.autohidedom=!1,H.rail.css({opacity:H.opt.cursoropacitymax}),H.railh&&H.railh.css({opacity:H.opt.cursoropacitymax})):!0===H.opt.autohidemode||"leave"===H.opt.autohidemode?(H.autohidedom=G().add(H.rail),C.isie8&&(H.autohidedom=H.autohidedom.add(H.cursor)),H.railh&&(H.autohidedom=H.autohidedom.add(H.railh)),H.railh&&C.isie8&&(H.autohidedom=H.autohidedom.add(H.cursorh))):"scroll"==H.opt.autohidemode?(H.autohidedom=G().add(H.rail),H.railh&&(H.autohidedom=H.autohidedom.add(H.railh))):"cursor"==H.opt.autohidemode?(H.autohidedom=G().add(H.cursor),H.railh&&(H.autohidedom=H.autohidedom.add(H.cursorh))):"hidden"==H.opt.autohidemode&&(H.autohidedom=!1,H.hide(),H.railslocked=!1);if(C.isie9mobile){H.scrollmom=new h(H),H.onmangotouch=function(){var M=H.getScrollTop(),ab=H.getScrollLeft();if(M==H.scrollmom.lastscrolly&&ab==H.scrollmom.lastscrollx){return !0}var W=M-H.mangotouch.sy,Z=ab-H.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(Z,2)+Math.pow(W,2)))){var aa=0>W?-1:1,Y=0>Z?-1:1,X=+new Date;H.mangotouch.lazy&&clearTimeout(H.mangotouch.lazy);80X?X=Math.round(X/2):X>H.page.maxh&&(X=H.page.maxh+Math.round((X-H.page.maxh)/2)):(0>X&&(M=X=0),X>H.page.maxh&&(X=H.page.maxh,M=0));var W;H.railh&&H.railh.scrollable&&(W=H.isrtlmode?ae-H.rail.drag.sl:H.rail.drag.sl-ae,H.ishwscroll&&H.opt.bouncescroll?0>W?W=Math.round(W/2):W>H.page.maxw&&(W=H.page.maxw+Math.round((W-H.page.maxw)/2)):(0>W&&(Y=W=0),W>H.page.maxw&&(W=H.page.maxw,Y=0)));Z=!1;if(H.rail.drag.dl){Z=!0,"v"==H.rail.drag.dl?W=H.rail.drag.sl:"h"==H.rail.drag.dl&&(X=H.rail.drag.st)}else{aa=Math.abs(aa);var ae=Math.abs(ae),ab=H.opt.directionlockdeadzone;if("v"==H.rail.drag.ck){if(aa>ab&&ae<=0.3*aa){return H.rail.drag=!1,!0}ae>ab&&(H.rail.drag.dl="f",G("body").scrollTop(G("body").scrollTop()))}else{if("h"==H.rail.drag.ck){if(ae>ab&&aa<=0.3*ae){return H.rail.drag=!1,!0}aa>ab&&(H.rail.drag.dl="f",G("body").scrollLeft(G("body").scrollLeft()))}}}H.synched("touchmove",function(){H.rail.drag&&2==H.rail.drag.pt&&(H.prepareTransition&&H.prepareTransition(0),H.rail.scrollable&&H.setScrollTop(X),H.scrollmom.update(Y,M),H.railh&&H.railh.scrollable?(H.setScrollLeft(W),H.showCursor(X,W)):H.showCursor(X),C.isie10&&document.selection.clear())});C.ischrome&&H.istouchcapable&&(Z=!1);if(Z){return H.cancelEvent(ad)}}else{if(1==H.rail.drag.pt){return H.onmousemove(ad)}}}}H.onmousedown=function(M,X){if(!H.rail.drag||1==H.rail.drag.pt){if(H.railslocked){return H.cancelEvent(M)}H.cancelScroll();H.rail.drag={x:M.clientX,y:M.clientY,sx:H.scroll.x,sy:H.scroll.y,pt:1,hr:!!X};var W=H.getTarget(M);!H.ispage&&C.hasmousecapture&&W.setCapture();H.isiframe&&!C.hasmousecapture&&(H.saved.csspointerevents=H.doc.css("pointer-events"),H.css(H.doc,{"pointer-events":"none"}));H.hasmoving=!1;return H.cancelEvent(M)}};H.onmouseup=function(M){if(H.rail.drag){if(1!=H.rail.drag.pt){return !0}C.hasmousecapture&&document.releaseCapture();H.isiframe&&!C.hasmousecapture&&H.doc.css("pointer-events",H.saved.csspointerevents);H.rail.drag=!1;H.hasmoving&&H.triggerScrollEnd();return H.cancelEvent(M)}};H.onmousemove=function(M){if(H.rail.drag&&1==H.rail.drag.pt){if(C.ischrome&&0==M.which){return H.onmouseup(M)}H.cursorfreezed=!0;H.hasmoving=!0;if(H.rail.drag.hr){H.scroll.x=H.rail.drag.sx+(M.clientX-H.rail.drag.x);0>H.scroll.x&&(H.scroll.x=0);var W=H.scrollvaluemaxw;H.scroll.x>W&&(H.scroll.x=W)}else{H.scroll.y=H.rail.drag.sy+(M.clientY-H.rail.drag.y),0>H.scroll.y&&(H.scroll.y=0),W=H.scrollvaluemax,H.scroll.y>W&&(H.scroll.y=W)}H.synched("mousemove",function(){H.rail.drag&&1==H.rail.drag.pt&&(H.showCursor(),H.rail.drag.hr?H.hasreversehr?H.doScrollLeft(H.scrollvaluemaxw-Math.round(H.scroll.x*H.scrollratio.x),H.opt.cursordragspeed):H.doScrollLeft(Math.round(H.scroll.x*H.scrollratio.x),H.opt.cursordragspeed):H.doScrollTop(Math.round(H.scroll.y*H.scrollratio.y),H.opt.cursordragspeed))});return H.cancelEvent(M)}};if(C.cantouch||H.opt.touchbehavior){H.onpreventclick=function(M){if(H.preventclick){return H.preventclick.tg.onclick=H.preventclick.click,H.preventclick=!1,H.cancelEvent(M)}},H.bind(H.win,"mousedown",H.ontouchstart),H.onclick=C.isios?!1:function(M){return H.lastmouseup?(H.lastmouseup=!1,H.cancelEvent(M)):!0},H.opt.grabcursorenabled&&C.cursorgrabvalue&&(H.css(H.ispage?H.doc:H.win,{cursor:C.cursorgrabvalue}),H.css(H.rail,{cursor:C.cursorgrabvalue}))}else{var K=function(M){if(H.selectiondrag){if(M){var W=H.win.outerHeight();M=M.pageY-H.selectiondrag.top;0=W&&(M-=W);H.selectiondrag.df=M}0!=H.selectiondrag.df&&(H.doScrollBy(2*-Math.floor(H.selectiondrag.df/6)),H.debounced("doselectionscroll",function(){K()},50))}};H.hasTextSelected="getSelection" in document?function(){return 0H.page.maxh?H.doScrollTop(H.page.maxh):(H.scroll.y=Math.round(H.getScrollTop()*(1/H.scrollratio.y)),H.scroll.x=Math.round(H.getScrollLeft()*(1/H.scrollratio.x)),H.cursoractive&&H.noticeCursor());H.scroll.y&&0==H.getScrollTop()&&H.doScrollTo(Math.floor(H.scroll.y*H.scrollratio.y));return H};this.resize=H.onResize;this.lazyResize=function(w){w=isNaN(w)?30:w;H.debounced("resize",H.resize,w);return H};this.jqbind=function(w,L,K){H.events.push({e:w,n:L,f:K,q:!0});G(w).bind(L,K)};this.bind=function(w,N,M,L){var K="jquery" in w?w[0]:w;"mousewheel"==N?window.addEventListener||"onwheel" in document?H._bind(K,"wheel",M,L||!1):(w="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",v(K,w,M,L||!1),"DOMMouseScroll"==w&&v(K,"MozMousePixelScroll",M,L||!1)):K.addEventListener?(C.cantouch&&/mouseup|mousedown|mousemove/.test(N)&&H._bind(K,"mousedown"==N?"touchstart":"mouseup"==N?"touchend":"touchmove",function(P){if(P.touches){if(2>P.touches.length){var O=P.touches.length?P.touches[0]:P;O.original=P;M.call(this,O)}}else{P.changedTouches&&(O=P.changedTouches[0],O.original=P,M.call(this,O))}},L||!1),H._bind(K,N,M,L||!1),C.cantouch&&"mouseup"==N&&H._bind(K,"touchcancel",M,L||!1)):H._bind(K,N,function(O){(O=O||window.event||!1)&&O.srcElement&&(O.target=O.srcElement);"pageY" in O||(O.pageX=O.clientX+document.documentElement.scrollLeft,O.pageY=O.clientY+document.documentElement.scrollTop);return !1===M.call(K,O)||!1===L?H.cancelEvent(O):!0})};C.haseventlistener?(this._bind=function(w,M,L,K){H.events.push({e:w,n:M,f:L,b:K,q:!1});w.addEventListener(M,L,K||!1)},this.cancelEvent=function(w){if(!w){return !1}w=w.original?w.original:w;w.preventDefault();w.stopPropagation();w.preventManipulation&&w.preventManipulation();return !1},this.stopPropagation=function(w){if(!w){return !1}w=w.original?w.original:w;w.stopPropagation();return !1},this._unbind=function(w,M,L,K){w.removeEventListener(M,L,K)}):(this._bind=function(w,M,L,K){H.events.push({e:w,n:M,f:L,b:K,q:!1});w.attachEvent?w.attachEvent("on"+M,L):w["on"+M]=L},this.cancelEvent=function(w){w=window.event||!1;if(!w){return !1}w.cancelBubble=!0;w.cancel=!0;return w.returnValue=!1},this.stopPropagation=function(w){w=window.event||!1;if(!w){return !1}w.cancelBubble=!0;return !1},this._unbind=function(w,M,L,K){w.detachEvent?w.detachEvent("on"+M,L):w["on"+M]=!1});this.unbindAll=function(){for(var w=0;w(H.newscrolly-L)*(N-L)||0>(H.newscrollx-K)*(w-K))&&H.cancelScroll();0==H.opt.bouncescroll&&(0>N?N=0:N>H.page.maxh&&(N=H.page.maxh),0>w?w=0:w>H.page.maxw&&(w=H.page.maxw));if(H.scrollrunning&&w==H.newscrollx&&N==H.newscrolly){return !1}H.newscrolly=N;H.newscrollx=w;H.newscrollspeed=M||!1;if(H.timer){return !1}H.timer=setTimeout(function(){var R=H.getScrollTop(),Q=H.getScrollLeft(),P,O;P=w-Q;O=N-R;P=Math.round(Math.sqrt(Math.pow(P,2)+Math.pow(O,2)));P=H.newscrollspeed&&1=H.newscrollspeed&&(P*=H.newscrollspeed);H.prepareTransition(P,!0);H.timerscroll&&H.timerscroll.tm&&clearInterval(H.timerscroll.tm);0w?w=0:w>H.page.maxh&&(w=H.page.maxh);0>K?K=0:K>H.page.maxw&&(K=H.page.maxw);if(w!=H.newscrolly||K!=H.newscrollx){return H.doScrollPos(K,w,H.opt.snapbackspeed)}H.onscrollend&&H.scrollrunning&&H.triggerScrollEnd();H.scrollrunning=!1}):(this.doScrollLeft=function(w,L){var K=H.scrollrunning?H.newscrolly:H.getScrollTop();H.doScrollPos(w,K,L)},this.doScrollTop=function(w,L){var K=H.scrollrunning?H.newscrollx:H.getScrollLeft();H.doScrollPos(K,w,L)},this.doScrollPos=function(S,R,Q){function P(){if(H.cancelAnimationFrame){return !0}H.scrollrunning=!0;if(w=1-w){return H.timer=r(P)||1}var T=0,W,V,U=V=H.getScrollTop();if(H.dst.ay){U=H.bzscroll?H.dst.py+H.bzscroll.getNow()*H.dst.ay:H.newscrolly;W=U-V;if(0>W&&UH.newscrolly){U=H.newscrolly}H.setScrollTop(U);U==H.newscrolly&&(T=1)}else{T=1}V=W=H.getScrollLeft();if(H.dst.ax){V=H.bzscroll?H.dst.px+H.bzscroll.getNow()*H.dst.ax:H.newscrollx;W=V-W;if(0>W&&VH.newscrollx){V=H.newscrollx}H.setScrollLeft(V);V==H.newscrollx&&(T+=1)}else{T+=1}2==T?(H.timer=0,H.cursorfreezed=!1,H.bzscroll=!1,H.scrollrunning=!1,0>U?U=0:U>H.page.maxh&&(U=H.page.maxh),0>V?V=0:V>H.page.maxw&&(V=H.page.maxw),V!=H.newscrollx||U!=H.newscrolly?H.doScrollPos(V,U):H.onscrollend&&H.triggerScrollEnd()):H.timer=r(P)||1}R="undefined"==typeof R||!1===R?H.getScrollTop(!0):R;if(H.timer&&H.newscrolly==R&&H.newscrollx==S){return !0}H.timer&&q(H.timer);H.timer=0;var O=H.getScrollTop(),N=H.getScrollLeft();(0>(H.newscrolly-O)*(R-O)||0>(H.newscrollx-N)*(S-N))&&H.cancelScroll();H.newscrolly=R;H.newscrollx=S;H.bouncescroll&&H.rail.visibility||(0>H.newscrolly?H.newscrolly=0:H.newscrolly>H.page.maxh&&(H.newscrolly=H.page.maxh));H.bouncescroll&&H.railh.visibility||(0>H.newscrollx?H.newscrollx=0:H.newscrollx>H.page.maxw&&(H.newscrollx=H.page.maxw));H.dst={};H.dst.x=S-N;H.dst.y=R-O;H.dst.px=N;H.dst.py=O;var M=Math.round(Math.sqrt(Math.pow(H.dst.x,2)+Math.pow(H.dst.y,2)));H.dst.ax=H.dst.x/M;H.dst.ay=H.dst.y/M;var L=0,K=M;0==H.dst.x?(L=O,K=R,H.dst.ay=1,H.dst.py=0):0==H.dst.y&&(L=N,K=S,H.dst.ax=1,H.dst.px=0);M=H.getTransitionSpeed(M);Q&&1>=Q&&(M*=Q);H.bzscroll=0=H.page.maxh||N==H.page.maxw&&S>=H.page.maxw)&&H.checkContentSize();var w=1;H.cancelAnimationFrame=!1;H.timer=1;H.onscrollstart&&!H.scrollrunning&&H.onscrollstart.call(H,{type:"scrollstart",current:{x:N,y:O},request:{x:S,y:R},end:{x:H.newscrollx,y:H.newscrolly},speed:M});P();(O==H.page.maxh&&R>=O||N==H.page.maxw&&S>=N)&&H.checkContentSize();H.noticeCursor()}},this.cancelScroll=function(){H.timer&&q(H.timer);H.timer=0;H.bzscroll=!1;H.scrollrunning=!1;return H}):(this.doScrollLeft=function(w,L){var K=H.getScrollTop();H.doScrollPos(w,K,L)},this.doScrollTop=function(w,L){var K=H.getScrollLeft();H.doScrollPos(K,w,L)},this.doScrollPos=function(w,N,M){var L=w>H.page.maxw?H.page.maxw:w;0>L&&(L=0);var K=N>H.page.maxh?H.page.maxh:N;0>K&&(K=0);H.synched("scroll",function(){H.setScrollTop(K);H.setScrollLeft(L)})},this.cancelScroll=function(){});this.doScrollBy=function(w,M){var L=0,L=M?Math.floor((H.scroll.y-w)*H.scrollratio.y):(H.timer?H.newscrolly:H.getScrollTop(!0))-w;if(H.bouncescroll){var K=Math.round(H.view.h/2);L<-K?L=-K:L>H.page.maxh+K&&(L=H.page.maxh+K)}H.cursorfreezed=!1;K=H.getScrollTop(!0);if(0>L&&0>=K){return H.noticeCursor()}if(L>H.page.maxh&&K>=H.page.maxh){return H.checkContentSize(),H.noticeCursor()}H.doScrollTop(L)};this.doScrollLeftBy=function(w,M){var L=0,L=M?Math.floor((H.scroll.x-w)*H.scrollratio.x):(H.timer?H.newscrollx:H.getScrollLeft(!0))-w;if(H.bouncescroll){var K=Math.round(H.view.w/2);L<-K?L=-K:L>H.page.maxw+K&&(L=H.page.maxw+K)}H.cursorfreezed=!1;K=H.getScrollLeft(!0);if(0>L&&0>=K||L>H.page.maxw&&K>=H.page.maxw){return H.noticeCursor()}H.doScrollLeft(L)};this.doScrollTo=function(w,K){K&&Math.round(w*H.scrollratio.y);H.cursorfreezed=!1;H.doScrollTop(w)};this.checkContentSize=function(){var w=H.getContentSize();w.h==H.page.h&&w.w==H.page.w||H.resize(!1,w)};H.onscroll=function(w){H.rail.drag||H.cursorfreezed||H.synched("scroll",function(){H.scroll.y=Math.round(H.getScrollTop()*(1/H.scrollratio.y));H.railh&&(H.scroll.x=Math.round(H.getScrollLeft()*(1/H.scrollratio.x)));H.noticeCursor()})};H.bind(H.docscroll,"scroll",H.onscroll);this.doZoomIn=function(w){if(!H.zoomactive){H.zoomactive=!0;H.zoomrestore={style:{}};var N="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),M=H.win[0].style,L;for(L in N){var K=N[L];H.zoomrestore.style[K]="undefined"!=typeof M[K]?M[K]:""}H.zoomrestore.style.width=H.win.css("width");H.zoomrestore.style.height=H.win.css("height");H.zoomrestore.padding={w:H.win.outerWidth()-H.win.width(),h:H.win.outerHeight()-H.win.height()};C.isios4&&(H.zoomrestore.scrollTop=G(window).scrollTop(),G(window).scrollTop(0));H.win.css({position:C.isios4?"absolute":"fixed",top:0,left:0,"z-index":k+100,margin:"0px"});N=H.win.css("backgroundColor");(""==N||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(N))&&H.win.css("backgroundColor","#fff");H.rail.css({"z-index":k+101});H.zoom.css({"z-index":k+102});H.zoom.css("backgroundPosition","0px -18px");H.resizeZoom();H.onzoomin&&H.onzoomin.call(H);return H.cancelEvent(w)}};this.doZoomOut=function(w){if(H.zoomactive){return H.zoomactive=!1,H.win.css("margin",""),H.win.css(H.zoomrestore.style),C.isios4&&G(window).scrollTop(H.zoomrestore.scrollTop),H.rail.css({"z-index":H.zindex}),H.zoom.css({"z-index":H.zindex}),H.zoomrestore=!1,H.zoom.css("backgroundPosition","0px 0px"),H.onResize(),H.onzoomout&&H.onzoomout.call(H),H.cancelEvent(w)}};this.doZoom=function(w){return H.zoomactive?H.doZoomOut(w):H.doZoomIn(w)};this.resizeZoom=function(){if(H.zoomactive){var w=H.getScrollTop();H.win.css({width:G(window).width()-H.zoomrestore.padding.w+"px",height:G(window).height()-H.zoomrestore.padding.h+"px"});H.onResize();H.setScrollTop(Math.min(H.page.maxh,w))}};this.init();G.nicescroll.push(this)},h=function(s){var t=this;this.nc=s;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return +new Date};this.reset=function(w,v){t.stop();var x=t.time();t.steptime=0;t.lasttime=x;t.speedx=0;t.speedy=0;t.lastx=w;t.lasty=v;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(x,w){var B=t.time();t.steptime=B-t.lasttime;t.lasttime=B;var B=w-t.lasty,C=x-t.lastx,y=t.nc.getScrollTop(),v=t.nc.getScrollLeft(),y=y+B,v=v+C;t.snapx=0>v||v>t.nc.page.maxw;t.snapy=0>y||y>t.nc.page.maxh;t.speedx=C;t.speedy=B;t.lastx=x;t.lasty=w};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&clearTimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.doSnapy=function(w,v){var x=!1;0>v?(v=0,x=!0):v>t.nc.page.maxh&&(v=t.nc.page.maxh,x=!0);0>w?(w=0,x=!0):w>t.nc.page.maxw&&(w=t.nc.page.maxw,x=!0);x?t.nc.doScrollPos(w,v,t.nc.opt.snapbackspeed):t.nc.triggerScrollEnd()};this.doMomentum=function(B){var y=t.time(),D=B?y+B:t.lasttime;B=t.nc.getScrollLeft();var x=t.nc.getScrollTop(),w=t.nc.page.maxh,E=t.nc.page.maxw;t.speedx=0=y-D;if(0>x||x>w||0>B||B>E){D=!1}B=t.speedx&&D?t.speedx:!1;if(t.speedy&&D&&t.speedy||B){var H=Math.max(16,t.steptime);50C||C>E)&&(f=0.1);t.speedy&&(v=Math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=v,0>v||v>w)&&(f=0.1);t.demulxy=Math.min(1,t.demulxy+f);t.nc.synched("domomentum2d",function(){t.speedx&&(t.nc.getScrollLeft()!=t.chkx&&t.stop(),t.chkx=C,t.nc.setScrollLeft(C));t.speedy&&(t.nc.getScrollTop()!=t.chky&&t.stop(),t.chky=v,t.nc.setScrollTop(v));t.timer||(t.nc.hideCursor(),t.doSnapy(C,v))});1>t.demulxy?t.timer=setTimeout(F,H):(t.stop(),t.nc.hideCursor(),t.doSnapy(C,v))};F()}else{t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}}},l=G.fn.scrollTop;G.cssHooks.pageYOffset={get:function(f,t,s){return(t=G.data(f,"__nicescroll")||!1)&&t.ishwscroll?t.getScrollTop():l.call(f)},set:function(f,t){var s=G.data(f,"__nicescroll")||!1;s&&s.ishwscroll?s.setScrollTop(parseInt(t)):l.call(f,t);return this}};G.fn.scrollTop=function(f){if("undefined"==typeof f){var s=this[0]?G.data(this[0],"__nicescroll")||!1:!1;return s&&s.ishwscroll?s.getScrollTop():l.call(this)}return this.each(function(){var t=G.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollTop(parseInt(f)):l.call(G(this),f)})};var A=G.fn.scrollLeft;G.cssHooks.pageXOffset={get:function(f,t,s){return(t=G.data(f,"__nicescroll")||!1)&&t.ishwscroll?t.getScrollLeft():A.call(f)},set:function(f,t){var s=G.data(f,"__nicescroll")||!1;s&&s.ishwscroll?s.setScrollLeft(parseInt(t)):A.call(f,t);return this}};G.fn.scrollLeft=function(f){if("undefined"==typeof f){var s=this[0]?G.data(this[0],"__nicescroll")||!1:!1;return s&&s.ishwscroll?s.getScrollLeft():A.call(this)}return this.each(function(){var t=G.data(this,"__nicescroll")||!1;t&&t.ishwscroll?t.setScrollLeft(parseInt(f)):A.call(G(this),f)})};var z=function(s){var v=this;this.length=0;this.name="nicescrollarray";this.each=function(y){for(var x=0,w=0;x