Files
XueXiTongSrtDownloads/学生学习页面_files/jquery.nicescroll.min(1).js.下载
ChuXun 1aacbb1d18 1
2026-01-18 18:53:17 +08:00

1 line
63 KiB
Plaintext

(function(a){if(typeof define==='function'&&define.amd){define(['jquery'],a)}else if(typeof exports==='object'){module.exports=a(require('jquery'))}else{a(jQuery)}}(function(W){"use strict";var X=false,mousefocus=false,tabindexcounter=0,ascrailcounter=2000,globalmaxzindex=0;var $=W,_doc=document,_win=window,$window=$(_win);var Y=[];function getScriptPath(){var a=_doc.currentScript||(function(){var s=_doc.getElementsByTagName('script');return(s.length)?s[s.length-1]:false})();var b=a?a.src.split('?')[0]:'';return(b.split('/').length>0)?b.split('/').slice(0,-1).join('/')+'/':''}var Z=_win.requestAnimationFrame||_win.webkitRequestAnimationFrame||_win.mozRequestAnimationFrame||false;var ba=_win.cancelAnimationFrame||_win.webkitCancelAnimationFrame||_win.mozCancelAnimationFrame||false;if(!Z){var bb=0;Z=function(a,b){var c=new Date().getTime();var d=Math.max(0,16-(c-bb));var e=_win.setTimeout(function(){a(c+d)},d);bb=c+d;return e};ba=function(a){_win.clearTimeout(a)}}else{if(!_win.cancelAnimationFrame)ba=function(a){}}var bc=_win.MutationObserver||_win.WebKitMutationObserver||false;var bd=Date.now||function(){return new Date().getTime()};var be={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:9*3,touchbehavior:false,emulatetouch:false,hwacceleration:true,usetransition:true,boxzoom:false,dblclickzoom:true,gesturezoom:true,grabcursorenabled:true,autohidemode:true,background:"",iframeautoresize:true,cursorminheight:32,preservenativescrolling:true,railoffset:false,railhoffset:false,bouncescroll:true,spacebarenabled:true,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:true,horizrailenabled:true,railalign:"right",railvalign:"bottom",enabletranslate3d:true,enablemousewheel:true,enablekeyboard:true,smoothscroll:true,sensitiverail:true,enablemouselockapi:true,cursorfixedheight:false,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:true,enablescrollonselection:true,overflowx:true,overflowy:true,cursordragspeed:0.3,rtlmode:"auto",cursordragontouch:false,oneaxismousemode:"auto",scriptpath:getScriptPath(),preventmultitouchscrolling:true,disablemutationobserver:false,enableobserver:true,scrollbarid:false};var bf=false;var bg=function(){if(bf)return bf;var g=_doc.createElement('DIV'),_style=g.style,_agent=navigator.userAgent,_platform=navigator.platform,d={};d.haspointerlock="pointerLockElement"in _doc||"webkitPointerLockElement"in _doc||"mozPointerLockElement"in _doc;d.isopera=("opera"in _win);d.isopera12=(d.isopera&&("getUserMedia"in navigator));d.isoperamini=(Object.prototype.toString.call(_win.operamini)==="[object OperaMini]");d.isie=(("all"in _doc)&&("attachEvent"in g)&&!d.isopera);d.isieold=(d.isie&&!("msInterpolationMode"in _style));d.isie7=d.isie&&!d.isieold&&(!("documentMode"in _doc)||(_doc.documentMode===7));d.isie8=d.isie&&("documentMode"in _doc)&&(_doc.documentMode===8);d.isie9=d.isie&&("performance"in _win)&&(_doc.documentMode===9);d.isie10=d.isie&&("performance"in _win)&&(_doc.documentMode===10);d.isie11=("msRequestFullscreen"in g)&&(_doc.documentMode>=11);d.ismsedge=("msCredentials"in _win);d.ismozilla=("MozAppearance"in _style);d.iswebkit=!d.ismsedge&&("WebkitAppearance"in _style);d.ischrome=d.iswebkit&&("chrome"in _win);d.ischrome38=(d.ischrome&&("touchAction"in _style));d.ischrome22=(!d.ischrome38)&&(d.ischrome&&d.haspointerlock);d.ischrome26=(!d.ischrome38)&&(d.ischrome&&("transition"in _style));d.cantouch=("ontouchstart"in _doc.documentElement)||("ontouchstart"in _win);d.hasw3ctouch=(_win.PointerEvent||false)&&(navigator.userAgent.toLowerCase().indexOf("micromessenger")==-1&&(navigator.maxTouchPoints>0)||(navigator.msMaxTouchPoints>0));d.hasmstouch=(!d.hasw3ctouch)&&(_win.MSPointerEvent||false);d.ismac=/^mac$/i.test(_platform);d.isios=d.cantouch&&/iphone|ipad|ipod/i.test(_platform);d.isios4=d.isios&&!("seal"in Object);d.isios7=d.isios&&("webkitHidden"in _doc);d.isios8=d.isios&&("hidden"in _doc);d.isios10=d.isios&&_win.Proxy;d.isandroid=(/android/i.test(_agent));d.haseventlistener=("addEventListener"in g);d.trstyle=false;d.hastransform=false;d.hastranslate3d=false;d.transitionstyle=false;d.hastransition=false;d.transitionend=false;d.trstyle="transform";d.hastransform=("transform"in _style)||(function(){var b=['msTransform','webkitTransform','MozTransform','OTransform'];for(var a=0,c=b.length;a<c;a++){if(_style[b[a]]!==undefined){d.trstyle=b[a];break}}d.hastransform=(!!d.trstyle)})();if(d.hastransform){_style[d.trstyle]="translate3d(1px,2px,3px)";d.hastranslate3d=/translate3d/.test(_style[d.trstyle])}d.transitionstyle="transition";d.prefixstyle='';d.transitionend="transitionend";d.hastransition=("transition"in _style)||(function(){d.transitionend=false;var b=['webkitTransition','msTransition','MozTransition','OTransition','OTransition','KhtmlTransition'];var e=['-webkit-','-ms-','-moz-','-o-','-o','-khtml-'];var f=['webkitTransitionEnd','msTransitionEnd','transitionend','otransitionend','oTransitionEnd','KhtmlTransitionEnd'];for(var a=0,c=b.length;a<c;a++){if(b[a]in _style){d.transitionstyle=b[a];d.prefixstyle=e[a];d.transitionend=f[a];break}}if(d.ischrome26)d.prefixstyle=e[1];d.hastransition=(d.transitionstyle)})();function detectCursorGrab(){var b=['grab','-webkit-grab','-moz-grab'];if((d.ischrome&&!d.ischrome38)||d.isie)b=[];for(var a=0,l=b.length;a<l;a++){var p=b[a];_style.cursor=p;if(_style.cursor==p)return p}return'url(https://cdnjs.cloudflare.com/ajax/libs/slider-pro/1.3.0/css/images/openhand.cur),n-resize'}d.cursorgrabvalue=detectCursorGrab();d.hasmousecapture=("setCapture"in g);d.hasMutationObserver=(bc!==false);g=null;bf=d;return d};var bh=function(F,G){var H=this;this.version='3.7.6';this.name='nicescroll';this.me=G;var I=$("body");var J=this.opt={doc:I,win:false};$.extend(J,be);J.snapbackspeed=80;if(F||false){for(var a in J){if(F[a]!==undefined)J[a]=F[a]}}if(J.disablemutationobserver)bc=false;this.doc=J.doc;this.iddoc=(this.doc&&this.doc[0])?this.doc[0].id||'':'';this.ispage=/^BODY|HTML/.test((J.win)?J.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=(J.win!==false);this.win=J.win||(this.ispage?$window:this.doc);this.docscroll=(this.ispage&&!this.haswrapper)?$window:this.win;this.body=I;this.viewport=false;this.isfixed=false;this.iframe=false;this.isiframe=((this.doc[0].nodeName=='IFRAME')&&(this.win[0].nodeName=='IFRAME'));this.istextarea=(this.win[0].nodeName=='TEXTAREA');this.forcescreen=false;this.canshowonmouseevent=(J.autohidemode!="scroll");this.onmousedown=false;this.onmouseup=false;this.onmousemove=false;this.onmousewheel=false;this.onkeypress=false;this.ongesturezoom=false;this.onclick=false;this.onscrollstart=false;this.onscrollend=false;this.onscrollcancel=false;this.onzoomin=false;this.onzoomout=false;this.view=false;this.page=false;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if(J.rtlmode=="auto"){var K=this.win[0]==_win?this.body:this.win;var L=K.css("writing-mode")||K.css("-webkit-writing-mode")||K.css("-ms-writing-mode")||K.css("-moz-writing-mode");if(L=="horizontal-tb"||L=="lr-tb"||L===""){this.isrtlmode=(K.css("direction")=="rtl");this.isvertical=false}else{this.isrtlmode=(L=="vertical-rl"||L=="tb"||L=="tb-rl"||L=="rl-tb");this.isvertical=(L=="vertical-rl"||L=="tb"||L=="tb-rl")}}else{this.isrtlmode=(J.rtlmode===true);this.isvertical=false}this.scrollrunning=false;this.scrollmom=false;this.observer=false;this.observerremover=false;this.observerbody=false;if(J.scrollbarid!==false){this.id=J.scrollbarid}else{do{this.id="ascrail"+(ascrailcounter++)}while(_doc.getElementById(this.id))}this.rail=false;this.cursor=false;this.cursorfreezed=false;this.selectiondrag=false;this.zoom=false;this.zoomactive=false;this.hasfocus=false;this.hasmousefocus=false;this.railslocked=false;this.locked=false;this.hidden=false;this.cursoractive=true;this.wheelprevented=false;this.overflowx=J.overflowx;this.overflowy=J.overflowy;this.nativescrollingarea=false;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltax=0;this.lastdeltay=0;this.detected=bg();var M=$.extend({},this.detected);this.canhwscroll=(M.hastransform&&J.hwacceleration);this.ishwscroll=(this.canhwscroll&&H.haswrapper);if(!this.isrtlmode){this.hasreversehr=false}else if(this.isvertical){this.hasreversehr=!(M.iswebkit||M.isie||M.isie11)}else{this.hasreversehr=!(M.iswebkit||(M.isie&&!M.isie10&&!M.isie11))}this.istouchcapable=false;if(!M.cantouch&&(M.hasw3ctouch||M.hasmstouch)){this.istouchcapable=true}else if(M.cantouch&&!M.isios&&!M.isandroid&&(M.iswebkit||M.ismozilla)){this.istouchcapable=true}if(!J.enablemouselockapi){M.hasmousecapture=false;M.haspointerlock=false}this.debounced=function(a,b,c){if(!H)return;var d=H.delaylist[a]||false;if(!d){H.delaylist[a]={h:Z(function(){H.delaylist[a].fn.call(H);H.delaylist[a]=false},c)};b.call(H)}H.delaylist[a].fn=b};this.synched=function(a,b){if(H.synclist[a])H.synclist[a]=b;else{H.synclist[a]=b;Z(function(){if(!H)return;H.synclist[a]&&H.synclist[a].call(H);H.synclist[a]=null})}};this.unsynched=function(a){if(H.synclist[a])H.synclist[a]=false};this.css=function(a,b){for(var n in b){H.saved.css.push([a,n,a.css(n)]);a.css(n,b[n])}};this.scrollTop=function(a){return(a===undefined)?H.getScrollTop():H.setScrollTop(a)};this.scrollLeft=function(a){return(a===undefined)?H.getScrollLeft():H.setScrollLeft(a)};var N=function(a,b,c,d,e,f,g){this.st=a;this.ed=b;this.spd=c;this.p1=d||0;this.p2=e||1;this.p3=f||0;this.p4=g||1;this.ts=bd();this.df=b-a};N.prototype={B2:function(t){return 3*(1-t)*(1-t)*t},B3:function(t){return 3*(1-t)*t*t},B4:function(t){return t*t*t},getPos:function(){return(bd()-this.ts)/this.spd},getNow:function(){var a=(bd()-this.ts)/this.spd;var b=this.B2(a)+this.B3(a)+this.B4(a);return(a>=1)?this.ed:this.st+(this.df*b)|0},update:function(a,b){this.st=this.getNow();this.ed=a;this.spd=b;this.ts=bd();this.df=this.ed-this.st;return this}};function getMatrixValues(){var a=H.doc.css(M.trstyle);if(a&&(a.substr(0,6)=="matrix")){return a.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,'').split(/, +/)}return false}if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};if(M.hastranslate3d&&M.isios)this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(a){if(!a){var b=getMatrixValues();if(b)return(b.length==16)?-b[13]:-b[5];if(H.timerscroll&&H.timerscroll.bz)return H.timerscroll.bz.getNow()}return H.doc.translate.y};this.getScrollLeft=function(a){if(!a){var b=getMatrixValues();if(b)return(b.length==16)?-b[12]:-b[4];if(H.timerscroll&&H.timerscroll.bh)return H.timerscroll.bh.getNow()}return H.doc.translate.x};this.notifyScrollEvent=function(a){var e=_doc.createEvent("UIEvents");e.initUIEvent("scroll",false,false,_win,1);e.niceevent=true;a.dispatchEvent(e)};var O=(this.isrtlmode)?1:-1;if(M.hastranslate3d&&J.enabletranslate3d){this.setScrollTop=function(a,b){H.doc.translate.y=a;H.doc.translate.ty=(a*-1)+"px";H.doc.css(M.trstyle,"translate3d("+H.doc.translate.tx+","+H.doc.translate.ty+",0)");if(!b)H.notifyScrollEvent(H.win[0])};this.setScrollLeft=function(a,b){H.doc.translate.x=a;H.doc.translate.tx=(a*O)+"px";H.doc.css(M.trstyle,"translate3d("+H.doc.translate.tx+","+H.doc.translate.ty+",0)");if(!b)H.notifyScrollEvent(H.win[0])}}else{this.setScrollTop=function(a,b){H.doc.translate.y=a;H.doc.translate.ty=(a*-1)+"px";H.doc.css(M.trstyle,"translate("+H.doc.translate.tx+","+H.doc.translate.ty+")");if(!b)H.notifyScrollEvent(H.win[0])};this.setScrollLeft=function(a,b){H.doc.translate.x=a;H.doc.translate.tx=(a*O)+"px";H.doc.css(M.trstyle,"translate("+H.doc.translate.tx+","+H.doc.translate.ty+")");if(!b)H.notifyScrollEvent(H.win[0])}}}else{this.getScrollTop=function(){return H.docscroll.scrollTop()};this.setScrollTop=function(a){H.docscroll.scrollTop(a)};this.getScrollLeft=function(){var a;if(!H.hasreversehr){a=H.docscroll.scrollLeft()}else if(H.detected.ismozilla){a=H.page.maxw-Math.abs(H.docscroll.scrollLeft())}else{a=H.page.maxw-H.docscroll.scrollLeft()}return a};this.setScrollLeft=function(a){return setTimeout(function(){if(!H)return;if(H.hasreversehr){if(H.detected.ismozilla){a=-(H.page.maxw-a)}else{a=H.page.maxw-a}}return H.docscroll.scrollLeft(a)},1)}}this.getTarget=function(e){if(!e)return false;if(e.target)return e.target;if(e.srcElement)return e.srcElement;return false};this.hasParent=function(e,a){if(!e)return false;var b=e.target||e.srcElement||e||false;while(b&&b.id!=a){b=b.parentNode||false}return(b!==false)};function getZIndex(){var a=H.win;if("zIndex"in a)return a.zIndex();while(a.length>0){if(a[0].nodeType==9)return false;var b=a.css('zIndex');if(!isNaN(b)&&b!==0)return parseInt(b);a=a.parent()}return false}var P={"thin":1,"medium":3,"thick":5};function getWidthToPixel(a,b,c){var d=a.css(b);var e=parseFloat(d);if(isNaN(e)){e=P[d]||0;var f=(e==3)?((c)?(H.win.outerHeight()-H.win.innerHeight()):(H.win.outerWidth()-H.win.innerWidth())):1;if(H.isie8&&e)e+=1;return(f)?e:0}return e}this.getDocumentScrollOffset=function(){return{top:_win.pageYOffset||_doc.documentElement.scrollTop,left:_win.pageXOffset||_doc.documentElement.scrollLeft}};this.getOffset=function(){if(H.isfixed){var a=H.win.offset();var b=H.getDocumentScrollOffset();a.top-=b.top;a.left-=b.left;return a}var c=H.win.offset();if(!H.viewport)return c;var d=H.viewport.offset();return{top:c.top-d.top,left:c.left-d.left}};this.updateScrollBar=function(a){var b,off;if(H.ishwscroll){H.rail.css({height:H.win.innerHeight()-(J.railpadding.top+J.railpadding.bottom)});if(H.railh)H.railh.css({width:H.win.innerWidth()-(J.railpadding.left+J.railpadding.right)})}else{var c=H.getOffset();b={top:c.top,left:c.left-(J.railpadding.left+J.railpadding.right)};b.top+=getWidthToPixel(H.win,'border-top-width',true);b.left+=(H.rail.align)?H.win.outerWidth()-getWidthToPixel(H.win,'border-right-width')-H.rail.width:getWidthToPixel(H.win,'border-left-width');off=J.railoffset;if(off){if(off.top)b.top+=off.top;if(off.left)b.left+=off.left}if(!H.railslocked)H.rail.css({top:b.top,left:b.left,height:((a)?a.h:H.win.innerHeight())-(J.railpadding.top+J.railpadding.bottom)});if(H.zoom){H.zoom.css({top:b.top+1,left:(H.rail.align==1)?b.left-20:b.left+H.rail.width+4})}if(H.railh&&!H.railslocked){b={top:c.top,left:c.left};off=J.railhoffset;if(off){if(off.top)b.top+=off.top;if(off.left)b.left+=off.left}var y=(H.railh.align)?b.top+getWidthToPixel(H.win,'border-top-width',true)+H.win.innerHeight()-H.railh.height:b.top+getWidthToPixel(H.win,'border-top-width',true);var x=b.left+getWidthToPixel(H.win,'border-left-width');H.railh.css({top:y-(J.railpadding.top+J.railpadding.bottom),left:x,width:H.railh.width})}}};this.doRailClick=function(e,a,b){var c,pg,cur,pos;if(H.railslocked)return;H.cancelEvent(e);if(!("pageY"in e)){e.pageX=e.clientX+_doc.documentElement.scrollLeft;e.pageY=e.clientY+_doc.documentElement.scrollTop}if(a){c=(b)?H.doScrollLeft:H.doScrollTop;cur=(b)?((e.pageX-H.railh.offset().left-(H.cursorwidth/2))*H.scrollratio.x):((e.pageY-H.rail.offset().top-(H.cursorheight/2))*H.scrollratio.y);H.unsynched("relativexy");c(cur|0)}else{c=(b)?H.doScrollLeftBy:H.doScrollBy;cur=(b)?H.scroll.x:H.scroll.y;pos=(b)?e.pageX-H.railh.offset().left:e.pageY-H.rail.offset().top;pg=(b)?H.view.w:H.view.h;c((cur>=pos)?pg:-pg)}};H.newscrolly=H.newscrollx=0;H.hasanimationframe=("requestAnimationFrame"in _win);H.hascancelanimationframe=("cancelAnimationFrame"in _win);H.hasborderbox=false;this.init=function(){H.saved.css=[];if(M.isoperamini)return true;if(M.isandroid&&!("hidden"in _doc))return true;J.emulatetouch=J.emulatetouch||J.touchbehavior;H.hasborderbox=_win.getComputedStyle&&(_win.getComputedStyle(_doc.body)['box-sizing']==="border-box");var o={'overflow-y':'hidden'};if(M.isie11||M.isie10)o['-ms-overflow-style']='none';if(H.ishwscroll){this.doc.css(M.transitionstyle,M.prefixstyle+'transform 0ms ease-out');if(M.transitionend)H.bind(H.doc,M.transitionend,H.onScrollTransitionEnd,false)}H.zindex="auto";if(!H.ispage&&J.zindex=="auto"){H.zindex=getZIndex()||"auto"}else{H.zindex=J.zindex}if(!H.ispage&&H.zindex!="auto"&&H.zindex>globalmaxzindex){globalmaxzindex=H.zindex}if(H.isie&&H.zindex===0&&J.zindex=="auto"){H.zindex="auto"}if(!H.ispage||!M.isieold){var p=H.docscroll;if(H.ispage)p=(H.haswrapper)?H.win:H.doc;H.css(p,o);if(H.ispage&&(M.isie11||M.isie)){H.css($("html"),o)}if(M.isios&&!H.ispage&&!H.haswrapper)H.css(I,{"-webkit-overflow-scrolling":"touch"});var q=$(_doc.createElement('div'));q.css({position:"relative",top:0,"float":"right",width:J.cursorwidth,height:0,'background-color':J.cursorcolor,border:J.cursorborder,'background-clip':'padding-box','-webkit-border-radius':J.cursorborderradius,'-moz-border-radius':J.cursorborderradius,'border-radius':J.cursorborderradius});q.addClass('nicescroll-cursors');H.cursor=q;var r=$(_doc.createElement('div'));r.attr('id',H.id);r.addClass('nicescroll-rails nicescroll-rails-vr');var v,a,kp=["left","right","top","bottom"];for(var n in kp){a=kp[n];v=J.railpadding[a]||0;v&&r.css("padding-"+a,v+"px")}r.append(q);r.width=Math.max(parseFloat(J.cursorwidth),q.outerWidth());r.css({width:r.width+"px",zIndex:H.zindex,background:J.background,cursor:"default"});r.visibility=true;r.scrollable=true;r.align=(J.railalign=="left")?0:1;H.rail=r;H.rail.drag=false;var s=false;if(J.boxzoom&&!H.ispage&&!M.isieold){s=_doc.createElement('div');H.bind(s,"click",H.doZoom);H.bind(s,"mouseenter",function(){H.zoom.css('opacity',J.cursoropacitymax)});H.bind(s,"mouseleave",function(){H.zoom.css('opacity',J.cursoropacitymin)});H.zoom=$(s);H.zoom.css({cursor:"pointer",zIndex:H.zindex,backgroundImage:'url('+J.scriptpath+'zoomico.png)',height:18,width:18,backgroundPosition:'0 0'});if(J.dblclickzoom)H.bind(H.win,"dblclick",H.doZoom);if(M.cantouch&&J.gesturezoom){H.ongesturezoom=function(e){if(e.scale>1.5)H.doZoomIn(e);if(e.scale<0.8)H.doZoomOut(e);return H.cancelEvent(e)};H.bind(H.win,"gestureend",H.ongesturezoom)}}H.railh=false;var t;if(J.horizrailenabled){H.css(p,{overflowX:'hidden'});q=$(_doc.createElement('div'));q.css({position:"absolute",top:0,height:J.cursorwidth,width:0,backgroundColor:J.cursorcolor,border:J.cursorborder,backgroundClip:'padding-box','-webkit-border-radius':J.cursorborderradius,'-moz-border-radius':J.cursorborderradius,'border-radius':J.cursorborderradius});if(M.isieold)q.css('overflow','hidden');q.addClass('nicescroll-cursors');H.cursorh=q;t=$(_doc.createElement('div'));t.attr('id',H.id+'-hr');t.addClass('nicescroll-rails nicescroll-rails-hr');t.height=Math.max(parseFloat(J.cursorwidth),q.outerHeight());t.css({height:t.height+"px",'zIndex':H.zindex,"background":J.background});t.append(q);t.visibility=true;t.scrollable=true;t.align=(J.railvalign=="top")?0:1;H.railh=t;H.railh.drag=false}if(H.ispage){r.css({position:"fixed",top:0,height:"100%"});r.css((r.align)?{right:0}:{left:0});H.body.append(r);if(H.railh){t.css({position:"fixed",left:0,width:"100%"});t.css((t.align)?{bottom:0}:{top:0});H.body.append(t)}}else{if(H.ishwscroll){if(H.win.css('position')=='static')H.css(H.win,{'position':'relative'});var u=(H.win[0].nodeName=='HTML')?H.body:H.win;$(u).scrollTop(0).scrollLeft(0);if(H.zoom){H.zoom.css({position:"absolute",top:1,right:0,"margin-right":r.width+4});u.append(H.zoom)}r.css({position:"absolute",top:0});r.css((r.align)?{right:0}:{left:0});u.append(r);if(t){t.css({position:"absolute",left:0,bottom:0});t.css((t.align)?{bottom:0}:{top:0});u.append(t)}}else{H.isfixed=(H.win.css("position")=="fixed");var w=(H.isfixed)?"fixed":"absolute";if(!H.isfixed)H.viewport=H.getViewport(H.win[0]);if(H.viewport){H.body=H.viewport;if(!(/fixed|absolute/.test(H.viewport.css("position"))))H.css(H.viewport,{"position":"relative"})}r.css({position:w});if(H.zoom)H.zoom.css({position:w});H.updateScrollBar();H.body.append(r);if(H.zoom)H.body.append(H.zoom);if(H.railh){t.css({position:w});H.body.append(t)}}if(M.isios)H.css(H.win,{'-webkit-tap-highlight-color':'rgba(0,0,0,0)','-webkit-touch-callout':'none'});if(J.disableoutline){if(M.isie)H.win.attr("hideFocus","true");if(M.iswebkit)H.win.css('outline','none')}}if(J.autohidemode===false){H.autohidedom=false;H.rail.css({opacity:J.cursoropacitymax});if(H.railh)H.railh.css({opacity:J.cursoropacitymax})}else if((J.autohidemode===true)||(J.autohidemode==="leave")){H.autohidedom=$().add(H.rail);if(M.isie8)H.autohidedom=H.autohidedom.add(H.cursor);if(H.railh)H.autohidedom=H.autohidedom.add(H.railh);if(H.railh&&M.isie8)H.autohidedom=H.autohidedom.add(H.cursorh)}else if(J.autohidemode=="scroll"){H.autohidedom=$().add(H.rail);if(H.railh)H.autohidedom=H.autohidedom.add(H.railh)}else if(J.autohidemode=="cursor"){H.autohidedom=$().add(H.cursor);if(H.railh)H.autohidedom=H.autohidedom.add(H.cursorh)}else if(J.autohidemode=="hidden"){H.autohidedom=false;H.hide();H.railslocked=false}if(M.cantouch||H.istouchcapable||J.emulatetouch||M.hasmstouch){H.scrollmom=new bi(H);var x=null;H.ontouchstart=function(e){if(H.locked)return false;if(e.pointerType&&(e.pointerType==='mouse'||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return false;H.hasmoving=false;if(H.scrollmom.timer){H.triggerScrollEnd();H.scrollmom.stop()}if(!H.railslocked){var a=H.getTarget(e);if(a){var b=(/INPUT/i.test(a.nodeName))&&(/range/i.test(a.type));if(b)return H.stopPropagation(e)}var c=(e.type==="mousedown");if(!("clientX"in e)&&("changedTouches"in e)){e.clientX=e.changedTouches[0].clientX;e.clientY=e.changedTouches[0].clientY}if(H.forcescreen){var d=e;e={"original":(e.original)?e.original:e};e.clientX=d.screenX;e.clientY=d.screenY}H.rail.drag={x:e.clientX,y:e.clientY,sx:H.scroll.x,sy:H.scroll.y,st:H.getScrollTop(),sl:H.getScrollLeft(),pt:2,dl:false,tg:a};if(H.ispage||!J.directionlockdeadzone){H.rail.drag.dl="f"}else{var f={w:$window.width(),h:$window.height()};var g=H.getContentSize();var h=g.h-f.h;var i=g.w-f.w;if(H.rail.scrollable&&!H.railh.scrollable)H.rail.drag.ck=(h>0)?"v":false;else if(!H.rail.scrollable&&H.railh.scrollable)H.rail.drag.ck=(i>0)?"h":false;else H.rail.drag.ck=false}if(J.emulatetouch&&H.isiframe&&M.isie){var j=H.win.position();H.rail.drag.x+=j.left;H.rail.drag.y+=j.top}H.hasmoving=false;H.lastmouseup=false;H.scrollmom.reset(e.clientX,e.clientY);if(a&&c){var k=/INPUT|SELECT|BUTTON|TEXTAREA/i.test(a.nodeName);if(!k){if(M.hasmousecapture)a.setCapture();if(J.emulatetouch){if(a.onclick&&!(a._onclick||false)){a._onclick=a.onclick;a.onclick=function(e){if(H.hasmoving)return false;a._onclick.call(this,e)}}return H.cancelEvent(e)}return H.stopPropagation(e)}if(/SUBMIT|CANCEL|BUTTON/i.test($(a).attr('type'))){H.preventclick={"tg":a,"click":false}}}}};H.ontouchend=function(e){if(!H.rail.drag)return true;if(H.rail.drag.pt==2){if(e.pointerType&&(e.pointerType==='mouse'||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return false;H.rail.drag=false;var a=(e.type==="mouseup");if(H.hasmoving){H.scrollmom.doMomentum();H.lastmouseup=true;H.hideCursor();if(M.hasmousecapture)_doc.releaseCapture();if(a)return H.cancelEvent(e)}}else if(H.rail.drag.pt==1){return H.onmouseup(e)}};var y=(J.emulatetouch&&H.isiframe&&!M.hasmousecapture);var z=J.directionlockdeadzone*0.3|0;H.ontouchmove=function(e,a){if(!H.rail.drag)return true;if(e.targetTouches&&J.preventmultitouchscrolling){if(e.targetTouches.length>1)return true}if(e.pointerType&&(e.pointerType==='mouse'||e.pointerType===e.MSPOINTER_TYPE_MOUSE))return true;if(H.rail.drag.pt==2){if(("changedTouches"in e)){e.clientX=e.changedTouches[0].clientX;e.clientY=e.changedTouches[0].clientY}var b,ofx;ofx=b=0;if(y&&!a){var c=H.win.position();ofx=-c.left;b=-c.top}var d=e.clientY+b;var f=(d-H.rail.drag.y);var g=e.clientX+ofx;var h=(g-H.rail.drag.x);var i=H.rail.drag.st-f;if(H.ishwscroll&&J.bouncescroll){if(i<0){i=Math.round(i/2)}else if(i>H.page.maxh){i=H.page.maxh+Math.round((i-H.page.maxh)/2)}}else{if(i<0){i=0;d=0}else if(i>H.page.maxh){i=H.page.maxh;d=0}if(d===0&&!H.hasmoving){if(!H.ispage)H.rail.drag=false;return true}}var j=H.getScrollLeft();if(H.railh&&H.railh.scrollable){j=(H.isrtlmode)?h-H.rail.drag.sl:H.rail.drag.sl-h;if(H.ishwscroll&&J.bouncescroll){if(j<0){j=Math.round(j/2)}else if(j>H.page.maxw){j=H.page.maxw+Math.round((j-H.page.maxw)/2)}}else{if(j<0){j=0;g=0}if(j>H.page.maxw){j=H.page.maxw;g=0}}}if(!H.hasmoving){if(H.rail.drag.y===e.clientY&&H.rail.drag.x===e.clientX)return H.cancelEvent(e);var k=Math.abs(f);var l=Math.abs(h);var m=J.directionlockdeadzone;if(!H.rail.drag.ck){if(k>m&&l>m)H.rail.drag.dl="f";else if(k>m)H.rail.drag.dl=(l>z)?"f":"v";else if(l>m)H.rail.drag.dl=(k>z)?"f":"h"}else if(H.rail.drag.ck=="v"){if(l>m&&k<=z){H.rail.drag=false}else if(k>m)H.rail.drag.dl="v"}else if(H.rail.drag.ck=="h"){if(k>m&&l<=z){H.rail.drag=false}else if(l>m)H.rail.drag.dl="h"}if(!H.rail.drag.dl)return H.cancelEvent(e);H.triggerScrollStart(e.clientX,e.clientY,0,0,0);H.hasmoving=true}if(H.preventclick&&!H.preventclick.click){H.preventclick.click=H.preventclick.tg.onclick||false;H.preventclick.tg.onclick=H.onpreventclick}if(H.rail.drag.dl){if(H.rail.drag.dl=="v")j=H.rail.drag.sl;else if(H.rail.drag.dl=="h")i=H.rail.drag.st}H.synched("touchmove",function(){if(H.rail.drag&&(H.rail.drag.pt==2)){if(H.prepareTransition)H.resetTransition();if(H.rail.scrollable)H.setScrollTop(i);H.scrollmom.update(g,d);if(H.railh&&H.railh.scrollable){H.setScrollLeft(j);H.showCursor(i,j)}else{H.showCursor(i)}if(M.isie10)_doc.selection.clear()}});return H.cancelEvent(e)}else if(H.rail.drag.pt==1){return H.onmousemove(e)}};H.ontouchstartCursor=function(e,a){if(H.rail.drag&&H.rail.drag.pt!=3)return;if(H.locked)return H.cancelEvent(e);H.cancelScroll();H.rail.drag={x:e.touches[0].clientX,y:e.touches[0].clientY,sx:H.scroll.x,sy:H.scroll.y,pt:3,hr:(!!a)};var b=H.getTarget(e);if(!H.ispage&&M.hasmousecapture)b.setCapture();if(H.isiframe&&!M.hasmousecapture){H.saved.csspointerevents=H.doc.css("pointer-events");H.css(H.doc,{"pointer-events":"none"})}return H.cancelEvent(e)};H.ontouchendCursor=function(e){if(H.rail.drag){if(M.hasmousecapture)_doc.releaseCapture();if(H.isiframe&&!M.hasmousecapture)H.doc.css("pointer-events",H.saved.csspointerevents);if(H.rail.drag.pt!=3)return;H.rail.drag=false;return H.cancelEvent(e)}};H.ontouchmoveCursor=function(e){if(H.rail.drag){if(H.rail.drag.pt!=3)return;H.cursorfreezed=true;if(H.rail.drag.hr){H.scroll.x=H.rail.drag.sx+(e.touches[0].clientX-H.rail.drag.x);if(H.scroll.x<0)H.scroll.x=0;var a=H.scrollvaluemaxw;if(H.scroll.x>a)H.scroll.x=a}else{H.scroll.y=H.rail.drag.sy+(e.touches[0].clientY-H.rail.drag.y);if(H.scroll.y<0)H.scroll.y=0;var b=H.scrollvaluemax;if(H.scroll.y>b)H.scroll.y=b}H.synched('touchmove',function(){if(H.rail.drag&&(H.rail.drag.pt==3)){H.showCursor();if(H.rail.drag.hr)H.doScrollLeft(Math.round(H.scroll.x*H.scrollratio.x),J.cursordragspeed);else H.doScrollTop(Math.round(H.scroll.y*H.scrollratio.y),J.cursordragspeed)}});return H.cancelEvent(e)}}}H.onmousedown=function(e,a){if(H.rail.drag&&H.rail.drag.pt!=1)return;if(H.railslocked)return H.cancelEvent(e);H.cancelScroll();H.rail.drag={x:e.clientX,y:e.clientY,sx:H.scroll.x,sy:H.scroll.y,pt:1,hr:a||false};var b=H.getTarget(e);if(M.hasmousecapture)b.setCapture();if(H.isiframe&&!M.hasmousecapture){H.saved.csspointerevents=H.doc.css("pointer-events");H.css(H.doc,{"pointer-events":"none"})}H.hasmoving=false;return H.cancelEvent(e)};H.onmouseup=function(e){if(H.rail.drag){if(H.rail.drag.pt!=1)return true;if(M.hasmousecapture)_doc.releaseCapture();if(H.isiframe&&!M.hasmousecapture)H.doc.css("pointer-events",H.saved.csspointerevents);H.rail.drag=false;H.cursorfreezed=false;if(H.hasmoving)H.triggerScrollEnd();return H.cancelEvent(e)}};H.onmousemove=function(e){if(H.rail.drag){if(H.rail.drag.pt!==1)return;if(M.ischrome&&e.which===0)return H.onmouseup(e);H.cursorfreezed=true;if(!H.hasmoving)H.triggerScrollStart(e.clientX,e.clientY,0,0,0);H.hasmoving=true;if(H.rail.drag.hr){H.scroll.x=H.rail.drag.sx+(e.clientX-H.rail.drag.x);if(H.scroll.x<0)H.scroll.x=0;var a=H.scrollvaluemaxw;if(H.scroll.x>a)H.scroll.x=a}else{H.scroll.y=H.rail.drag.sy+(e.clientY-H.rail.drag.y);if(H.scroll.y<0)H.scroll.y=0;var b=H.scrollvaluemax;if(H.scroll.y>b)H.scroll.y=b}H.synched('mousemove',function(){if(H.cursorfreezed){H.showCursor();if(H.rail.drag.hr){H.scrollLeft(Math.round(H.scroll.x*H.scrollratio.x))}else{H.scrollTop(Math.round(H.scroll.y*H.scrollratio.y))}}});return H.cancelEvent(e)}else{H.checkarea=0}};if(M.cantouch||J.emulatetouch){H.onpreventclick=function(e){if(H.preventclick){H.preventclick.tg.onclick=H.preventclick.click;H.preventclick=false;return H.cancelEvent(e)}};H.onclick=(M.isios)?false:function(e){if(H.lastmouseup){H.lastmouseup=false;return H.cancelEvent(e)}else{return true}};if(J.grabcursorenabled&&M.cursorgrabvalue){H.css((H.ispage)?H.doc:H.win,{'cursor':M.cursorgrabvalue});H.css(H.rail,{'cursor':M.cursorgrabvalue})}}else{var A=function(e){if(!H.selectiondrag)return;if(e){var a=H.win.outerHeight();var b=(e.pageY-H.selectiondrag.top);if(b>0&&b<a)b=0;if(b>=a)b-=a;H.selectiondrag.df=b}if(H.selectiondrag.df===0)return;var c=-(H.selectiondrag.df*2/6)|0;H.doScrollBy(c);H.debounced("doselectionscroll",function(){A()},50)};if("getSelection"in _doc){H.hasTextSelected=function(){return(_doc.getSelection().rangeCount>0)}}else if("selection"in _doc){H.hasTextSelected=function(){return(_doc.selection.type!="None")}}else{H.hasTextSelected=function(){return false}}H.onselectionstart=function(e){if(H.ispage)return;H.selectiondrag=H.win.offset()};H.onselectionend=function(e){H.selectiondrag=false};H.onselectiondrag=function(e){if(!H.selectiondrag)return;if(H.hasTextSelected())H.debounced("selectionscroll",function(){A(e)},250)}}if(M.hasw3ctouch){H.css((H.ispage)?$("html"):H.win,{'touch-action':'none'});H.css(H.rail,{'touch-action':'none'});H.css(H.cursor,{'touch-action':'none'});H.bind(H.win,"pointerdown",H.ontouchstart);H.bind(_doc,"pointerup",H.ontouchend);H.delegate(_doc,"pointermove",H.ontouchmove)}else if(M.hasmstouch){H.css((H.ispage)?$("html"):H.win,{'-ms-touch-action':'none'});H.css(H.rail,{'-ms-touch-action':'none'});H.css(H.cursor,{'-ms-touch-action':'none'});H.bind(H.win,"MSPointerDown",H.ontouchstart);H.bind(_doc,"MSPointerUp",H.ontouchend);H.delegate(_doc,"MSPointerMove",H.ontouchmove);H.bind(H.cursor,"MSGestureHold",function(e){e.preventDefault()});H.bind(H.cursor,"contextmenu",function(e){e.preventDefault()})}else if(M.cantouch){H.bind(H.win,"touchstart",H.ontouchstart,false,true);H.bind(_doc,"touchend",H.ontouchend,false,true);H.bind(_doc,"touchcancel",H.ontouchend,false,true);H.delegate(_doc,"touchmove",H.ontouchmove,false,true)}if(J.emulatetouch){H.bind(H.win,"mousedown",H.ontouchstart,false,true);H.bind(_doc,"mouseup",H.ontouchend,false,true);H.bind(_doc,"mousemove",H.ontouchmove,false,true)}if(J.cursordragontouch||(!M.cantouch&&!J.emulatetouch)){H.rail.css({cursor:"default"});H.railh&&H.railh.css({cursor:"default"});H.jqbind(H.rail,"mouseenter",function(){if(!H.ispage&&!H.win.is(":visible"))return false;if(H.canshowonmouseevent)H.showCursor();H.rail.active=true});H.jqbind(H.rail,"mouseleave",function(){H.rail.active=false;if(!H.rail.drag)H.hideCursor()});if(J.sensitiverail){H.bind(H.rail,"click",function(e){H.doRailClick(e,false,false)});H.bind(H.rail,"dblclick",function(e){H.doRailClick(e,true,false)});H.bind(H.cursor,"click",function(e){H.cancelEvent(e)});H.bind(H.cursor,"dblclick",function(e){H.cancelEvent(e)})}if(H.railh){H.jqbind(H.railh,"mouseenter",function(){if(!H.ispage&&!H.win.is(":visible"))return false;if(H.canshowonmouseevent)H.showCursor();H.rail.active=true});H.jqbind(H.railh,"mouseleave",function(){H.rail.active=false;if(!H.rail.drag)H.hideCursor()});if(J.sensitiverail){H.bind(H.railh,"click",function(e){H.doRailClick(e,false,true)});H.bind(H.railh,"dblclick",function(e){H.doRailClick(e,true,true)});H.bind(H.cursorh,"click",function(e){H.cancelEvent(e)});H.bind(H.cursorh,"dblclick",function(e){H.cancelEvent(e)})}}}if(J.cursordragontouch&&(this.istouchcapable||M.cantouch)){H.bind(H.cursor,"touchstart",H.ontouchstartCursor);H.bind(H.cursor,"touchmove",H.ontouchmoveCursor);H.bind(H.cursor,"touchend",H.ontouchendCursor);H.cursorh&&H.bind(H.cursorh,"touchstart",function(e){H.ontouchstartCursor(e,true)});H.cursorh&&H.bind(H.cursorh,"touchmove",H.ontouchmoveCursor);H.cursorh&&H.bind(H.cursorh,"touchend",H.ontouchendCursor)}if(!J.emulatetouch&&!M.isandroid&&!M.isios){H.bind((M.hasmousecapture)?H.win:_doc,"mouseup",H.onmouseup);H.bind(_doc,"mousemove",H.onmousemove);if(H.onclick)H.bind(_doc,"click",H.onclick);H.bind(H.cursor,"mousedown",H.onmousedown);H.bind(H.cursor,"mouseup",H.onmouseup);if(H.railh){H.bind(H.cursorh,"mousedown",function(e){H.onmousedown(e,true)});H.bind(H.cursorh,"mouseup",H.onmouseup)}if(!H.ispage&&J.enablescrollonselection){H.bind(H.win[0],"mousedown",H.onselectionstart);H.bind(_doc,"mouseup",H.onselectionend);H.bind(H.cursor,"mouseup",H.onselectionend);if(H.cursorh)H.bind(H.cursorh,"mouseup",H.onselectionend);H.bind(_doc,"mousemove",H.onselectiondrag)}if(H.zoom){H.jqbind(H.zoom,"mouseenter",function(){if(H.canshowonmouseevent)H.showCursor();H.rail.active=true});H.jqbind(H.zoom,"mouseleave",function(){H.rail.active=false;if(!H.rail.drag)H.hideCursor()})}}else{H.bind((M.hasmousecapture)?H.win:_doc,"mouseup",H.ontouchend);if(H.onclick)H.bind(_doc,"click",H.onclick);if(J.cursordragontouch){H.bind(H.cursor,"mousedown",H.onmousedown);H.bind(H.cursor,"mouseup",H.onmouseup);H.cursorh&&H.bind(H.cursorh,"mousedown",function(e){H.onmousedown(e,true)});H.cursorh&&H.bind(H.cursorh,"mouseup",H.onmouseup)}else{H.bind(H.rail,"mousedown",function(e){e.preventDefault()});H.railh&&H.bind(H.railh,"mousedown",function(e){e.preventDefault()})}}if(J.enablemousewheel){if(!H.isiframe)H.mousewheel((M.isie&&H.ispage)?_doc:H.win,H.onmousewheel);H.mousewheel(H.rail,H.onmousewheel);if(H.railh)H.mousewheel(H.railh,H.onmousewheelhr)}if(!H.ispage&&!M.cantouch&&!(/HTML|^BODY/.test(H.win[0].nodeName))){if(!H.win.attr("tabindex"))H.win.attr({"tabindex":++tabindexcounter});H.bind(H.win,"focus",function(e){X=(H.getTarget(e)).id||H.getTarget(e)||false;H.hasfocus=true;if(H.canshowonmouseevent)H.noticeCursor()});H.bind(H.win,"blur",function(e){X=false;H.hasfocus=false});H.bind(H.win,"mouseenter",function(e){mousefocus=(H.getTarget(e)).id||H.getTarget(e)||false;H.hasmousefocus=true;if(H.canshowonmouseevent)H.noticeCursor()});H.bind(H.win,"mouseleave",function(e){mousefocus=false;H.hasmousefocus=false;if(!H.rail.drag)H.hideCursor()})}H.onkeypress=function(e){if(H.railslocked&&H.page.maxh===0)return true;e=e||_win.event;var a=H.getTarget(e);if(a&&/INPUT|TEXTAREA|SELECT|OPTION/.test(a.nodeName)){var b=a.getAttribute('type')||a.type||false;if((!b)||!(/submit|button|cancel/i.tp))return true}if($(a).attr('contenteditable'))return true;if(H.hasfocus||(H.hasmousefocus&&!X)||(H.ispage&&!X&&!mousefocus)){var c=e.keyCode;if(H.railslocked&&c!=27)return H.cancelEvent(e);var d=e.ctrlKey||false;var f=e.shiftKey||false;var g=false;switch(c){case 38:case 63233:H.doScrollBy(24*3);g=true;break;case 40:case 63235:H.doScrollBy(-24*3);g=true;break;case 37:case 63232:if(H.railh){(d)?H.doScrollLeft(0):H.doScrollLeftBy(24*3);g=true}break;case 39:case 63234:if(H.railh){(d)?H.doScrollLeft(H.page.maxw):H.doScrollLeftBy(-24*3);g=true}break;case 33:case 63276:H.doScrollBy(H.view.h);g=true;break;case 34:case 63277:H.doScrollBy(-H.view.h);g=true;break;case 36:case 63273:(H.railh&&d)?H.doScrollPos(0,0):H.doScrollTo(0);g=true;break;case 35:case 63275:(H.railh&&d)?H.doScrollPos(H.page.maxw,H.page.maxh):H.doScrollTo(H.page.maxh);g=true;break;case 32:if(J.spacebarenabled){(f)?H.doScrollBy(H.view.h):H.doScrollBy(-H.view.h);g=true}break;case 27:if(H.zoomactive){H.doZoom();g=true}break}if(g)return H.cancelEvent(e)}};if(J.enablekeyboard)H.bind(_doc,(M.isopera&&!M.isopera12)?"keypress":"keydown",H.onkeypress);H.bind(_doc,"keydown",function(e){var a=e.ctrlKey||false;if(a)H.wheelprevented=true});H.bind(_doc,"keyup",function(e){var a=e.ctrlKey||false;if(!a)H.wheelprevented=false});H.bind(_win,"blur",function(e){H.wheelprevented=false});H.bind(_win,'resize',H.onscreenresize);H.bind(_win,'orientationchange',H.onscreenresize);H.bind(_win,"load",H.lazyResize);if(M.ischrome&&!H.ispage&&!H.haswrapper){var B=H.win.attr("style");var C=parseFloat(H.win.css("width"))+1;H.win.css('width',C);H.synched("chromefix",function(){H.win.attr("style",B)})}H.onAttributeChange=function(e){H.lazyResize(H.isieold?250:30)};if(J.enableobserver){if((!H.isie11)&&(bc!==false)){H.observerbody=new bc(function(b){b.forEach(function(a){if(a.type=="attributes"){return(I.hasClass("modal-open")&&I.hasClass("modal-dialog")&&!$.contains($('.modal-dialog')[0],H.doc[0]))?H.hide():H.show()}});if(H.me.clientWidth!=H.page.width||H.me.clientHeight!=H.page.height)return H.lazyResize(30)});H.observerbody.observe(_doc.body,{childList:true,subtree:true,characterData:false,attributes:true,attributeFilter:['class']})}if(!H.ispage&&!H.haswrapper){var D=H.win[0];if(bc!==false){H.observer=new bc(function(a){a.forEach(H.onAttributeChange)});H.observer.observe(D,{childList:true,characterData:false,attributes:true,subtree:false});H.observerremover=new bc(function(c){c.forEach(function(a){if(a.removedNodes.length>0){for(var b in a.removedNodes){if(!!H&&(a.removedNodes[b]===D))return H.remove()}}})});H.observerremover.observe(D.parentNode,{childList:true,characterData:false,attributes:false,subtree:false})}else{H.bind(D,(M.isie&&!M.isie9)?"propertychange":"DOMAttrModified",H.onAttributeChange);if(M.isie9)D.attachEvent("onpropertychange",H.onAttributeChange);H.bind(D,"DOMNodeRemoved",function(e){if(e.target===D)H.remove()})}}}if(!H.ispage&&J.boxzoom)H.bind(_win,"resize",H.resizeZoom);if(H.istextarea){H.bind(H.win,"keydown",H.lazyResize);H.bind(H.win,"mouseup",H.lazyResize)}H.lazyResize(30)}if(this.doc[0].nodeName=='IFRAME'){var E=function(){H.iframexd=false;var b;try{b='contentDocument'in this?this.contentDocument:this.contentWindow._doc;var a=b.domain}catch(e){H.iframexd=true;b=false}if(H.iframexd){if("console"in _win)console.log('NiceScroll error: policy restriced iframe');return true}H.forcescreen=true;if(H.isiframe){H.iframe={"doc":$(b),"html":H.doc.contents().find('html')[0],"body":H.doc.contents().find('body')[0]};H.getContentSize=function(){return{w:Math.max(H.iframe.html.scrollWidth,H.iframe.body.scrollWidth),h:Math.max(H.iframe.html.scrollHeight,H.iframe.body.scrollHeight)}};H.docscroll=$(H.iframe.body)}if(!M.isios&&J.iframeautoresize&&!H.isiframe){H.win.scrollTop(0);H.doc.height("");var c=Math.max(b.getElementsByTagName('html')[0].scrollHeight,b.body.scrollHeight);H.doc.height(c)}H.lazyResize(30);H.css($(H.iframe.body),o);if(M.isios&&H.haswrapper){H.css($(b.body),{'-webkit-transform':'translate3d(0,0,0)'})}if('contentWindow'in this){H.bind(this.contentWindow,"scroll",H.onscroll)}else{H.bind(b,"scroll",H.onscroll)}if(J.enablemousewheel){H.mousewheel(b,H.onmousewheel)}if(J.enablekeyboard)H.bind(b,(M.isopera)?"keypress":"keydown",H.onkeypress);if(M.cantouch){H.bind(b,"touchstart",H.ontouchstart);H.bind(b,"touchmove",H.ontouchmove)}else if(J.emulatetouch){H.bind(b,"mousedown",H.ontouchstart);H.bind(b,"mousemove",function(e){return H.ontouchmove(e,true)});if(J.grabcursorenabled&&M.cursorgrabvalue)H.css($(b.body),{'cursor':M.cursorgrabvalue})}H.bind(b,"mouseup",H.ontouchend);if(H.zoom){if(J.dblclickzoom)H.bind(b,'dblclick',H.doZoom);if(H.ongesturezoom)H.bind(b,"gestureend",H.ongesturezoom)}};if(this.doc[0].readyState&&this.doc[0].readyState==="complete"){setTimeout(function(){E.call(H.doc[0],false)},500)}H.bind(this.doc,"load",E)}};this.showCursor=function(a,b){if(H.cursortimeout){clearTimeout(H.cursortimeout);H.cursortimeout=0}if(!H.rail)return;if(H.autohidedom){H.autohidedom.stop().css({opacity:J.cursoropacitymax});H.cursoractive=true}if(!H.rail.drag||H.rail.drag.pt!=1){if(a!==undefined&&a!==false){H.scroll.y=(a/H.scrollratio.y)|0}if(b!==undefined){H.scroll.x=(b/H.scrollratio.x)|0}}H.cursor.css({height:H.cursorheight,top:H.scroll.y});if(H.cursorh){var c=(H.hasreversehr)?H.scrollvaluemaxw-H.scroll.x:H.scroll.x;H.cursorh.css({width:H.cursorwidth,left:(!H.rail.align&&H.rail.visibility)?c+H.rail.width:c});H.cursoractive=true}if(H.zoom)H.zoom.stop().css({opacity:J.cursoropacitymax})};this.hideCursor=function(a){if(H.cursortimeout)return;if(!H.rail)return;if(!H.autohidedom)return;if(H.hasmousefocus&&J.autohidemode==="leave")return;H.cursortimeout=setTimeout(function(){if(!H.rail.active||!H.showonmouseevent){H.autohidedom.stop().animate({opacity:J.cursoropacitymin});if(H.zoom)H.zoom.stop().animate({opacity:J.cursoropacitymin});H.cursoractive=false}H.cursortimeout=0},a||J.hidecursordelay)};this.noticeCursor=function(a,b,c){H.showCursor(b,c);if(!H.rail.active)H.hideCursor(a)};this.getContentSize=(H.ispage)?function(){return{w:Math.max(_doc.body.scrollWidth,_doc.documentElement.scrollWidth),h:Math.max(_doc.body.scrollHeight,_doc.documentElement.scrollHeight)}}:(H.haswrapper)?function(){return{w:H.doc[0].offsetWidth,h:H.doc[0].offsetHeight}}:function(){return{w:H.docscroll[0].scrollWidth,h:H.docscroll[0].scrollHeight}};this.onResize=function(e,a){if(!H||!H.win)return false;var b=H.page.maxh,premaxw=H.page.maxw,previewh=H.view.h,previeww=H.view.w;H.view={w:(H.ispage)?H.win.width():H.win[0].clientWidth,h:(H.ispage)?H.win.height():H.win[0].clientHeight};H.page=(a)?a:H.getContentSize();H.page.maxh=Math.max(0,H.page.h-H.view.h);H.page.maxw=Math.max(0,H.page.w-H.view.w);if((H.page.maxh==b)&&(H.page.maxw==premaxw)&&(H.view.w==previeww)&&(H.view.h==previewh)){if(!H.ispage){var c=H.win.offset();if(H.lastposition){var d=H.lastposition;if((d.top==c.top)&&(d.left==c.left))return H}H.lastposition=c}else{return H}}if(H.page.maxh===0){H.hideRail();H.scrollvaluemax=0;H.scroll.y=0;H.scrollratio.y=0;H.cursorheight=0;H.setScrollTop(0);if(H.rail)H.rail.scrollable=false}else{H.page.maxh-=(J.railpadding.top+J.railpadding.bottom);H.rail.scrollable=true}if(H.page.maxw===0){H.hideRailHr();H.scrollvaluemaxw=0;H.scroll.x=0;H.scrollratio.x=0;H.cursorwidth=0;H.setScrollLeft(0);if(H.railh){H.railh.scrollable=false}}else{H.page.maxw-=(J.railpadding.left+J.railpadding.right);if(H.railh)H.railh.scrollable=(J.horizrailenabled)}H.railslocked=(H.locked)||((H.page.maxh===0)&&(H.page.maxw===0));if(H.railslocked){if(!H.ispage)H.updateScrollBar(H.view);return false}if(!H.hidden){if(!H.rail.visibility)H.showRail();if(H.railh&&!H.railh.visibility)H.showRailHr()}if(H.istextarea&&H.win.css('resize')&&H.win.css('resize')!='none')H.view.h-=20;H.cursorheight=Math.min(H.view.h,Math.round(H.view.h*(H.view.h/H.page.h)));H.cursorheight=(J.cursorfixedheight)?J.cursorfixedheight:Math.max(J.cursorminheight,H.cursorheight);H.cursorwidth=Math.min(H.view.w,Math.round(H.view.w*(H.view.w/H.page.w)));H.cursorwidth=(J.cursorfixedheight)?J.cursorfixedheight:Math.max(J.cursorminheight,H.cursorwidth);H.scrollvaluemax=H.view.h-H.cursorheight-(J.railpadding.top+J.railpadding.bottom);if(!H.hasborderbox)H.scrollvaluemax-=H.cursor[0].offsetHeight-H.cursor[0].clientHeight;if(H.railh){H.railh.width=(H.page.maxh>0)?(H.view.w-H.rail.width):H.view.w;H.scrollvaluemaxw=H.railh.width-H.cursorwidth-(J.railpadding.left+J.railpadding.right)}if(!H.ispage)H.updateScrollBar(H.view);H.scrollratio={x:(H.page.maxw/H.scrollvaluemaxw),y:(H.page.maxh/H.scrollvaluemax)};var f=H.getScrollTop();if(f>H.page.maxh){H.doScrollTop(H.page.maxh)}else{H.scroll.y=(H.getScrollTop()/H.scrollratio.y)|0;H.scroll.x=(H.getScrollLeft()/H.scrollratio.x)|0;if(H.cursoractive)H.noticeCursor()}if(H.scroll.y&&(H.getScrollTop()===0))H.doScrollTo((H.scroll.y*H.scrollratio.y)|0);return H};this.resize=H.onResize;var Q=0;this.onscreenresize=function(e){clearTimeout(Q);var a=(!H.ispage&&!H.haswrapper);if(a)H.hideRails();Q=setTimeout(function(){if(H){if(a)H.showRails();H.resize()}Q=0},120)};this.lazyResize=function(a){clearTimeout(Q);a=isNaN(a)?240:a;Q=setTimeout(function(){H&&H.resize();Q=0},a);return H};function _modernWheelEvent(b,c,d,f){H._bind(b,c,function(e){e=e||_win.event;var a={original:e,target:e.target||e.srcElement,type:"wheel",deltaMode:e.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){e.preventDefault?e.preventDefault():e.returnValue=false;return false},stopImmediatePropagation:function(){(e.stopImmediatePropagation)?e.stopImmediatePropagation():e.cancelBubble=true}};if(c=="mousewheel"){e.wheelDeltaX&&(a.deltaX=-1/40*e.wheelDeltaX);e.wheelDeltaY&&(a.deltaY=-1/40*e.wheelDeltaY);!a.deltaY&&!a.deltaX&&(a.deltaY=-1/40*e.wheelDelta)}else{a.deltaY=e.detail}return d.call(b,a)},f)}this.jqbind=function(a,b,c){H.events.push({e:a,n:b,f:c,q:true});$(a).on(b,c)};this.mousewheel=function(a,b,c){var d=("jquery"in a)?a[0]:a;if("onwheel"in _doc.createElement("div")){H._bind(d,"wheel",b,c||false)}else{var e=(_doc.onmousewheel!==undefined)?"mousewheel":"DOMMouseScroll";_modernWheelEvent(d,e,b,c||false);if(e=="DOMMouseScroll")_modernWheelEvent(d,"MozMousePixelScroll",b,c||false)}};var R=false;if(M.haseventlistener){try{var S=Object.defineProperty({},"passive",{get:function(){R=!0}});_win.addEventListener("test",null,S)}catch(err){}this.stopPropagation=function(e){if(!e)return false;e=(e.original)?e.original:e;e.stopPropagation();return false};this.cancelEvent=function(e){if(e.cancelable)e.preventDefault();e.stopImmediatePropagation();if(e.preventManipulation)e.preventManipulation();return false}}else{Event.prototype.preventDefault=function(){this.returnValue=false};Event.prototype.stopPropagation=function(){this.cancelBubble=true};_win.constructor.prototype.addEventListener=_doc.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(a,b,c){this.attachEvent("on"+a,b)};_win.constructor.prototype.removeEventListener=_doc.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(a,b,c){this.detachEvent("on"+a,b)};this.cancelEvent=function(e){e=e||_win.event;if(e){e.cancelBubble=true;e.cancel=true;e.returnValue=false}return false};this.stopPropagation=function(e){e=e||_win.event;if(e)e.cancelBubble=true;return false}}this.delegate=function(c,d,f,g,h){var i=Y[d]||false;if(!i){i={a:[],l:[],f:function(e){var b=i.l,l=b.length-1;var r=false;for(var a=l;a>=0;a--){r=b[a].call(e.target,e);if(r===false)return false}return r}};H.bind(c,d,i.f,g,h);Y[d]=i}if(H.ispage){i.a=[H.id].concat(i.a);i.l=[f].concat(i.l)}else{i.a.push(H.id);i.l.push(f)}};this.undelegate=function(b,c,d,e,f){var g=Y[c]||false;if(g&&g.l){for(var a=0,l=g.l.length;a<l;a++){if(g.a[a]===H.id){g.a.splice(a);g.l.splice(a);if(g.a.length===0){H._unbind(b,c,g.l.f);Y[c]=null}}}}};this.bind=function(a,b,c,d,e){var f=("jquery"in a)?a[0]:a;H._bind(f,b,c,d||false,e||false)};this._bind=function(a,b,c,d,e){H.events.push({e:a,n:b,f:c,b:d,q:false});(R&&e)?a.addEventListener(b,c,{passive:false,capture:d}):a.addEventListener(b,c,d||false)};this._unbind=function(a,b,c,d){if(Y[b])H.undelegate(a,b,c,d);else a.removeEventListener(b,c,d)};this.unbindAll=function(){for(var a=0;a<H.events.length;a++){var r=H.events[a];(r.q)?r.e.unbind(r.n,r.f):H._unbind(r.e,r.n,r.f,r.b)}};this.showRails=function(){return H.showRail().showRailHr()};this.showRail=function(){if((H.page.maxh!==0)&&(H.ispage||H.win.css('display')!='none')){H.rail.visibility=true;H.rail.css('display','block')}return H};this.showRailHr=function(){if(H.railh){if((H.page.maxw!==0)&&(H.ispage||H.win.css('display')!='none')){H.railh.visibility=true;H.railh.css('display','block')}}return H};this.hideRails=function(){return H.hideRail().hideRailHr()};this.hideRail=function(){H.rail.visibility=false;H.rail.css('display','none');return H};this.hideRailHr=function(){if(H.railh){H.railh.visibility=false;H.railh.css('display','none')}return H};this.show=function(){H.hidden=false;H.railslocked=false;return H.showRails()};this.hide=function(){H.hidden=true;H.railslocked=true;return H.hideRails()};this.toggle=function(){return(H.hidden)?H.show():H.hide()};this.remove=function(){H.stop();if(H.cursortimeout)clearTimeout(H.cursortimeout);for(var n in H.delaylist)if(H.delaylist[n])ba(H.delaylist[n].h);H.doZoomOut();H.unbindAll();if(M.isie9)H.win[0].detachEvent("onpropertychange",H.onAttributeChange);if(H.observer!==false)H.observer.disconnect();if(H.observerremover!==false)H.observerremover.disconnect();if(H.observerbody!==false)H.observerbody.disconnect();H.events=null;if(H.cursor){H.cursor.remove()}if(H.cursorh){H.cursorh.remove()}if(H.rail){H.rail.remove()}if(H.railh){H.railh.remove()}if(H.zoom){H.zoom.remove()}for(var a=0;a<H.saved.css.length;a++){var d=H.saved.css[a];d[0].css(d[1],(d[2]===undefined)?'':d[2])}H.saved=false;H.me.data('__nicescroll','');var c=$.nicescroll;c.each(function(i){if(!this)return;if(this.id===H.id){delete c[i];for(var b=++i;b<c.length;b++,i++)c[i]=c[b];c.length--;if(c.length)delete c[c.length]}});for(var i in H){H[i]=null;delete H[i]}H=null};this.scrollstart=function(a){this.onscrollstart=a;return H};this.scrollend=function(a){this.onscrollend=a;return H};this.scrollcancel=function(a){this.onscrollcancel=a;return H};this.zoomin=function(a){this.onzoomin=a;return H};this.zoomout=function(a){this.onzoomout=a;return H};this.isScrollable=function(e){var a=(e.target)?e.target:e;if(a.nodeName=='OPTION')return true;while(a&&(a.nodeType==1)&&(a!==this.me[0])&&!(/^BODY|HTML/.test(a.nodeName))){var b=$(a);var c=b.css('overflowY')||b.css('overflowX')||b.css('overflow')||'';if(/scroll|auto/.test(c))return(a.clientHeight!=a.scrollHeight);a=(a.parentNode)?a.parentNode:false}return false};this.getViewport=function(a){var b=(a&&a.parentNode)?a.parentNode:false;while(b&&(b.nodeType==1)&&!(/^BODY|HTML/.test(b.nodeName))){var c=$(b);if(/fixed|absolute/.test(c.css("position")))return c;var d=c.css('overflowY')||c.css('overflowX')||c.css('overflow')||'';if((/scroll|auto/.test(d))&&(b.clientHeight!=b.scrollHeight))return c;if(c.getNiceScroll().length>0)return c;b=(b.parentNode)?b.parentNode:false}return false};this.triggerScrollStart=function(a,b,c,d,e){if(H.onscrollstart){var f={type:"scrollstart",current:{x:a,y:b},request:{x:c,y:d},end:{x:H.newscrollx,y:H.newscrolly},speed:e};H.onscrollstart.call(H,f)}};this.triggerScrollEnd=function(){if(H.onscrollend){var a=H.getScrollLeft();var b=H.getScrollTop();var c={type:"scrollend",current:{x:a,y:b},end:{x:a,y:b}};H.onscrollend.call(H,c)}};var T=0,scrolldirx=0,scrolltmr=0,scrollspd=1;function doScrollRelative(c,d,e,f){if(!H.scrollrunning){H.newscrolly=H.getScrollTop();H.newscrollx=H.getScrollLeft();scrolltmr=bd()}var g=(bd()-scrolltmr);scrolltmr=bd();if(g>350){scrollspd=1}else{scrollspd+=(2-scrollspd)/10}c=c*scrollspd|0;d=d*scrollspd|0;if(c){if(f){if(c<0){if(H.getScrollLeft()>=H.page.maxw)return true}else{if(H.getScrollLeft()<=0)return true}}var h=c>0?1:-1;if(scrolldirx!==h){if(H.scrollmom)H.scrollmom.stop();H.newscrollx=H.getScrollLeft();scrolldirx=h}H.lastdeltax-=c}if(d){var i=(function(){var a=H.getScrollTop();if(d<0){if(a>=H.page.maxh)return true}else{if(a<=0)return true}})();if(i){if(J.nativeparentscrolling&&e&&!H.ispage&&!H.zoomactive)return true;var j=H.view.h>>1;if(H.newscrolly<-j){H.newscrolly=-j;d=-1}else if(H.newscrolly>H.page.maxh+j){H.newscrolly=H.page.maxh+j;d=1}else d=0}var k=d>0?1:-1;if(T!==k){if(H.scrollmom)H.scrollmom.stop();H.newscrolly=H.getScrollTop();T=k}H.lastdeltay-=d}if(d||c){H.synched("relativexy",function(){var a=H.lastdeltay+H.newscrolly;H.lastdeltay=0;var b=H.lastdeltax+H.newscrollx;H.lastdeltax=0;if(!H.rail.drag)H.doScrollPos(b,a)})}}var U=false;function execScrollWheel(e,a,b){var c,py;if(!b&&U)return true;if(e.deltaMode===0){c=-(e.deltaX*(J.mousescrollstep/(18*3)))|0;py=-(e.deltaY*(J.mousescrollstep/(18*3)))|0}else if(e.deltaMode===1){c=-(e.deltaX*J.mousescrollstep*50/80)|0;py=-(e.deltaY*J.mousescrollstep*50/80)|0}if(a&&J.oneaxismousemode&&(c===0)&&py){c=py;py=0;if(b){var d=(c<0)?(H.getScrollLeft()>=H.page.maxw):(H.getScrollLeft()<=0);if(d){py=c;c=0}}}if(H.isrtlmode)c=-c;var f=doScrollRelative(c,py,b,true);if(f){if(b)U=true}else{U=false;e.stopImmediatePropagation();return e.preventDefault()}}this.onmousewheel=function(e){if(H.wheelprevented||H.locked)return false;if(H.railslocked){H.debounced("checkunlock",H.resize,250);return false}if(H.rail.drag)return H.cancelEvent(e);if(J.oneaxismousemode==="auto"&&e.deltaX!==0)J.oneaxismousemode=false;if(J.oneaxismousemode&&e.deltaX===0){if(!H.rail.scrollable){if(H.railh&&H.railh.scrollable){return H.onmousewheelhr(e)}else{return true}}}var a=bd();var b=false;if(J.preservenativescrolling&&((H.checkarea+600)<a)){H.nativescrollingarea=H.isScrollable(e);b=true}H.checkarea=a;if(H.nativescrollingarea)return true;var c=execScrollWheel(e,false,b);if(c)H.checkarea=0;return c};this.onmousewheelhr=function(e){if(H.wheelprevented)return;if(H.railslocked||!H.railh.scrollable)return true;if(H.rail.drag)return H.cancelEvent(e);var a=bd();var b=false;if(J.preservenativescrolling&&((H.checkarea+600)<a)){H.nativescrollingarea=H.isScrollable(e);b=true}H.checkarea=a;if(H.nativescrollingarea)return true;if(H.railslocked)return H.cancelEvent(e);return execScrollWheel(e,true,b)};this.stop=function(){H.cancelScroll();if(H.scrollmon)H.scrollmon.stop();H.cursorfreezed=false;H.scroll.y=Math.round(H.getScrollTop()*(1/H.scrollratio.y));H.noticeCursor();return H};this.getTransitionSpeed=function(a){return 80+(a/72)*J.scrollspeed|0};if(!J.smoothscroll){this.doScrollLeft=function(x,a){var y=H.getScrollTop();H.doScrollPos(x,y,a)};this.doScrollTop=function(y,a){var x=H.getScrollLeft();H.doScrollPos(x,y,a)};this.doScrollPos=function(x,y,a){var b=(x>H.page.maxw)?H.page.maxw:x;if(b<0)b=0;var c=(y>H.page.maxh)?H.page.maxh:y;if(c<0)c=0;H.synched('scroll',function(){H.setScrollTop(c);H.setScrollLeft(b)})};this.cancelScroll=function(){}}else if(H.ishwscroll&&M.hastransition&&J.usetransition&&!!J.smoothscroll){var V='';this.resetTransition=function(){V='';H.doc.css(M.prefixstyle+'transition-duration','0ms')};this.prepareTransition=function(a,b){var c=(b)?a:H.getTransitionSpeed(a);var d=c+'ms';if(V!==d){V=d;H.doc.css(M.prefixstyle+'transition-duration',d)}return c};this.doScrollLeft=function(x,a){var y=(H.scrollrunning)?H.newscrolly:H.getScrollTop();H.doScrollPos(x,y,a)};this.doScrollTop=function(y,a){var x=(H.scrollrunning)?H.newscrollx:H.getScrollLeft();H.doScrollPos(x,y,a)};this.cursorupdate={running:false,start:function(){var m=this;if(m.running)return;m.running=true;var a=function(){if(m.running)Z(a);H.showCursor(H.getScrollTop(),H.getScrollLeft());H.notifyScrollEvent(H.win[0])};Z(a)},stop:function(){this.running=false}};this.doScrollPos=function(x,y,a){var b=H.getScrollTop();var c=H.getScrollLeft();if(((H.newscrolly-b)*(y-b)<0)||((H.newscrollx-c)*(x-c)<0))H.cancelScroll();if(!J.bouncescroll){if(y<0)y=0;else if(y>H.page.maxh)y=H.page.maxh;if(x<0)x=0;else if(x>H.page.maxw)x=H.page.maxw}else{if(y<0)y=y/2|0;else if(y>H.page.maxh)y=H.page.maxh+(y-H.page.maxh)/2|0;if(x<0)x=x/2|0;else if(x>H.page.maxw)x=H.page.maxw+(x-H.page.maxw)/2|0}if(H.scrollrunning&&x==H.newscrollx&&y==H.newscrolly)return false;H.newscrolly=y;H.newscrollx=x;var d=H.getScrollTop();var e=H.getScrollLeft();var f={};f.x=x-e;f.y=y-d;var g=Math.sqrt((f.x*f.x)+(f.y*f.y))|0;var h=H.prepareTransition(g);if(!H.scrollrunning){H.scrollrunning=true;H.triggerScrollStart(e,d,x,y,h);H.cursorupdate.start()}H.scrollendtrapped=true;if(!M.transitionend){if(H.scrollendtrapped)clearTimeout(H.scrollendtrapped);H.scrollendtrapped=setTimeout(H.onScrollTransitionEnd,h)}H.setScrollTop(H.newscrolly);H.setScrollLeft(H.newscrollx)};this.cancelScroll=function(){if(!H.scrollendtrapped)return true;var a=H.getScrollTop();var b=H.getScrollLeft();H.scrollrunning=false;if(!M.transitionend)clearTimeout(M.transitionend);H.scrollendtrapped=false;H.resetTransition();H.setScrollTop(a);if(H.railh)H.setScrollLeft(b);if(H.timerscroll&&H.timerscroll.tm)clearInterval(H.timerscroll.tm);H.timerscroll=false;H.cursorfreezed=false;H.cursorupdate.stop();H.showCursor(a,b);return H};this.onScrollTransitionEnd=function(){if(!H.scrollendtrapped)return;var a=H.getScrollTop();var b=H.getScrollLeft();if(a<0)a=0;else if(a>H.page.maxh)a=H.page.maxh;if(b<0)b=0;else if(b>H.page.maxw)b=H.page.maxw;if((a!=H.newscrolly)||(b!=H.newscrollx))return H.doScrollPos(b,a,J.snapbackspeed);if(H.scrollrunning)H.triggerScrollEnd();H.scrollrunning=false;H.scrollendtrapped=false;H.resetTransition();H.timerscroll=false;H.setScrollTop(a);if(H.railh)H.setScrollLeft(b);H.cursorupdate.stop();H.noticeCursor(false,a,b);H.cursorfreezed=false}}else{this.doScrollLeft=function(x,a){var y=(H.scrollrunning)?H.newscrolly:H.getScrollTop();H.doScrollPos(x,y,a)};this.doScrollTop=function(y,a){var x=(H.scrollrunning)?H.newscrollx:H.getScrollLeft();H.doScrollPos(x,y,a)};this.doScrollPos=function(x,y,a){var b=H.getScrollTop();var c=H.getScrollLeft();if(((H.newscrolly-b)*(y-b)<0)||((H.newscrollx-c)*(x-c)<0))H.cancelScroll();var d=false;if(!H.bouncescroll||!H.rail.visibility){if(y<0){y=0;d=true}else if(y>H.page.maxh){y=H.page.maxh;d=true}}if(!H.bouncescroll||!H.railh.visibility){if(x<0){x=0;d=true}else if(x>H.page.maxw){x=H.page.maxw;d=true}}if(H.scrollrunning&&(H.newscrolly===y)&&(H.newscrollx===x))return true;H.newscrolly=y;H.newscrollx=x;H.dst={};H.dst.x=x-c;H.dst.y=y-b;H.dst.px=c;H.dst.py=b;var e=Math.sqrt((H.dst.x*H.dst.x)+(H.dst.y*H.dst.y))|0;var f=H.getTransitionSpeed(e);H.bzscroll={};var g=(d)?1:0.58;H.bzscroll.x=new N(c,H.newscrollx,f,0,0,g,1);H.bzscroll.y=new N(b,H.newscrolly,f,0,0,g,1);var h=bd();var i=function(){if(!H.scrollrunning)return;var x=H.bzscroll.y.getPos();H.setScrollLeft(H.bzscroll.x.getNow());H.setScrollTop(H.bzscroll.y.getNow());if(x<=1){H.timer=Z(i)}else{H.scrollrunning=false;H.timer=0;H.triggerScrollEnd()}};if(!H.scrollrunning){H.triggerScrollStart(c,b,x,y,f);H.scrollrunning=true;H.timer=Z(i)}};this.cancelScroll=function(){if(H.timer)ba(H.timer);H.timer=0;H.bzscroll=false;H.scrollrunning=false;return H}}this.doScrollBy=function(a,b){doScrollRelative(0,a)};this.doScrollLeftBy=function(a,b){doScrollRelative(a,0)};this.doScrollTo=function(a,b){var c=(b)?Math.round(a*H.scrollratio.y):a;if(c<0)c=0;else if(c>H.page.maxh)c=H.page.maxh;H.cursorfreezed=false;H.doScrollTop(a)};this.checkContentSize=function(){var a=H.getContentSize();if((a.h!=H.page.h)||(a.w!=H.page.w))H.resize(false,a)};H.onscroll=function(e){if(H.rail.drag)return;if(!H.cursorfreezed){H.synched('scroll',function(){H.scroll.y=Math.round(H.getScrollTop()/H.scrollratio.y);if(H.railh)H.scroll.x=Math.round(H.getScrollLeft()/H.scrollratio.x);H.noticeCursor()})}};H.bind(H.docscroll,"scroll",H.onscroll);this.doZoomIn=function(e){if(H.zoomactive)return;H.zoomactive=true;H.zoomrestore={style:{}};var b=['position','top','left','zIndex','backgroundColor','marginTop','marginBottom','marginLeft','marginRight'];var c=H.win[0].style;for(var a in b){var d=b[a];H.zoomrestore.style[d]=(c[d]!==undefined)?c[d]:''}H.zoomrestore.style.width=H.win.css('width');H.zoomrestore.style.height=H.win.css('height');H.zoomrestore.padding={w:H.win.outerWidth()-H.win.width(),h:H.win.outerHeight()-H.win.height()};if(M.isios4){H.zoomrestore.scrollTop=$window.scrollTop();$window.scrollTop(0)}H.win.css({position:(M.isios4)?"absolute":"fixed",top:0,left:0,zIndex:globalmaxzindex+100,margin:0});var f=H.win.css("backgroundColor");if(""===f||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(f))H.win.css("backgroundColor","#fff");H.rail.css({zIndex:globalmaxzindex+101});H.zoom.css({zIndex:globalmaxzindex+102});H.zoom.css('backgroundPosition','0 -18px');H.resizeZoom();if(H.onzoomin)H.onzoomin.call(H);return H.cancelEvent(e)};this.doZoomOut=function(e){if(!H.zoomactive)return;H.zoomactive=false;H.win.css("margin","");H.win.css(H.zoomrestore.style);if(M.isios4){$window.scrollTop(H.zoomrestore.scrollTop)}H.rail.css({"z-index":H.zindex});H.zoom.css({"z-index":H.zindex});H.zoomrestore=false;H.zoom.css('backgroundPosition','0 0');H.onResize();if(H.onzoomout)H.onzoomout.call(H);return H.cancelEvent(e)};this.doZoom=function(e){return(H.zoomactive)?H.doZoomOut(e):H.doZoomIn(e)};this.resizeZoom=function(){if(!H.zoomactive)return;var a=H.getScrollTop();H.win.css({width:$window.width()-H.zoomrestore.padding.w+"px",height:$window.height()-H.zoomrestore.padding.h+"px"});H.onResize();H.setScrollTop(Math.min(H.page.maxh,a))};this.init();$.nicescroll.push(this)};var bi=function(r){var s=this;this.nc=r;this.lastx=0;this.lasty=0;this.speedx=0;this.speedy=0;this.lasttime=0;this.steptime=0;this.snapx=false;this.snapy=false;this.demulx=0;this.demuly=0;this.lastscrollx=-1;this.lastscrolly=-1;this.chkx=0;this.chky=0;this.timer=0;this.reset=function(a,b){s.stop();s.steptime=0;s.lasttime=bd();s.speedx=0;s.speedy=0;s.lastx=a;s.lasty=b;s.lastscrollx=-1;s.lastscrolly=-1};this.update=function(a,b){var c=bd();s.steptime=c-s.lasttime;s.lasttime=c;var d=b-s.lasty;var e=a-s.lastx;var f=s.nc.getScrollTop();var g=s.nc.getScrollLeft();var h=f+d;var i=g+e;s.snapx=(i<0)||(i>s.nc.page.maxw);s.snapy=(h<0)||(h>s.nc.page.maxh);s.speedx=e;s.speedy=d;s.lastx=a;s.lasty=b};this.stop=function(){s.nc.unsynched("domomentum2d");if(s.timer)clearTimeout(s.timer);s.timer=0;s.lastscrollx=-1;s.lastscrolly=-1};this.doSnapy=function(a,b){var c=false;if(b<0){b=0;c=true}else if(b>s.nc.page.maxh){b=s.nc.page.maxh;c=true}if(a<0){a=0;c=true}else if(a>s.nc.page.maxw){a=s.nc.page.maxw;c=true}(c)?s.nc.doScrollPos(a,b,s.nc.opt.snapbackspeed):s.nc.triggerScrollEnd()};this.doMomentum=function(d){var t=bd();var l=(d)?t+d:s.lasttime;var e=s.nc.getScrollLeft();var f=s.nc.getScrollTop();var g=s.nc.page.maxh;var h=s.nc.page.maxw;s.speedx=(h>0)?Math.min(60,s.speedx):0;s.speedy=(g>0)?Math.min(60,s.speedy):0;var i=l&&(t-l)<=60;if((f<0)||(f>g)||(e<0)||(e>h))i=false;var j=(s.speedy&&i)?s.speedy:false;var k=(s.speedx&&i)?s.speedx:false;if(j||k){var m=Math.max(16,s.steptime);if(m>50){var n=m/50;s.speedx*=n;s.speedy*=n;m=50}s.demulxy=0;s.lastscrollx=s.nc.getScrollLeft();s.chkx=s.lastscrollx;s.lastscrolly=s.nc.getScrollTop();s.chky=s.lastscrolly;var o=s.lastscrollx;var p=s.lastscrolly;var q=function(){var c=((bd()-t)>600)?0.04:0.02;if(s.speedx){o=Math.floor(s.lastscrollx-(s.speedx*(1-s.demulxy)));s.lastscrollx=o;if((o<0)||(o>h))c=0.10}if(s.speedy){p=Math.floor(s.lastscrolly-(s.speedy*(1-s.demulxy)));s.lastscrolly=p;if((p<0)||(p>g))c=0.10}s.demulxy=Math.min(1,s.demulxy+c);s.nc.synched("domomentum2d",function(){if(s.speedx){var a=s.nc.getScrollLeft();s.chkx=o;s.nc.setScrollLeft(o)}if(s.speedy){var b=s.nc.getScrollTop();s.chky=p;s.nc.setScrollTop(p)}if(!s.timer){s.nc.hideCursor();s.doSnapy(o,p)}});if(s.demulxy<1){s.timer=setTimeout(q,m)}else{s.stop();s.nc.hideCursor();s.doSnapy(o,p)}};q()}else{s.doSnapy(s.nc.getScrollLeft(),s.nc.getScrollTop())}}};var bj=W.fn.scrollTop;W.cssHooks.pageYOffset={get:function(a,b,c){var d=$.data(a,'__nicescroll')||false;return(d&&d.ishwscroll)?d.getScrollTop():bj.call(a)},set:function(a,b){var c=$.data(a,'__nicescroll')||false;(c&&c.ishwscroll)?c.setScrollTop(parseInt(b)):bj.call(a,b);return this}};W.fn.scrollTop=function(b){if(b===undefined){var c=(this[0])?$.data(this[0],'__nicescroll')||false:false;return(c&&c.ishwscroll)?c.getScrollTop():bj.call(this)}else{return this.each(function(){var a=$.data(this,'__nicescroll')||false;(a&&a.ishwscroll)?a.setScrollTop(parseInt(b)):bj.call($(this),b)})}};var bk=W.fn.scrollLeft;$.cssHooks.pageXOffset={get:function(a,b,c){var d=$.data(a,'__nicescroll')||false;return(d&&d.ishwscroll)?d.getScrollLeft():bk.call(a)},set:function(a,b){var c=$.data(a,'__nicescroll')||false;(c&&c.ishwscroll)?c.setScrollLeft(parseInt(b)):bk.call(a,b);return this}};W.fn.scrollLeft=function(b){if(b===undefined){var c=(this[0])?$.data(this[0],'__nicescroll')||false:false;return(c&&c.ishwscroll)?c.getScrollLeft():bk.call(this)}else{return this.each(function(){var a=$.data(this,'__nicescroll')||false;(a&&a.ishwscroll)?a.setScrollLeft(parseInt(b)):bk.call($(this),b)})}};var bl=function(b){var c=this;this.length=0;this.name="nicescrollarray";this.each=function(a){$.each(c,a);return c};this.push=function(a){c[c.length]=a;c.length++};this.eq=function(a){return c[a]};if(b){for(var a=0;a<b.length;a++){var d=$.data(b[a],'__nicescroll')||false;if(d){this[this.length]=d;this.length++}}}return this};function mplex(b,c,d){for(var a=0,l=c.length;a<l;a++)d(b,c[a])}mplex(bl.prototype,['show','hide','toggle','onResize','resize','remove','stop','doScrollPos'],function(e,n){e[n]=function(){var a=arguments;return this.each(function(){this[n].apply(this,a)})}});W.fn.getNiceScroll=function(a){if(a===undefined){return new bl(this)}else{return this[a]&&$.data(this[a],'__nicescroll')||false}};var bm=W.expr.pseudos||W.expr[':'];bm.nicescroll=function(a){return $.data(a,'__nicescroll')!==undefined};$.fn.niceScroll=function(f,g){if(g===undefined&&typeof f=="object"&&!("jquery"in f)){g=f;f=false}var h=new bl();this.each(function(){var a=$(this);var b=$.extend({},g);if(f||false){var c=$(f);b.doc=(c.length>1)?$(f,a):c;b.win=a}var d=!("doc"in b);if(!d&&!("win"in b))b.win=a;var e=a.data('__nicescroll')||false;if(!e){b.doc=b.doc||a;e=new bh(b,a);a.data('__nicescroll',e)}h.push(e)});return(h.length===1)?h[0]:h};_win.NiceScroll={getjQuery:function(){return W}};if(!$.nicescroll){$.nicescroll=new bl();$.nicescroll.options=be}}));