/* nicescroll v3.7.3 inuyaksa - mit - https://nicescroll.areaaperta.com */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jquery)}(function(e){"use strict";var o=!1,t=!1,r=0,i=2e3,s=0,n=e,l=document,a=n(window),c=function(){return window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||!1}(),d=function(){return window.cancelanimationframe||window.webkitcancelanimationframe||window.mozcancelanimationframe||!1}();if(c)window.cancelanimationframe||(d=function(e){});else{var u=0;c=function(e,o){var t=(new date).gettime(),r=math.max(0,16-(t-u)),i=window.settimeout(function(){e(t+r)},r);return u=t+r,i},d=function(e){window.cleartimeout(e)}}var h=window.mutationobserver||window.webkitmutationobserver||!1,p=date.now||function(){return(new date).gettime()},m={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,emulatetouch:!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:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=l.currentscript||function(){var e=l.getelementsbytagname("script");return!!e.length&&e[e.length-1]}(),o=e?e.src.split("?")[0]:"";return o.split("/").length>0?o.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1},f=!1,g=function(){if(f)return f;var e=l.createelement("div"),o=e.style,t=navigator.useragent,r=navigator.platform,i={};return i.haspointerlock="pointerlockelement"in l||"webkitpointerlockelement"in l||"mozpointerlockelement"in l,i.isopera="opera"in window,i.isopera12=i.isopera&&"getusermedia"in navigator,i.isoperamini="[object operamini]"===object.prototype.tostring.call(window.operamini),i.isie="all"in l&&"attachevent"in e&&!i.isopera,i.isieold=i.isie&&!("msinterpolationmode"in o),i.isie7=i.isie&&!i.isieold&&(!("documentmode"in l)||7===l.documentmode),i.isie8=i.isie&&"documentmode"in l&&8===l.documentmode,i.isie9=i.isie&&"performance"in window&&9===l.documentmode,i.isie10=i.isie&&"performance"in window&&10===l.documentmode,i.isie11="msrequestfullscreen"in e&&l.documentmode>=11,i.ismsedge="mscredentials"in window,i.ismozilla="mozappearance"in o,i.iswebkit=!i.ismsedge&&"webkitappearance"in o,i.ischrome=i.iswebkit&&"chrome"in window,i.ischrome38=i.ischrome&&"touchaction"in o,i.ischrome22=!i.ischrome38&&i.ischrome&&i.haspointerlock,i.ischrome26=!i.ischrome38&&i.ischrome&&"transition"in o,i.cantouch="ontouchstart"in l.documentelement||"ontouchstart"in window,i.hasw3ctouch=(window.pointerevent||!1)&&(navigator.maxtouchpoints>0||navigator.msmaxtouchpoints>0),i.hasmstouch=!i.hasw3ctouch&&(window.mspointerevent||!1),i.ismac=/^mac$/i.test(r),i.isios=i.cantouch&&/iphone|ipad|ipod/i.test(r),i.isios4=i.isios&&!("seal"in object),i.isios7=i.isios&&"webkithidden"in l,i.isios8=i.isios&&"hidden"in l,i.isios10=i.isios&&window.proxy,i.isandroid=/android/i.test(t),i.haseventlistener="addeventlistener"in e,i.trstyle=!1,i.hastransform=!1,i.hastranslate3d=!1,i.transitionstyle=!1,i.hastransition=!1,i.transitionend=!1,i.trstyle="transform",i.hastransform="transform"in o||function(){for(var e=["mstransform","webkittransform","moztransform","otransform"],t=0,r=e.length;t0;){if(9==e[0].nodetype)return!1;var o=e.css("zindex");if(!isnan(o)&&0!=o)return parseint(o);e=e.parent()}return!1}function b(e,o,t){var r=e.css(o),i=parsefloat(r);if(isnan(i)){var s=3==(i=p[r]||0)?t?s.win.outerheight()-s.win.innerheight():s.win.outerwidth()-s.win.innerwidth():1;return s.isie8&&i&&(i+=1),s?i:0}return i}function y(e,o,t,r){s._bind(e,o,function(r){var i={original:r=r||window.event,target:r.target||r.srcelement,type:"wheel",deltamode:"mozmousepixelscroll"==r.type?0:1,deltax:0,deltaz:0,preventdefault:function(){return r.preventdefault?r.preventdefault():r.returnvalue=!1,!1},stopimmediatepropagation:function(){r.stopimmediatepropagation?r.stopimmediatepropagation():r.cancelbubble=!0}};return"mousewheel"==o?(r.wheeldeltax&&(i.deltax=-.025*r.wheeldeltax),r.wheeldeltay&&(i.deltay=-.025*r.wheeldeltay),!i.deltay&&!i.deltax&&(i.deltay=-.025*r.wheeldelta)):i.deltay=r.detail,t.call(e,i)},r)}function x(e,o,t){var r,i;if(0==e.deltamode?(r=-math.floor(e.deltax*(s.opt.mousescrollstep/54)),i=-math.floor(e.deltay*(s.opt.mousescrollstep/54))):1==e.deltamode&&(r=-math.floor(e.deltax*s.opt.mousescrollstep),i=-math.floor(e.deltay*s.opt.mousescrollstep)),o&&s.opt.oneaxismousemode&&0===r&&i&&(r=i,i=0,t&&(r<0?s.getscrollleft()>=s.page.maxw:s.getscrollleft()<=0)&&(i=r,r=0)),s.isrtlmode&&(r=-r),r){if(s.scrollmom)s.scrollmom.stop();else if(r<0){if(s.getscrollleft()>=s.page.maxw)return!0}else if(s.getscrollleft()<=0)return!0;s.lastdeltax+=r,s.debounced("mousewheelx",function(){var e=s.lastdeltax;s.lastdeltax=0,s.rail.drag||s.doscrollleftby(e)},15)}if(i){if(s.opt.nativeparentscrolling&&t&&!s.ispage&&!s.zoomactive)if(i<0){if(s.getscrolltop()>=s.page.maxh)return!0}else if(s.getscrolltop()<=0)return!0;s.scrollmom&&s.scrollmom.stop(),s.lastdeltay+=i,s.synched("mousewheely",function(){var e=s.lastdeltay;s.lastdeltay=0,s.rail.drag||s.doscrollby(e)},15)}return e.stopimmediatepropagation(),e.preventdefault()}var s=this;this.version="3.7.3",this.name="nicescroll",this.me=u;var z=n("body");if(this.opt={doc:z,win:!1},n.extend(this.opt,m),this.opt.snapbackspeed=80,e)for(var k in s.opt)void 0!==e[k]&&(s.opt[k]=e[k]);if(s.opt.disablemutationobserver&&(h=!1),this.doc=s.opt.doc,this.iddoc=this.doc&&this.doc[0]?this.doc[0].id||"":"",this.ispage=/^body|html/.test(s.opt.win?s.opt.win[0].nodename:this.doc[0].nodename),this.haswrapper=!1!==s.opt.win,this.win=s.opt.win||(this.ispage?a:this.doc),this.docscroll=this.ispage&&!this.haswrapper?a:this.win,this.body=z,this.viewport=!1,this.isfixed=!1,this.iframe=!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"!=s.opt.autohidemode,this.onmousedown=!1,this.onmouseup=!1,this.onmousemove=!1,this.onmousewheel=!1,this.onkeypress=!1,this.ongesturezoom=!1,this.onclick=!1,this.onscrollstart=!1,this.onscrollend=!1,this.onscrollcancel=!1,this.onzoomin=!1,this.onzoomout=!1,this.view=!1,this.page=!1,this.scroll={x:0,y:0},this.scrollratio={x:0,y:0},this.cursorheight=20,this.scrollvaluemax=0,"auto"==this.opt.rtlmode){var t=this.win[0]==window?this.body:this.win,m=t.css("writing-mode")||t.css("-webkit-writing-mode")||t.css("-ms-writing-mode")||t.css("-moz-writing-mode");"horizontal-tb"==m||"lr-tb"==m||""==m?(this.isrtlmode="rtl"==t.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==m||"tb"==m||"tb-rl"==m||"rl-tb"==m,this.isvertical="vertical-rl"==m||"tb"==m||"tb-rl"==m)}else this.isrtlmode=!0===this.opt.rtlmode,this.isvertical=!1;if(this.scrollrunning=!1,this.scrollmom=!1,this.observer=!1,this.observerremover=!1,this.observerbody=!1,!1===s.opt.scrollbarid)do{this.id="ascrail"+i++}while(l.getelementbyid(this.id));else this.id=s.opt.scrollbarid;this.rail=!1,this.cursor=!1,this.cursorfreezed=!1,this.selectiondrag=!1,this.zoom=!1,this.zoomactive=!1,this.hasfocus=!1,this.hasmousefocus=!1,this.visibility=!0,this.railslocked=!1,this.locked=!1,this.hidden=!1,this.cursoractive=!0,this.wheelprevented=!1,this.overflowx=s.opt.overflowx,this.overflowy=s.opt.overflowy,this.nativescrollingarea=!1,this.checkarea=0,this.events=[],this.saved={},this.delaylist={},this.synclist={},this.lastdeltax=0,this.lastdeltay=0,this.detected=g();var e=n.extend({},this.detected);this.canhwscroll=e.hastransform&&s.opt.hwacceleration,this.ishwscroll=this.canhwscroll&&s.haswrapper,this.isrtlmode?this.isvertical?this.hasreversehr=!(e.iswebkit||e.isie||e.isie11):this.hasreversehr=!(e.iswebkit||e.isie&&!e.isie10&&!e.isie11):this.hasreversehr=!1,this.istouchcapable=!1,e.cantouch||!e.hasw3ctouch&&!e.hasmstouch?!e.cantouch||e.isios||e.isandroid||!e.iswebkit&&!e.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0,s.opt.enablemouselockapi||(e.hasmousecapture=!1,e.haspointerlock=!1),this.debounced=function(e,o,t){s&&(s.delaylist[e]||!1||(s.delaylist[e]={h:c(function(){s.delaylist[e].fn.call(s),s.delaylist[e]=!1},t)},o.call(s)),s.delaylist[e].fn=o)};var l=!1;this.synched=function(e,o){return s.synclist[e]=o,function(){l||(c(function(){if(s){l=!1;for(var e in s.synclist){var o=s.synclist[e];o&&o.call(s),s.synclist[e]=!1}}}),l=!0)}(),e},this.unsynched=function(e){s.synclist[e]&&(s.synclist[e]=!1)},this.css=function(e,o){for(var t in o)s.saved.css.push([e,t,e.css(t)]),e.css(t,o[t])},this.scrolltop=function(e){return void 0===e?s.getscrolltop():s.setscrolltop(e)},this.scrollleft=function(e){return void 0===e?s.getscrollleft():s.setscrollleft(e)};var c=function(e,o,t,r,i,s,n){this.st=e,this.ed=o,this.spd=t,this.p1=r||0,this.p2=i||1,this.p3=s||0,this.p4=n||1,this.ts=p(),this.df=this.ed-this.st};if(c.prototype={b2:function(e){return 3*e*e*(1-e)},b3:function(e){return 3*e*(1-e)*(1-e)},b4:function(e){return(1-e)*(1-e)*(1-e)},getnow:function(){var e=1-(p()-this.ts)/this.spd,o=this.b2(e)+this.b3(e)+this.b4(e);return e<0?this.ed:this.st+math.round(this.df*o)},update:function(e,o){return this.st=this.getnow(),this.ed=e,this.spd=o,this.ts=p(),this.df=this.ed-this.st,this}},this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},e.hastranslate3d&&e.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getscrolltop=function(e){if(!e){var o=f();if(o)return 16==o.length?-o[13]:-o[5];if(s.timerscroll&&s.timerscroll.bz)return s.timerscroll.bz.getnow()}return s.doc.translate.y},this.getscrollleft=function(e){if(!e){var o=f();if(o)return 16==o.length?-o[12]:-o[4];if(s.timerscroll&&s.timerscroll.bh)return s.timerscroll.bh.getnow()}return s.doc.translate.x},this.notifyscrollevent=function(e){var o=l.createevent("uievents");o.inituievent("scroll",!1,!0,window,1),o.niceevent=!0,e.dispatchevent(o)};var n=this.isrtlmode?1:-1;e.hastranslate3d&&s.opt.enabletranslate3d?(this.setscrolltop=function(e,o){s.doc.translate.y=e,s.doc.translate.ty=-1*e+"px",s.doc.css(e.trstyle,"translate3d("+s.doc.translate.tx+","+s.doc.translate.ty+",0)"),o||s.notifyscrollevent(s.win[0])},this.setscrollleft=function(e,o){s.doc.translate.x=e,s.doc.translate.tx=e*n+"px",s.doc.css(e.trstyle,"translate3d("+s.doc.translate.tx+","+s.doc.translate.ty+",0)"),o||s.notifyscrollevent(s.win[0])}):(this.setscrolltop=function(e,o){s.doc.translate.y=e,s.doc.translate.ty=-1*e+"px",s.doc.css(e.trstyle,"translate("+s.doc.translate.tx+","+s.doc.translate.ty+")"),o||s.notifyscrollevent(s.win[0])},this.setscrollleft=function(e,o){s.doc.translate.x=e,s.doc.translate.tx=e*n+"px",s.doc.css(e.trstyle,"translate("+s.doc.translate.tx+","+s.doc.translate.ty+")"),o||s.notifyscrollevent(s.win[0])})}else this.getscrolltop=function(){return s.docscroll.scrolltop()},this.setscrolltop=function(e){return settimeout(function(){s&&s.docscroll.scrolltop(e)},1)},this.getscrollleft=function(){return s.hasreversehr?s.detected.ismozilla?s.page.maxw-math.abs(s.docscroll.scrollleft()):s.page.maxw-s.docscroll.scrollleft():s.docscroll.scrollleft()},this.setscrollleft=function(e){return settimeout(function(){if(s)return s.hasreversehr&&(e=s.detected.ismozilla?-(s.page.maxw-e):s.page.maxw-e),s.docscroll.scrollleft(e)},1)};this.gettarget=function(e){return!!e&&(e.target?e.target:!!e.srcelement&&e.srcelement)},this.hasparent=function(e,o){if(!e)return!1;for(var t=e.target||e.srcelement||e||!1;t&&t.id!=o;)t=t.parentnode||!1;return!1!==t};var p={thin:1,medium:3,thick:5};this.getdocumentscrolloffset=function(){return{top:window.pageyoffset||l.documentelement.scrolltop,left:window.pagexoffset||l.documentelement.scrollleft}},this.getoffset=function(){if(s.isfixed){var e=s.win.offset(),o=s.getdocumentscrolloffset();return e.top-=o.top,e.left-=o.left,e}var t=s.win.offset();if(!s.viewport)return t;var r=s.viewport.offset();return{top:t.top-r.top,left:t.left-r.left}},this.updatescrollbar=function(e){var o,t;if(s.ishwscroll)s.rail.css({height:s.win.innerheight()-(s.opt.railpadding.top+s.opt.railpadding.bottom)}),s.railh&&s.railh.css({width:s.win.innerwidth()-(s.opt.railpadding.left+s.opt.railpadding.right)});else{var r=s.getoffset();if(o={top:r.top,left:r.left-(s.opt.railpadding.left+s.opt.railpadding.right)},o.top+=b(s.win,"border-top-width",!0),o.left+=s.rail.align?s.win.outerwidth()-b(s.win,"border-right-width")-s.rail.width:b(s.win,"border-left-width"),(t=s.opt.railoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left)),s.railslocked||s.rail.css({top:o.top,left:o.left,height:(e?e.h:s.win.innerheight())-(s.opt.railpadding.top+s.opt.railpadding.bottom)}),s.zoom&&s.zoom.css({top:o.top+1,left:1==s.rail.align?o.left-20:o.left+s.rail.width+4}),s.railh&&!s.railslocked){o={top:r.top,left:r.left},(t=s.opt.railhoffset)&&(t.top&&(o.top+=t.top),t.left&&(o.left+=t.left));var i=s.railh.align?o.top+b(s.win,"border-top-width",!0)+s.win.innerheight()-s.railh.height:o.top+b(s.win,"border-top-width",!0),s=o.left+b(s.win,"border-left-width");s.railh.css({top:i-(s.opt.railpadding.top+s.opt.railpadding.bottom),left:s,width:s.railh.width})}}},this.dorailclick=function(e,o,t){var r,i,s,n;s.railslocked||(s.cancelevent(e),"pagey"in e||(e.pagex=e.clientx+l.documentelement.scrollleft,e.pagey=e.clienty+l.documentelement.scrolltop),o?(r=t?s.doscrollleft:s.doscrolltop)(s=t?(e.pagex-s.railh.offset().left-s.cursorwidth/2)*s.scrollratio.x:(e.pagey-s.rail.offset().top-s.cursorheight/2)*s.scrollratio.y):(r=t?s.doscrollleftby:s.doscrollby,s=t?s.scroll.x:s.scroll.y,n=t?e.pagex-s.railh.offset().left:e.pagey-s.rail.offset().top,i=t?s.view.w:s.view.h,r(s>=n?i:-i)))},s.hasanimationframe="requestanimationframe"in window,s.hascancelanimationframe="cancelanimationframe"in window,this.init=function(){if(s.saved.css=[],e.isoperamini)return!0;if(e.isandroid&&!("hidden"in l))return!0;s.opt.emulatetouch=s.opt.emulatetouch||s.opt.touchbehavior;var e={"overflow-y":"hidden"};if((e.isie11||e.isie10)&&(e["-ms-overflow-style"]="none"),s.zindex="auto",s.ispage||"auto"!=s.opt.zindex?s.zindex=s.opt.zindex:s.zindex=w()||"auto",!s.ispage&&"auto"!=s.zindex&&s.zindex>s&&(s=s.zindex),s.isie&&0==s.zindex&&"auto"==s.opt.zindex&&(s.zindex="auto"),!s.ispage||!e.cantouch&&!e.isieold){var i=s.docscroll;s.ispage&&(i=s.haswrapper?s.win:s.doc),s.css(i,e),s.ispage&&(e.isie11||e.isie)&&s.css(n("html"),e),!e.isios||s.ispage||s.haswrapper||s.css(z,{"-webkit-overflow-scrolling":"touch"});var c=n(l.createelement("div"));c.css({position:"relative",top:0,float:"right",width:s.opt.cursorwidth,height:0,"background-color":s.opt.cursorcolor,border:s.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":s.opt.cursorborderradius,"-moz-border-radius":s.opt.cursorborderradius,"border-radius":s.opt.cursorborderradius}),c.addclass("nicescroll-cursors"),s.cursor=c;var d=n(l.createelement("div"));d.attr("id",s.id),d.addclass("nicescroll-rails nicescroll-rails-vr");var u,p,m=["left","right","top","bottom"];for(var f in m)p=m[f],(u=s.opt.railpadding[p])?d.css("padding-"+p,u+"px"):s.opt.railpadding[p]=0;d.append(c),d.width=math.max(parsefloat(s.opt.cursorwidth),c.outerwidth()),d.css({width:d.width+"px",zindex:s.zindex,background:s.opt.background,cursor:"default"}),d.visibility=!0,d.scrollable=!0,d.align="left"==s.opt.railalign?0:1,s.rail=d,s.rail.drag=!1;var g=!1;!s.opt.boxzoom||s.ispage||e.isieold||(g=l.createelement("div"),s.bind(g,"click",s.dozoom),s.bind(g,"mouseenter",function(){s.zoom.css("opacity",s.opt.cursoropacitymax)}),s.bind(g,"mouseleave",function(){s.zoom.css("opacity",s.opt.cursoropacitymin)}),s.zoom=n(g),s.zoom.css({cursor:"pointer",zindex:s.zindex,backgroundimage:"url("+s.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundposition:"0 0"}),s.opt.dblclickzoom&&s.bind(s.win,"dblclick",s.dozoom),e.cantouch&&s.opt.gesturezoom&&(s.ongesturezoom=function(e){return e.scale>1.5&&s.dozoomin(e),e.scale<.8&&s.dozoomout(e),s.cancelevent(e)},s.bind(s.win,"gestureend",s.ongesturezoom))),s.railh=!1;var b;if(s.opt.horizrailenabled&&(s.css(i,{overflowx:"hidden"}),(c=n(l.createelement("div"))).css({position:"absolute",top:0,height:s.opt.cursorwidth,width:0,backgroundcolor:s.opt.cursorcolor,border:s.opt.cursorborder,backgroundclip:"padding-box","-webkit-border-radius":s.opt.cursorborderradius,"-moz-border-radius":s.opt.cursorborderradius,"border-radius":s.opt.cursorborderradius}),e.isieold&&c.css("overflow","hidden"),c.addclass("nicescroll-cursors"),s.cursorh=c,(b=n(l.createelement("div"))).attr("id",s.id+"-hr"),b.addclass("nicescroll-rails nicescroll-rails-hr"),b.height=math.max(parsefloat(s.opt.cursorwidth),c.outerheight()),b.css({height:b.height+"px",zindex:s.zindex,background:s.opt.background}),b.append(c),b.visibility=!0,b.scrollable=!0,b.align="top"==s.opt.railvalign?0:1,s.railh=b,s.railh.drag=!1),s.ispage)d.css({position:"fixed",top:0,height:"100%"}),d.align?d.css({right:0}):d.css({left:0}),s.body.append(d),s.railh&&(b.css({position:"fixed",left:0,width:"100%"}),b.align?b.css({bottom:0}):b.css({top:0}),s.body.append(b));else{if(s.ishwscroll){"static"==s.win.css("position")&&s.css(s.win,{position:"relative"});var y="html"==s.win[0].nodename?s.body:s.win;n(y).scrolltop(0).scrollleft(0),s.zoom&&(s.zoom.css({position:"absolute",top:1,right:0,"margin-right":d.width+4}),y.append(s.zoom)),d.css({position:"absolute",top:0}),d.align?d.css({right:0}):d.css({left:0}),y.append(d),b&&(b.css({position:"absolute",left:0,bottom:0}),b.align?b.css({bottom:0}):b.css({top:0}),y.append(b))}else{s.isfixed="fixed"==s.win.css("position");var x=s.isfixed?"fixed":"absolute";s.isfixed||(s.viewport=s.getviewport(s.win[0])),s.viewport&&(s.body=s.viewport,0==/fixed|absolute/.test(s.viewport.css("position"))&&s.css(s.viewport,{position:"relative"})),d.css({position:x}),s.zoom&&s.zoom.css({position:x}),s.updatescrollbar(),s.body.append(d),s.zoom&&s.body.append(s.zoom),s.railh&&(b.css({position:x}),s.body.append(b))}e.isios&&s.css(s.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),e.isie&&s.opt.disableoutline&&s.win.attr("hidefocus","true"),e.iswebkit&&s.opt.disableoutline&&s.win.css("outline","none")}if(!1===s.opt.autohidemode?(s.autohidedom=!1,s.rail.css({opacity:s.opt.cursoropacitymax}),s.railh&&s.railh.css({opacity:s.opt.cursoropacitymax})):!0===s.opt.autohidemode||"leave"===s.opt.autohidemode?(s.autohidedom=n().add(s.rail),e.isie8&&(s.autohidedom=s.autohidedom.add(s.cursor)),s.railh&&(s.autohidedom=s.autohidedom.add(s.railh)),s.railh&&e.isie8&&(s.autohidedom=s.autohidedom.add(s.cursorh))):"scroll"==s.opt.autohidemode?(s.autohidedom=n().add(s.rail),s.railh&&(s.autohidedom=s.autohidedom.add(s.railh))):"cursor"==s.opt.autohidemode?(s.autohidedom=n().add(s.cursor),s.railh&&(s.autohidedom=s.autohidedom.add(s.cursorh))):"hidden"==s.opt.autohidemode&&(s.autohidedom=!1,s.hide(),s.railslocked=!1),e.cantouch||s.istouchcapable||s.opt.emulatetouch||e.hasmstouch){s.scrollmom=new v(s),s.ontouchstart=function(e){if(e.pointertype&&2!=e.pointertype&&"touch"!=e.pointertype)return!1;if(s.hasmoving=!1,!s.railslocked){var o;if(e.hasmstouch)for(o=!!e.target&&e.target;o;){var t=n(o).getnicescroll();if(t.length>0&&t[0].me==s.me)break;if(t.length>0)return!1;if("div"==o.nodename&&o.id==s.id)break;o=!!o.parentnode&&o.parentnode}if(e.stoppropagation(),s.cancelscroll(),(o=s.gettarget(e))&&/input/i.test(o.nodename)&&/range/i.test(o.type))return s.stoppropagation(e);if(!("clientx"in e)&&"changedtouches"in e&&(e.clientx=e.changedtouches[0].clientx,e.clienty=e.changedtouches[0].clienty),s.forcescreen){var r=e;(e={original:e.original?e.original:e}).clientx=r.screenx,e.clienty=r.screeny}if(s.rail.drag={x:e.clientx,y:e.clienty,sx:s.scroll.x,sy:s.scroll.y,st:s.getscrolltop(),sl:s.getscrollleft(),pt:2,dl:!1,tg:o},s.ispage||!s.opt.directionlockdeadzone)s.rail.drag.dl="f";else{var i={w:a.width(),h:a.height()},s={w:math.max(l.body.scrollwidth,l.documentelement.scrollwidth),h:math.max(l.body.scrollheight,l.documentelement.scrollheight)},c=math.max(0,s.h-i.h),d=math.max(0,s.w-i.w);!s.rail.scrollable&&s.railh.scrollable?s.rail.drag.ck=c>0&&"v":s.rail.scrollable&&!s.railh.scrollable?s.rail.drag.ck=d>0&&"h":s.rail.drag.ck=!1,s.rail.drag.ck||(s.rail.drag.dl="f")}if(s.opt.emulatetouch&&s.isiframe&&e.isie){var u=s.win.position();s.rail.drag.x+=u.left,s.rail.drag.y+=u.top}if(s.hasmoving=!1,s.lastmouseup=!1,s.scrollmom.reset(e.clientx,e.clienty),!e.cantouch&&!this.istouchcapable&&!e.pointertype){if(!(!!o&&/input|select|button|textarea/i.test(o.nodename)))return!s.ispage&&e.hasmousecapture&&o.setcapture(),s.opt.emulatetouch?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){if(s.hasmoving)return!1;o._onclick.call(this,e)}),s.cancelevent(e)):s.stoppropagation(e);/submit|cancel|button/i.test(n(o).attr("type"))&&(s.preventclick={tg:o,click:!1})}}},s.ontouchend=function(e){if(!s.rail.drag)return!0;if(2==s.rail.drag.pt){if(e.pointertype&&2!=e.pointertype&&"touch"!=e.pointertype)return!1;if(s.rail.drag=!1,s.hasmoving&&(s.scrollmom.domomentum(),s.lastmouseup=!0,s.hidecursor(),e.hasmousecapture&&l.releasecapture(),!e.cantouch))return s.cancelevent(e)}else if(1==s.rail.drag.pt)return s.onmouseup(e)};var k=s.opt.emulatetouch&&s.isiframe&&!e.hasmousecapture;s.ontouchmove=function(e,o){if(!s.rail.drag)return!1;if(e.targettouches&&s.opt.preventmultitouchscrolling&&e.targettouches.length>1)return!1;if(e.pointertype&&2!=e.pointertype&&"touch"!=e.pointertype)return!1;if(2==s.rail.drag.pt){if("changedtouches"in e&&(e.clientx=e.changedtouches[0].clientx,e.clienty=e.changedtouches[0].clienty),s.rail.drag.y===e.clienty&&s.rail.drag.x===e.clientx)return!1;s.hasmoving||s.onscrollstart&&s.triggerscrollstart(e.clientx,e.clienty,0,0,0),s.hasmoving=!0,s.preventclick&&!s.preventclick.click&&(s.preventclick.click=s.preventclick.tg.onclick||!1,s.preventclick.tg.onclick=s.onpreventclick);var t,r;if(r=t=0,k&&!o){var i=s.win.position();r=-i.left,t=-i.top}var s=e.clienty+t,n=s-s.rail.drag.y,a=e.clientx+r,c=a-s.rail.drag.x,d=s.rail.drag.st-n;s.ishwscroll&&s.opt.bouncescroll?d<0?d=math.round(d/2):d>s.page.maxh&&(d=s.page.maxh+math.round((d-s.page.maxh)/2)):(d<0&&(d=0,s=0),d>s.page.maxh&&(d=s.page.maxh,s=0));var u;s.railh&&s.railh.scrollable&&(u=s.isrtlmode?c-s.rail.drag.sl:s.rail.drag.sl-c,s.ishwscroll&&s.opt.bouncescroll?u<0?u=math.round(u/2):u>s.page.maxw&&(u=s.page.maxw+math.round((u-s.page.maxw)/2)):(u<0&&(u=0,a=0),u>s.page.maxw&&(u=s.page.maxw,a=0)));var h=!1;if(s.rail.drag.dl)h=!0,"v"==s.rail.drag.dl?u=s.rail.drag.sl:"h"==s.rail.drag.dl&&(d=s.rail.drag.st);else{var p=math.abs(n),m=math.abs(c),f=s.opt.directionlockdeadzone;if("v"==s.rail.drag.ck){if(p>f&&m<=.3*p)return s.rail.drag=!1,!0;m>f&&(s.rail.drag.dl="f",z.scrolltop(z.scrolltop()))}else if("h"==s.rail.drag.ck){if(m>f&&p<=.3*m)return s.rail.drag=!1,!0;p>f&&(s.rail.drag.dl="f",z.scrollleft(z.scrollleft()))}}if(s.synched("touchmove",function(){s.rail.drag&&2==s.rail.drag.pt&&(s.preparetransition&&s.preparetransition(0),s.rail.scrollable&&s.setscrolltop(d),s.scrollmom.update(a,s),s.railh&&s.railh.scrollable?(s.setscrollleft(u),s.showcursor(d,u)):s.showcursor(d),e.isie10&&l.selection.clear())}),e.ischrome&&s.istouchcapable&&(h=!1),h)return s.cancelevent(e)}else if(1==s.rail.drag.pt)return s.onmousemove(e)},s.ontouchstartcursor=function(e,o){if(!s.rail.drag||3==s.rail.drag.pt){if(s.locked)return s.cancelevent(e);s.cancelscroll(),s.rail.drag={x:e.touches[0].clientx,y:e.touches[0].clienty,sx:s.scroll.x,sy:s.scroll.y,pt:3,hr:!!o};var t=s.gettarget(e);return!s.ispage&&e.hasmousecapture&&t.setcapture(),s.isiframe&&!e.hasmousecapture&&(s.saved.csspointerevents=s.doc.css("pointer-events"),s.css(s.doc,{"pointer-events":"none"})),s.cancelevent(e)}},s.ontouchendcursor=function(e){if(s.rail.drag){if(e.hasmousecapture&&l.releasecapture(),s.isiframe&&!e.hasmousecapture&&s.doc.css("pointer-events",s.saved.csspointerevents),3!=s.rail.drag.pt)return;return s.rail.drag=!1,s.cancelevent(e)}},s.ontouchmovecursor=function(e){if(s.rail.drag){if(3!=s.rail.drag.pt)return;if(s.cursorfreezed=!0,s.rail.drag.hr){s.scroll.x=s.rail.drag.sx+(e.touches[0].clientx-s.rail.drag.x),s.scroll.x<0&&(s.scroll.x=0);var o=s.scrollvaluemaxw;s.scroll.x>o&&(s.scroll.x=o)}else{s.scroll.y=s.rail.drag.sy+(e.touches[0].clienty-s.rail.drag.y),s.scroll.y<0&&(s.scroll.y=0);var t=s.scrollvaluemax;s.scroll.y>t&&(s.scroll.y=t)}return s.synched("touchmove",function(){s.rail.drag&&3==s.rail.drag.pt&&(s.showcursor(),s.rail.drag.hr?s.doscrollleft(math.round(s.scroll.x*s.scrollratio.x),s.opt.cursordragspeed):s.doscrolltop(math.round(s.scroll.y*s.scrollratio.y),s.opt.cursordragspeed))}),s.cancelevent(e)}}}if(s.onmousedown=function(e,o){if(!s.rail.drag||1==s.rail.drag.pt){if(s.railslocked)return s.cancelevent(e);s.cancelscroll(),s.rail.drag={x:e.clientx,y:e.clienty,sx:s.scroll.x,sy:s.scroll.y,pt:1,hr:o||!1};var t=s.gettarget(e);return!s.ispage&&e.hasmousecapture&&t.setcapture(),s.isiframe&&!e.hasmousecapture&&(s.saved.csspointerevents=s.doc.css("pointer-events"),s.css(s.doc,{"pointer-events":"none"})),s.hasmoving=!1,s.cancelevent(e)}},s.onmouseup=function(e){if(s.rail.drag)return 1!=s.rail.drag.pt||(e.hasmousecapture&&l.releasecapture(),s.isiframe&&!e.hasmousecapture&&s.doc.css("pointer-events",s.saved.csspointerevents),s.rail.drag=!1,s.hasmoving&&s.triggerscrollend(),s.cancelevent(e))},s.onmousemove=function(e){if(s.rail.drag){if(1!==s.rail.drag.pt)return;if(e.ischrome&&0===e.which)return s.onmouseup(e);if(s.cursorfreezed=!0,s.hasmoving=!0,s.rail.drag.hr){s.scroll.x=s.rail.drag.sx+(e.clientx-s.rail.drag.x),s.scroll.x<0&&(s.scroll.x=0);var o=s.scrollvaluemaxw;s.scroll.x>o&&(s.scroll.x=o)}else{s.scroll.y=s.rail.drag.sy+(e.clienty-s.rail.drag.y),s.scroll.y<0&&(s.scroll.y=0);var t=s.scrollvaluemax;s.scroll.y>t&&(s.scroll.y=t)}return s.synched("mousemove",function(){s.rail.drag&&1==s.rail.drag.pt&&(s.showcursor(),s.rail.drag.hr?s.hasreversehr?s.doscrollleft(s.scrollvaluemaxw-math.round(s.scroll.x*s.scrollratio.x),s.opt.cursordragspeed):s.doscrollleft(math.round(s.scroll.x*s.scrollratio.x),s.opt.cursordragspeed):s.doscrolltop(math.round(s.scroll.y*s.scrollratio.y),s.opt.cursordragspeed))}),s.cancelevent(e)}s.checkarea=0},e.cantouch||s.opt.emulatetouch)s.onpreventclick=function(e){if(s.preventclick)return s.preventclick.tg.onclick=s.preventclick.click,s.preventclick=!1,s.cancelevent(e)},s.onclick=!e.isios&&function(e){return!s.lastmouseup||(s.lastmouseup=!1,s.cancelevent(e))},s.opt.grabcursorenabled&&e.cursorgrabvalue&&(s.css(s.ispage?s.doc:s.win,{cursor:e.cursorgrabvalue}),s.css(s.rail,{cursor:e.cursorgrabvalue}));else{var t=function(e){if(s.selectiondrag){if(e){var o=s.win.outerheight(),t=e.pagey-s.selectiondrag.top;t>0&&t=o&&(t-=o),s.selectiondrag.df=t}if(0!=s.selectiondrag.df){var r=2*-math.floor(s.selectiondrag.df/6);s.doscrollby(r),s.debounced("doselectionscroll",function(){t()},50)}}};s.hastextselected="getselection"in l?function(){return l.getselection().rangecount>0}:"selection"in l?function(){return"none"!=l.selection.type}:function(){return!1},s.onselectionstart=function(e){s.ispage||(s.selectiondrag=s.win.offset())},s.onselectionend=function(e){s.selectiondrag=!1},s.onselectiondrag=function(e){s.selectiondrag&&s.hastextselected()&&s.debounced("selectionscroll",function(){t(e)},250)}}if(e.hasw3ctouch?(s.css(s.ispage?n("html"):s.win,{"touch-action":"none"}),s.css(s.rail,{"touch-action":"none"}),s.css(s.cursor,{"touch-action":"none"}),s.bind(s.win,"pointerdown",s.ontouchstart),s.bind(l,"pointerup",s.ontouchend),s.bind(l,"pointermove",s.ontouchmove)):e.hasmstouch?(s.css(s.ispage?n("html"):s.win,{"-ms-touch-action":"none"}),s.css(s.rail,{"-ms-touch-action":"none"}),s.css(s.cursor,{"-ms-touch-action":"none"}),s.bind(s.win,"mspointerdown",s.ontouchstart),s.bind(l,"mspointerup",s.ontouchend),s.bind(l,"mspointermove",s.ontouchmove),s.bind(s.cursor,"msgesturehold",function(e){e.preventdefault()}),s.bind(s.cursor,"contextmenu",function(e){e.preventdefault()})):e.cantouch&&(s.bind(s.win,"touchstart",s.ontouchstart,!1,!0),s.bind(l,"touchend",s.ontouchend,!1,!0),s.bind(l,"touchcancel",s.ontouchend,!1,!0),s.bind(l,"touchmove",s.ontouchmove,!1,!0)),s.opt.emulatetouch&&(s.bind(s.win,"mousedown",s.ontouchstart,!1,!0),s.bind(l,"mouseup",s.ontouchend,!1,!0),s.bind(l,"mousemove",s.ontouchmove,!1,!0)),(s.opt.cursordragontouch||!e.cantouch&&!s.opt.emulatetouch)&&(s.rail.css({cursor:"default"}),s.railh&&s.railh.css({cursor:"default"}),s.jqbind(s.rail,"mouseenter",function(){if(!s.ispage&&!s.win.is(":visible"))return!1;s.canshowonmouseevent&&s.showcursor(),s.rail.active=!0}),s.jqbind(s.rail,"mouseleave",function(){s.rail.active=!1,s.rail.drag||s.hidecursor()}),s.opt.sensitiverail&&(s.bind(s.rail,"click",function(e){s.dorailclick(e,!1,!1)}),s.bind(s.rail,"dblclick",function(e){s.dorailclick(e,!0,!1)}),s.bind(s.cursor,"click",function(e){s.cancelevent(e)}),s.bind(s.cursor,"dblclick",function(e){s.cancelevent(e)})),s.railh&&(s.jqbind(s.railh,"mouseenter",function(){if(!s.ispage&&!s.win.is(":visible"))return!1;s.canshowonmouseevent&&s.showcursor(),s.rail.active=!0}),s.jqbind(s.railh,"mouseleave",function(){s.rail.active=!1,s.rail.drag||s.hidecursor()}),s.opt.sensitiverail&&(s.bind(s.railh,"click",function(e){s.dorailclick(e,!1,!0)}),s.bind(s.railh,"dblclick",function(e){s.dorailclick(e,!0,!0)}),s.bind(s.cursorh,"click",function(e){s.cancelevent(e)}),s.bind(s.cursorh,"dblclick",function(e){s.cancelevent(e)})))),s.opt.cursordragontouch&&(this.istouchcapable||e.cantouch)&&(s.bind(s.cursor,"touchstart",s.ontouchstartcursor),s.bind(s.cursor,"touchmove",s.ontouchmovecursor),s.bind(s.cursor,"touchend",s.ontouchendcursor),s.cursorh&&s.bind(s.cursorh,"touchstart",function(e){s.ontouchstartcursor(e,!0)}),s.cursorh&&s.bind(s.cursorh,"touchmove",s.ontouchmovecursor),s.cursorh&&s.bind(s.cursorh,"touchend",s.ontouchendcursor)),e.cantouch||s.opt.emulatetouch?(s.bind(e.hasmousecapture?s.win:l,"mouseup",s.ontouchend),s.onclick&&s.bind(l,"click",s.onclick),s.opt.cursordragontouch?(s.bind(s.cursor,"mousedown",s.onmousedown),s.bind(s.cursor,"mouseup",s.onmouseup),s.cursorh&&s.bind(s.cursorh,"mousedown",function(e){s.onmousedown(e,!0)}),s.cursorh&&s.bind(s.cursorh,"mouseup",s.onmouseup)):(s.bind(s.rail,"mousedown",function(e){e.preventdefault()}),s.railh&&s.bind(s.railh,"mousedown",function(e){e.preventdefault()}))):(s.bind(e.hasmousecapture?s.win:l,"mouseup",s.onmouseup),s.bind(l,"mousemove",s.onmousemove),s.onclick&&s.bind(l,"click",s.onclick),s.bind(s.cursor,"mousedown",s.onmousedown),s.bind(s.cursor,"mouseup",s.onmouseup),s.railh&&(s.bind(s.cursorh,"mousedown",function(e){s.onmousedown(e,!0)}),s.bind(s.cursorh,"mouseup",s.onmouseup)),!s.ispage&&s.opt.enablescrollonselection&&(s.bind(s.win[0],"mousedown",s.onselectionstart),s.bind(l,"mouseup",s.onselectionend),s.bind(s.cursor,"mouseup",s.onselectionend),s.cursorh&&s.bind(s.cursorh,"mouseup",s.onselectionend),s.bind(l,"mousemove",s.onselectiondrag)),s.zoom&&(s.jqbind(s.zoom,"mouseenter",function(){s.canshowonmouseevent&&s.showcursor(),s.rail.active=!0}),s.jqbind(s.zoom,"mouseleave",function(){s.rail.active=!1,s.rail.drag||s.hidecursor()}))),s.opt.enablemousewheel&&(s.isiframe||s.mousewheel(e.isie&&s.ispage?l:s.win,s.onmousewheel),s.mousewheel(s.rail,s.onmousewheel),s.railh&&s.mousewheel(s.railh,s.onmousewheelhr)),s.ispage||e.cantouch||/html|^body/.test(s.win[0].nodename)||(s.win.attr("tabindex")||s.win.attr({tabindex:++r}),s.bind(s.win,"focus",function(e){o=s.gettarget(e).id||!0,s.hasfocus=!0,s.canshowonmouseevent&&s.noticecursor()}),s.bind(s.win,"blur",function(e){o=!1,s.hasfocus=!1}),s.bind(s.win,"mouseenter",function(e){t=s.gettarget(e).id||!0,s.hasmousefocus=!0,s.canshowonmouseevent&&s.noticecursor()}),s.bind(s.win,"mouseleave",function(e){t=!1,s.hasmousefocus=!1,s.rail.drag||s.hidecursor()})),s.onkeypress=function(e){if(s.railslocked&&0==s.page.maxh)return!0;e=e||window.e;var r=s.gettarget(e);if(r&&/input|textarea|select|option/.test(r.nodename)&&(!(r.getattribute("type")||r.type||!1)||!/submit|button|cancel/i.tp))return!0;if(n(r).attr("contenteditable"))return!0;if(s.hasfocus||s.hasmousefocus&&!o||s.ispage&&!o&&!t){var i=e.keycode;if(s.railslocked&&27!=i)return s.cancelevent(e);var s=e.ctrlkey||!1,l=e.shiftkey||!1,a=!1;switch(i){case 38:case 63233:s.doscrollby(72),a=!0;break;case 40:case 63235:s.doscrollby(-72),a=!0;break;case 37:case 63232:s.railh&&(s?s.doscrollleft(0):s.doscrollleftby(72),a=!0);break;case 39:case 63234:s.railh&&(s?s.doscrollleft(s.page.maxw):s.doscrollleftby(-72),a=!0);break;case 33:case 63276:s.doscrollby(s.view.h),a=!0;break;case 34:case 63277:s.doscrollby(-s.view.h),a=!0;break;case 36:case 63273:s.railh&&s?s.doscrollpos(0,0):s.doscrollto(0),a=!0;break;case 35:case 63275:s.railh&&s?s.doscrollpos(s.page.maxw,s.page.maxh):s.doscrollto(s.page.maxh),a=!0;break;case 32:s.opt.spacebarenabled&&(l?s.doscrollby(s.view.h):s.doscrollby(-s.view.h),a=!0);break;case 27:s.zoomactive&&(s.dozoom(),a=!0)}if(a)return s.cancelevent(e)}},s.opt.enablekeyboard&&s.bind(l,e.isopera&&!e.isopera12?"keypress":"keydown",s.onkeypress),s.bind(l,"keydown",function(e){(e.ctrlkey||!1)&&(s.wheelprevented=!0)}),s.bind(l,"keyup",function(e){e.ctrlkey||!1||(s.wheelprevented=!1)}),s.bind(window,"blur",function(e){s.wheelprevented=!1}),s.bind(window,"resize",s.lazyresize),s.bind(window,"orientationchange",s.lazyresize),s.bind(window,"load",s.lazyresize),e.ischrome&&!s.ispage&&!s.haswrapper){var m=s.win.attr("style"),l=parsefloat(s.win.css("width"))+1;s.win.css("width",l),s.synched("chromefix",function(){s.win.attr("style",m)})}s.onattributechange=function(e){s.lazyresize(s.isieold?250:30)},s.opt.enableobserver&&(s.isie11||!1===h||(s.observerbody=new h(function(e){if(e.foreach(function(e){if("attributes"==e.type)return z.hasclass("modal-open")&&z.hasclass("modal-dialog")&&!n.contains(n(".modal-dialog")[0],s.doc[0])?s.hide():s.show()}),s.me.clientwidth!=s.page.width||s.me.clientheight!=s.page.height)return s.lazyresize(30)}),s.observerbody.observe(l.body,{childlist:!0,subtree:!0,characterdata:!1,attributes:!0,attributefilter:["class"]})),s.ispage||s.haswrapper||(!1!==h?(s.observer=new h(function(e){e.foreach(s.onattributechange)}),s.observer.observe(s.win[0],{childlist:!0,characterdata:!1,attributes:!0,subtree:!1}),s.observerremover=new h(function(e){e.foreach(function(e){if(e.removednodes.length>0)for(var o in e.removednodes)if(s&&e.removednodes[o]==s.win[0])return s.remove()})}),s.observerremover.observe(s.win[0].parentnode,{childlist:!0,characterdata:!1,attributes:!1,subtree:!1})):(s.bind(s.win,e.isie&&!e.isie9?"propertychange":"domattrmodified",s.onattributechange),e.isie9&&s.win[0].attachevent("onpropertychange",s.onattributechange),s.bind(s.win,"domnoderemoved",function(e){e.target==s.win[0]&&s.remove()})))),!s.ispage&&s.opt.boxzoom&&s.bind(window,"resize",s.resizezoom),s.istextarea&&(s.bind(s.win,"keydown",s.lazyresize),s.bind(s.win,"mouseup",s.lazyresize)),s.lazyresize(30)}if("iframe"==this.doc[0].nodename){var c=function(){s.iframexd=!1;var o;try{(o="contentdocument"in this?this.contentdocument:this.contentwindow._doc).domain}catch(e){s.iframexd=!0,o=!1}if(s.iframexd)return"console"in window&&console.log("nicescroll error: policy restriced iframe"),!0;if(s.forcescreen=!0,s.isiframe&&(s.iframe={doc:n(o),html:s.doc.contents().find("html")[0],body:s.doc.contents().find("body")[0]},s.getcontentsize=function(){return{w:math.max(s.iframe.html.scrollwidth,s.iframe.body.scrollwidth),h:math.max(s.iframe.html.scrollheight,s.iframe.body.scrollheight)}},s.docscroll=n(s.iframe.body)),!e.isios&&s.opt.iframeautoresize&&!s.isiframe){s.win.scrolltop(0),s.doc.height("");var t=math.max(o.getelementsbytagname("html")[0].scrollheight,o.body.scrollheight);s.doc.height(t)}s.lazyresize(30),s.css(n(s.iframe.body),e),e.isios&&s.haswrapper&&s.css(n(o.body),{"-webkit-transform":"translate3d(0,0,0)"}),"contentwindow"in this?s.bind(this.contentwindow,"scroll",s.onscroll):s.bind(o,"scroll",s.onscroll),s.opt.enablemousewheel&&s.mousewheel(o,s.onmousewheel),s.opt.enablekeyboard&&s.bind(o,e.isopera?"keypress":"keydown",s.onkeypress),e.cantouch?(s.bind(o,"touchstart",s.ontouchstart),s.bind(o,"touchmove",s.ontouchmove)):s.opt.emulatetouch&&(s.bind(o,"mousedown",s.ontouchstart),s.bind(o,"mousemove",function(e){return s.ontouchmove(e,!0)}),s.opt.grabcursorenabled&&e.cursorgrabvalue&&s.css(n(o.body),{cursor:e.cursorgrabvalue})),s.bind(o,"mouseup",s.ontouchend),s.zoom&&(s.opt.dblclickzoom&&s.bind(o,"dblclick",s.dozoom),s.ongesturezoom&&s.bind(o,"gestureend",s.ongesturezoom))};this.doc[0].readystate&&"complete"==this.doc[0].readystate&&settimeout(function(){c.call(s.doc[0],!1)},500),s.bind(this.doc,"load",c)}},this.showcursor=function(e,o){if(s.cursortimeout&&(cleartimeout(s.cursortimeout),s.cursortimeout=0),s.rail){if(s.autohidedom&&(s.autohidedom.stop().css({opacity:s.opt.cursoropacitymax}),s.cursoractive=!0),s.rail.drag&&1==s.rail.drag.pt||(void 0!==e&&!1!==e&&(s.scroll.y=math.round(1*e/s.scrollratio.y)),void 0!==o&&(s.scroll.x=math.round(1*o/s.scrollratio.x))),s.cursor.css({height:s.cursorheight,top:s.scroll.y}),s.cursorh){var t=s.hasreversehr?s.scrollvaluemaxw-s.scroll.x:s.scroll.x;!s.rail.align&&s.rail.visibility?s.cursorh.css({width:s.cursorwidth,left:t+s.rail.width}):s.cursorh.css({width:s.cursorwidth,left:t}),s.cursoractive=!0}s.zoom&&s.zoom.stop().css({opacity:s.opt.cursoropacitymax})}},this.hidecursor=function(e){s.cursortimeout||s.rail&&s.autohidedom&&(s.hasmousefocus&&"leave"==s.opt.autohidemode||(s.cursortimeout=settimeout(function(){s.rail.active&&s.showonmouseevent||(s.autohidedom.stop().animate({opacity:s.opt.cursoropacitymin}),s.zoom&&s.zoom.stop().animate({opacity:s.opt.cursoropacitymin}),s.cursoractive=!1),s.cursortimeout=0},e||s.opt.hidecursordelay)))},this.noticecursor=function(e,o,t){s.showcursor(o,t),s.rail.active||s.hidecursor(e)},this.getcontentsize=s.ispage?function(){return{w:math.max(l.body.scrollwidth,l.documentelement.scrollwidth),h:math.max(l.body.scrollheight,l.documentelement.scrollheight)}}:s.haswrapper?function(){return{w:s.doc[0].offsetwidth,h:s.doc[0].offsetheight}}:function(){return{w:s.docscroll[0].scrollwidth,h:s.docscroll[0].scrollheight}},this.onresize=function(e,o){if(!s||!s.win)return!1;if(!s.haswrapper&&!s.ispage){if("none"==s.win.css("display"))return s.visibility&&s.hiderail().hiderailhr(),!1;s.hidden||s.visibility||s.showrail().showrailhr()}var t=s.page.maxh,r=s.page.maxw,i={h:s.view.h,w:s.view.w};if(s.view={w:s.ispage?s.win.width():s.win[0].clientwidth,h:s.ispage?s.win.height():s.win[0].clientheight},s.page=o||s.getcontentsize(),s.page.maxh=math.max(0,s.page.h-s.view.h),s.page.maxw=math.max(0,s.page.w-s.view.w),s.page.maxh==t&&s.page.maxw==r&&s.view.w==i.w&&s.view.h==i.h){if(s.ispage)return s;var s=s.win.offset();if(s.lastposition){var n=s.lastposition;if(n.top==s.top&&n.left==s.left)return s}s.lastposition=s}return 0===s.page.maxh?(s.hiderail(),s.scrollvaluemax=0,s.scroll.y=0,s.scrollratio.y=0,s.cursorheight=0,s.setscrolltop(0),s.rail&&(s.rail.scrollable=!1)):(s.page.maxh-=s.opt.railpadding.top+s.opt.railpadding.bottom,s.rail.scrollable=!0),0===s.page.maxw?(s.hiderailhr(),s.scrollvaluemaxw=0,s.scroll.x=0,s.scrollratio.x=0,s.cursorwidth=0,s.setscrollleft(0),s.railh&&(s.railh.scrollable=!1)):(s.page.maxw-=s.opt.railpadding.left+s.opt.railpadding.right,s.railh&&(s.railh.scrollable=s.opt.horizrailenabled)),s.railslocked=s.locked||0===s.page.maxh&&0===s.page.maxw,s.railslocked?(s.ispage||s.updatescrollbar(s.view),!1):(s.hidden||s.visibility?!s.railh||s.hidden||s.railh.visibility||s.showrailhr():s.showrail().showrailhr(),s.istextarea&&s.win.css("resize")&&"none"!=s.win.css("resize")&&(s.view.h-=20),s.cursorheight=math.min(s.view.h,math.round(s.view.h*(s.view.h/s.page.h))),s.cursorheight=s.opt.cursorfixedheight?s.opt.cursorfixedheight:math.max(s.opt.cursorminheight,s.cursorheight),s.cursorwidth=math.min(s.view.w,math.round(s.view.w*(s.view.w/s.page.w))),s.cursorwidth=s.opt.cursorfixedheight?s.opt.cursorfixedheight:math.max(s.opt.cursorminheight,s.cursorwidth),s.scrollvaluemax=s.view.h-s.cursorheight-(s.opt.railpadding.top+s.opt.railpadding.bottom),s.railh&&(s.railh.width=s.page.maxh>0?s.view.w-s.rail.width:s.view.w,s.scrollvaluemaxw=s.railh.width-s.cursorwidth-(s.opt.railpadding.left+s.opt.railpadding.right)),s.ispage||s.updatescrollbar(s.view),s.scrollratio={x:s.page.maxw/s.scrollvaluemaxw,y:s.page.maxh/s.scrollvaluemax},s.getscrolltop()>s.page.maxh?s.doscrolltop(s.page.maxh):(s.scroll.y=math.round(s.getscrolltop()*(1/s.scrollratio.y)),s.scroll.x=math.round(s.getscrollleft()*(1/s.scrollratio.x)),s.cursoractive&&s.noticecursor()),s.scroll.y&&0==s.getscrolltop()&&s.doscrollto(math.floor(s.scroll.y*s.scrollratio.y)),s)},this.resize=s.onresize,this.hlazyresize=0,this.lazyresize=function(e){return s.haswrapper||s.hide(),s.hlazyresize&&cleartimeout(s.hlazyresize),s.hlazyresize=settimeout(function(){s&&(s.resize(),s.show())},240),s},this.jqbind=function(e,o,t){s.events.push({e:e,n:o,f:t,q:!0}),n(e).bind(o,t)},this.mousewheel=function(e,o,t){var r="jquery"in e?e[0]:e;if("onwheel"in l.createelement("div"))s._bind(r,"wheel",o,t||!1);else{var i=void 0!==l.onmousewheel?"mousewheel":"dommousescroll";y(r,i,o,t||!1),"dommousescroll"==i&&y(r,"mozmousepixelscroll",o,t||!1)}};var r=!1;if(e.haseventlistener){try{var h=object.defineproperty({},"passive",{get:function(){r=!0}});window.addeventlistener("test",null,h)}catch(e){}this.cancelevent=function(e){return!!e&&((e=e.original?e.original:e).cancelable&&e.preventdefault(),e.stoppropagation(),e.preventmanipulation&&e.preventmanipulation(),!1)},this.stoppropagation=function(e){return!!e&&((e=e.original?e.original:e).stoppropagation(),!1)}}else event.prototype.preventdefault=function(){this.returnvalue=!1},event.prototype.stoppropagation=function(){this.cancelbubble=!0},window.constructor.prototype.addeventlistener=l.constructor.prototype.addeventlistener=element.prototype.addeventlistener=function(e,o,t){this.attachevent("on"+e,o)},window.constructor.prototype.removeeventlistener=l.constructor.prototype.removeeventlistener=element.prototype.removeeventlistener=function(e,o,t){this.detachevent("on"+e,o)},this.cancelevent=function(e){return!!(e=window.event||!1)&&(e.cancelbubble=!0,e.cancel=!0,e.returnvalue=!1,!1)},this.stoppropagation=function(e){return!!(e=window.event||!1)&&(e.cancelbubble=!0,!1)};this.bind=function(e,o,t,r,i){var s="jquery"in e?e[0]:e;s._bind(s,o,t,r||!1,i||!1)},this._bind=function(e,o,t,r,i){s.events.push({e:e,n:o,f:t,b:r,q:!1}),r&&i?e.addeventlistener(o,t,{passive:!1,capture:r}):e.addeventlistener(o,t,r||!1)},this._unbind=function(e,o,t,r){e.removeeventlistener(o,t,r)},this.unbindall=function(){for(var e=0;e0)return t;o=!!o.parentnode&&o.parentnode}return!1},this.triggerscrollstart=function(e,o,t,r,i){var s={type:"scrollstart",current:{x:e,y:o},request:{x:t,y:r},end:{x:s.newscrollx,y:s.newscrolly},speed:i};s.onscrollstart.call(s,s)},this.triggerscrollend=function(){if(s.onscrollend){var e=s.getscrollleft(),o=s.getscrolltop(),t={type:"scrollend",current:{x:e,y:o},end:{x:e,y:o}};s.onscrollend.call(s,t)}},this.onmousewheel=function(e){if(!s.wheelprevented){if(s.railslocked)return s.debounced("checkunlock",s.resize,250),!0;if(s.rail.drag)return s.cancelevent(e);if("auto"===s.opt.oneaxismousemode&&0!==e.deltax&&(s.opt.oneaxismousemode=!1),s.opt.oneaxismousemode&&0===e.deltax&&!s.rail.scrollable)return!s.railh||!s.railh.scrollable||s.onmousewheelhr(e);var o=p(),t=!1;if(s.opt.preservenativescrolling&&s.checkarea+60020?t:0},s.opt.smoothscroll?s.ishwscroll&&e.hastransition&&s.opt.usetransition&&s.opt.smoothscroll?(this.preparetransition=function(e,o){var t=o?e>20?e:0:s.gettransitionspeed(e),r=t?e.prefixstyle+"transform "+t+"ms ease-out":"";return s.lasttransitionstyle&&s.lasttransitionstyle==r||(s.lasttransitionstyle=r,s.doc.css(e.transitionstyle,r)),t},this.doscrollleft=function(e,o){var t=s.scrollrunning?s.newscrolly:s.getscrolltop();s.doscrollpos(e,t,o)},this.doscrolltop=function(e,o){var t=s.scrollrunning?s.newscrollx:s.getscrollleft();s.doscrollpos(t,e,o)},this.doscrollpos=function(e,o,t){var r=s.getscrolltop(),i=s.getscrollleft();return((s.newscrolly-r)*(o-r)<0||(s.newscrollx-i)*(e-i)<0)&&s.cancelscroll(),0==s.opt.bouncescroll&&(o<0?o=0:o>s.page.maxh&&(o=s.page.maxh),e<0?e=0:e>s.page.maxw&&(e=s.page.maxw)),(!s.scrollrunning||e!=s.newscrollx||o!=s.newscrolly)&&(s.newscrolly=o,s.newscrollx=e,s.newscrollspeed=t||!1,!s.timer&&void(s.timer=settimeout(function(){var t=s.getscrolltop(),r=s.getscrollleft(),i={};i.x=e-r,i.y=o-t,i.px=r,i.py=t;var s=math.round(math.sqrt(math.pow(i.x,2)+math.pow(i.y,2))),n=s.newscrollspeed&&s.newscrollspeed>1?s.newscrollspeed:s.gettransitionspeed(s);if(s.newscrollspeed&&s.newscrollspeed<=1&&(n*=s.newscrollspeed),s.preparetransition(n,!0),s.timerscroll&&s.timerscroll.tm&&clearinterval(s.timerscroll.tm),n>0){!s.scrollrunning&&s.onscrollstart&&s.triggerscrollstart(r,t,e,o,n),e.transitionend?s.scrollendtrapped||(s.scrollendtrapped=!0,s.bind(s.doc,e.transitionend,s.onscrolltransitionend,!1)):(s.scrollendtrapped&&cleartimeout(s.scrollendtrapped),s.scrollendtrapped=settimeout(s.onscrolltransitionend,n));var l=t,a=r;s.timerscroll={bz:new c(l,s.newscrolly,n,0,0,.58,1),bh:new c(a,s.newscrollx,n,0,0,.58,1)},s.cursorfreezed||(s.timerscroll.tm=setinterval(function(){s.showcursor(s.getscrolltop(),s.getscrollleft())},60))}s.synched("doscroll-set",function(){s.timer=0,s.scrollendtrapped&&(s.scrollrunning=!0),s.setscrolltop(s.newscrolly),s.setscrollleft(s.newscrollx),s.scrollendtrapped||s.onscrolltransitionend()})},50)))},this.cancelscroll=function(){if(!s.scrollendtrapped)return!0;var e=s.getscrolltop(),o=s.getscrollleft();return s.scrollrunning=!1,e.transitionend||cleartimeout(e.transitionend),s.scrollendtrapped=!1,s._unbind(s.doc[0],e.transitionend,s.onscrolltransitionend),s.preparetransition(0),s.setscrolltop(e),s.railh&&s.setscrollleft(o),s.timerscroll&&s.timerscroll.tm&&clearinterval(s.timerscroll.tm),s.timerscroll=!1,s.cursorfreezed=!1,s.showcursor(e,o),s},this.onscrolltransitionend=function(){s.scrollendtrapped&&s._unbind(s.doc[0],e.transitionend,s.onscrolltransitionend),s.scrollendtrapped=!1,s.preparetransition(0),s.timerscroll&&s.timerscroll.tm&&clearinterval(s.timerscroll.tm),s.timerscroll=!1;var e=s.getscrolltop(),o=s.getscrollleft();if(s.setscrolltop(e),s.railh&&s.setscrollleft(o),s.noticecursor(!1,e,o),s.cursorfreezed=!1,e<0?e=0:e>s.page.maxh&&(e=s.page.maxh),o<0?o=0:o>s.page.maxw&&(o=s.page.maxw),e!=s.newscrolly||o!=s.newscrollx)return s.doscrollpos(o,e,s.opt.snapbackspeed);s.onscrollend&&s.scrollrunning&&s.triggerscrollend(),s.scrollrunning=!1}):(this.doscrollleft=function(e,o){var t=s.scrollrunning?s.newscrolly:s.getscrolltop();s.doscrollpos(e,t,o)},this.doscrolltop=function(e,o){var t=s.scrollrunning?s.newscrollx:s.getscrollleft();s.doscrollpos(t,e,o)},this.doscrollpos=function(e,o,t){function r(){if(s.cancelanimationframe)return!0;if(s.scrollrunning=!0,h=1-h)return s.timer=c(r)||1;var e,o,t=0,i=o=s.getscrolltop();s.dst.ay?(((n=(i=s.bzscroll?s.dst.py+s.bzscroll.getnow()*s.dst.ay:s.newscrolly)-o)<0&&i0&&i>s.newscrolly)&&(i=s.newscrolly),s.setscrolltop(i),i==s.newscrolly&&(t=1)):t=1;var s=e=s.getscrollleft();if(s.dst.ax){var n=(s=s.bzscroll?s.dst.px+s.bzscroll.getnow()*s.dst.ax:s.newscrollx)-e;(n<0&&s0&&s>s.newscrollx)&&(s=s.newscrollx),s.setscrollleft(s),s==s.newscrollx&&(t+=1)}else t+=1;2==t?(s.timer=0,s.cursorfreezed=!1,s.bzscroll=!1,s.scrollrunning=!1,i<0?i=0:i>s.page.maxh&&(i=math.max(0,s.page.maxh)),s<0?s=0:s>s.page.maxw&&(s=s.page.maxw),s!=s.newscrollx||i!=s.newscrolly?s.doscrollpos(s,i):s.onscrollend&&s.triggerscrollend()):s.timer=c(r)||1}var o=void 0===o||!1===o?s.getscrolltop(!0):o;if(s.timer&&s.newscrolly==o&&s.newscrollx==e)return!0;s.timer&&d(s.timer),s.timer=0;var i=s.getscrolltop(),s=s.getscrollleft();((s.newscrolly-i)*(o-i)<0||(s.newscrollx-s)*(e-s)<0)&&s.cancelscroll(),s.newscrolly=o,s.newscrollx=e,s.bouncescroll&&s.rail.visibility||(s.newscrolly<0?s.newscrolly=0:s.newscrolly>s.page.maxh&&(s.newscrolly=s.page.maxh)),s.bouncescroll&&s.railh.visibility||(s.newscrollx<0?s.newscrollx=0:s.newscrollx>s.page.maxw&&(s.newscrollx=s.page.maxw)),s.dst={},s.dst.x=e-s,s.dst.y=o-i,s.dst.px=s,s.dst.py=i;var n=math.round(math.sqrt(math.pow(s.dst.x,2)+math.pow(s.dst.y,2)));s.dst.ax=s.dst.x/n,s.dst.ay=s.dst.y/n;var l=0,a=n;0==s.dst.x?(l=i,a=o,s.dst.ay=1,s.dst.py=0):0==s.dst.y&&(l=s,a=e,s.dst.ax=1,s.dst.px=0);var u=s.gettransitionspeed(n);if(t&&t<=1&&(u*=t),s.bzscroll=u>0&&(s.bzscroll?s.bzscroll.update(a,u):new c(l,a,u,0,1,0,1)),!s.timer){(i==s.page.maxh&&o>=s.page.maxh||s==s.page.maxw&&e>=s.page.maxw)&&s.checkcontentsize();var h=1;s.cancelanimationframe=!1,s.timer=1,s.onscrollstart&&!s.scrollrunning&&s.triggerscrollstart(s,i,e,o,u),r(),(i==s.page.maxh&&o>=i||s==s.page.maxw&&e>=s)&&s.checkcontentsize(),s.noticecursor()}},this.cancelscroll=function(){return s.timer&&d(s.timer),s.timer=0,s.bzscroll=!1,s.scrollrunning=!1,s}):(this.doscrollleft=function(e,o){var t=s.getscrolltop();s.doscrollpos(e,t,o)},this.doscrolltop=function(e,o){var t=s.getscrollleft();s.doscrollpos(t,e,o)},this.doscrollpos=function(e,o,t){var r=e>s.page.maxw?s.page.maxw:e;r<0&&(r=0);var i=o>s.page.maxh?s.page.maxh:o;i<0&&(i=0),s.synched("scroll",function(){s.setscrolltop(i),s.setscrollleft(r)})},this.cancelscroll=function(){}),this.doscrollby=function(e,o){var t=0;if(t=o?math.floor((s.scroll.y-e)*s.scrollratio.y):(s.timer?s.newscrolly:s.getscrolltop(!0))-e,s.bouncescroll){var r=math.round(s.view.h/2);t<-r?t=-r:t>s.page.maxh+r&&(t=s.page.maxh+r)}s.cursorfreezed=!1;var i=s.getscrolltop(!0);return t<0&&i<=0?s.noticecursor():t>s.page.maxh&&i>=s.page.maxh?(s.checkcontentsize(),s.noticecursor()):void s.doscrolltop(t)},this.doscrollleftby=function(e,o){var t=0;if(t=o?math.floor((s.scroll.x-e)*s.scrollratio.x):(s.timer?s.newscrollx:s.getscrollleft(!0))-e,s.bouncescroll){var r=math.round(s.view.w/2);t<-r?t=-r:t>s.page.maxw+r&&(t=s.page.maxw+r)}s.cursorfreezed=!1;var i=s.getscrollleft(!0);return t<0&&i<=0?s.noticecursor():t>s.page.maxw&&i>=s.page.maxw?s.noticecursor():void s.doscrollleft(t)},this.doscrollto=function(e,o){var t=o?math.round(e*s.scrollratio.y):e;t<0?t=0:t>s.page.maxh&&(t=s.page.maxh),s.cursorfreezed=!1,s.doscrolltop(e)},this.checkcontentsize=function(){var e=s.getcontentsize();e.h==s.page.h&&e.w==s.page.w||s.resize(!1,e)},s.onscroll=function(e){s.rail.drag||s.cursorfreezed||s.synched("scroll",function(){s.scroll.y=math.round(s.getscrolltop()*(1/s.scrollratio.y)),s.railh&&(s.scroll.x=math.round(s.getscrollleft()*(1/s.scrollratio.x))),s.noticecursor()})},s.bind(s.docscroll,"scroll",s.onscroll),this.dozoomin=function(e){if(!s.zoomactive){s.zoomactive=!0,s.zoomrestore={style:{}};var o=["position","top","left","zindex","backgroundcolor","margintop","marginbottom","marginleft","marginright"],t=s.win[0].style;for(var r in o){var i=o[r];s.zoomrestore.style[i]=void 0!==t[i]?t[i]:""}s.zoomrestore.style.width=s.win.css("width"),s.zoomrestore.style.height=s.win.css("height"),s.zoomrestore.padding={w:s.win.outerwidth()-s.win.width(),h:s.win.outerheight()-s.win.height()},e.isios4&&(s.zoomrestore.scrolltop=a.scrolltop(),a.scrolltop(0)),s.win.css({position:e.isios4?"absolute":"fixed",top:0,left:0,zindex:s+100,margin:0});var n=s.win.css("backgroundcolor");return(""==n||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(n))&&s.win.css("backgroundcolor","#fff"),s.rail.css({zindex:s+101}),s.zoom.css({zindex:s+102}),s.zoom.css("backgroundposition","0 -18px"),s.resizezoom(),s.onzoomin&&s.onzoomin.call(s),s.cancelevent(e)}},this.dozoomout=function(e){if(s.zoomactive)return s.zoomactive=!1,s.win.css("margin",""),s.win.css(s.zoomrestore.style),e.isios4&&a.scrolltop(s.zoomrestore.scrolltop),s.rail.css({"z-index":s.zindex}),s.zoom.css({"z-index":s.zindex}),s.zoomrestore=!1,s.zoom.css("backgroundposition","0 0"),s.onresize(),s.onzoomout&&s.onzoomout.call(s),s.cancelevent(e)},this.dozoom=function(e){return s.zoomactive?s.dozoomout(e):s.dozoomin(e)},this.resizezoom=function(){if(s.zoomactive){var e=s.getscrolltop();s.win.css({width:a.width()-s.zoomrestore.padding.w+"px",height:a.height()-s.zoomrestore.padding.h+"px"}),s.onresize(),s.setscrolltop(math.min(s.page.maxh,e))}},this.init(),n.nicescroll.push(this)},v=function(e){var o=this;this.nc=e,this.lastx=0,this.lasty=0,this.speedx=0,this.speedy=0,this.lasttime=0,this.steptime=0,this.snapx=!1,this.snapy=!1,this.demulx=0,this.demuly=0,this.lastscrollx=-1,this.lastscrolly=-1,this.chkx=0,this.chky=0,this.timer=0,this.reset=function(e,t){o.stop(),o.steptime=0,o.lasttime=p(),o.speedx=0,o.speedy=0,o.lastx=e,o.lasty=t,o.lastscrollx=-1,o.lastscrolly=-1},this.update=function(e,t){var r=p();o.steptime=r-o.lasttime,o.lasttime=r;var i=t-o.lasty,s=e-o.lastx,n=o.nc.getscrolltop()+i,l=o.nc.getscrollleft()+s;o.snapx=l<0||l>o.nc.page.maxw,o.snapy=n<0||n>o.nc.page.maxh,o.speedx=s,o.speedy=i,o.lastx=e,o.lasty=t},this.stop=function(){o.nc.unsynched("domomentum2d"),o.timer&&cleartimeout(o.timer),o.timer=0,o.lastscrollx=-1,o.lastscrolly=-1},this.dosnapy=function(e,t){var r=!1;t<0?(t=0,r=!0):t>o.nc.page.maxh&&(t=o.nc.page.maxh,r=!0),e<0?(e=0,r=!0):e>o.nc.page.maxw&&(e=o.nc.page.maxw,r=!0),r?o.nc.doscrollpos(e,t,o.nc.opt.snapbackspeed):o.nc.triggerscrollend()},this.domomentum=function(e){var t=p(),r=e?t+e:o.lasttime,i=o.nc.getscrollleft(),s=o.nc.getscrolltop(),n=o.nc.page.maxh,l=o.nc.page.maxw;o.speedx=l>0?math.min(60,o.speedx):0,o.speedy=n>0?math.min(60,o.speedy):0;var a=r&&t-r<=60;(s<0||s>n||i<0||i>l)&&(a=!1);var c=!(!o.speedy||!a)&&o.speedy,d=!(!o.speedx||!a)&&o.speedx;if(c||d){var u=math.max(16,o.steptime);if(u>50){var h=u/50;o.speedx*=h,o.speedy*=h,u=50}o.demulxy=0,o.lastscrollx=o.nc.getscrollleft(),o.chkx=o.lastscrollx,o.lastscrolly=o.nc.getscrolltop(),o.chky=o.lastscrolly;var m=o.lastscrollx,f=o.lastscrolly,g=function(){var e=p()-t>600?.04:.02;o.speedx&&(m=math.floor(o.lastscrollx-o.speedx*(1-o.demulxy)),o.lastscrollx=m,(m<0||m>l)&&(e=.1)),o.speedy&&(f=math.floor(o.lastscrolly-o.speedy*(1-o.demulxy)),o.lastscrolly=f,(f<0||f>n)&&(e=.1)),o.demulxy=math.min(1,o.demulxy+e),o.nc.synched("domomentum2d",function(){if(o.speedx){o.nc.getscrollleft();o.chkx=m,o.nc.setscrollleft(m)}if(o.speedy){o.nc.getscrolltop();o.chky=f,o.nc.setscrolltop(f)}o.timer||(o.nc.hidecursor(),o.dosnapy(m,f))}),o.demulxy<1?o.timer=settimeout(g,u):(o.stop(),o.nc.hidecursor(),o.dosnapy(m,f))};g()}else o.dosnapy(o.nc.getscrollleft(),o.nc.getscrolltop())}},b=e.fn.scrolltop;e.csshooks.pageyoffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getscrolltop():b.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setscrolltop(parseint(o)):b.call(e,o),this}},e.fn.scrolltop=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getscrolltop():b.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setscrolltop(parseint(e)):b.call(n(this),e)})};var y=e.fn.scrollleft;n.csshooks.pagexoffset={get:function(e,o,t){var r=n.data(e,"__nicescroll")||!1;return r&&r.ishwscroll?r.getscrollleft():y.call(e)},set:function(e,o){var t=n.data(e,"__nicescroll")||!1;return t&&t.ishwscroll?t.setscrollleft(parseint(o)):y.call(e,o),this}},e.fn.scrollleft=function(e){if(void 0===e){var o=!!this[0]&&(n.data(this[0],"__nicescroll")||!1);return o&&o.ishwscroll?o.getscrollleft():y.call(this)}return this.each(function(){var o=n.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setscrollleft(parseint(e)):y.call(n(this),e)})};var x=function(e){var o=this;if(this.length=0,this.name="nicescrollarray",this.each=function(e){return n.each(o,e),o},this.push=function(e){o[o.length]=e,o.length++},this.eq=function(e){return o[e]},e)for(var t=0;t1?n(e,r):s,i.win=r}!("doc"in i)||"win"in i||(i.win=r);var l=r.data("__nicescroll")||!1;l||(i.doc=i.doc||r,l=new w(i,r),r.data("__nicescroll",l)),t.push(l)}),1===t.length?t[0]:t},window.nicescroll={getjquery:function(){return e}},n.nicescroll||(n.nicescroll=new x,n.nicescroll.options=m)});