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