(function(e){function t(t,r,s,n,a){function l(){m.unbind("webkitTransitionEnd transitionend otransitionend oTransitionEnd");r&&o(r,s,n,a);a.startOrder=[];a.newOrder=[];a.origSort=[];a.checkSort=[];p.removeStyle(a.prefix+"filter, filter, "+a.prefix+"transform, transform, opacity, display").css(a.clean).removeAttr("data-checksum");window.atob||p.css({display:"none",opacity:"0"});m.removeStyle(a.prefix+"transition, transition, "+a.prefix+"perspective, perspective, "+a.prefix+"perspective-origin, perspective-origin, "+(a.resizeContainer?"height":""));"list"==a.layoutMode?(f.css({display:a.targetDisplayList,opacity:"1"}),a.origDisplay=a.targetDisplayList):(f.css({display:a.targetDisplayGrid,opacity:"1"}),a.origDisplay=a.targetDisplayGrid);a.origLayout=a.layoutMode;setTimeout(function(){p.removeStyle(a.prefix+"transition, transition");a.mixing=!1;if("function"==typeof a.onMixEnd){var e=a.onMixEnd.call(this,a);a=e?e:a}})}clearInterval(a.failsafe);a.mixing=!0;a.filter=t;if("function"==typeof a.onMixStart){var c=a.onMixStart.call(this,a);a=c?c:a}for(var d=a.transitionSpeed,c=0;2>c;c++){var u=0==c?u=a.prefix:"";a.transition[u+"transition"]="all "+d+"ms linear";a.transition[u+"transform"]=u+"translate3d(0,0,0)";a.perspective[u+"perspective"]=a.perspectiveDistance+"px";a.perspective[u+"perspective-origin"]=a.perspectiveOrigin}var h=a.targetSelector,p=n.find(h);p.each(function(){this.data={}});var m=p.parent();m.css(a.perspective);a.easingFallback="ease-in-out";"smooth"==a.easing&&(a.easing="cubic-bezier(0.25, 0.46, 0.45, 0.94)");"snap"==a.easing&&(a.easing="cubic-bezier(0.77, 0, 0.175, 1)");"windback"==a.easing&&(a.easing="cubic-bezier(0.175, 0.885, 0.320, 1.275)",a.easingFallback="cubic-bezier(0.175, 0.885, 0.320, 1)");"windup"==a.easing&&(a.easing="cubic-bezier(0.6, -0.28, 0.735, 0.045)",a.easingFallback="cubic-bezier(0.6, 0.28, 0.735, 0.045)");c="list"==a.layoutMode&&null!=a.listEffects?a.listEffects:a.effects;Array.prototype.indexOf&&(a.fade=-1<c.indexOf("fade")?"0":"",a.scale=-1<c.indexOf("scale")?"scale(.01)":"",a.rotateZ=-1<c.indexOf("rotateZ")?"rotate(180deg)":"",a.rotateY=-1<c.indexOf("rotateY")?"rotateY(90deg)":"",a.rotateX=-1<c.indexOf("rotateX")?"rotateX(90deg)":"",a.blur=-1<c.indexOf("blur")?"blur(8px)":"",a.grayscale=-1<c.indexOf("grayscale")?"grayscale(100%)":"");var f=e(),g=e(),w=[],v=!1;"string"===typeof t?w=i(t):(v=!0,e.each(t,function(e){w[e]=i(this)}));"or"==a.filterLogic?(""==w[0]&&w.shift(),1>w.length?g=g.add(n.find(h+":visible")):p.each(function(){var t=e(this);if(v){var o=0;e.each(w,function(){this.length?t.is("."+this.join(", ."))&&o++:0<o&&o++});o==w.length?f=f.add(t):g=g.add(t)}else t.is("."+w.join(", ."))?f=f.add(t):g=g.add(t)})):(f=f.add(m.find(h+"."+w.join("."))),g=g.add(m.find(h+":not(."+w.join(".")+"):visible")));t=f.length;var y=e(),b=e(),x=e();g.each(function(){var t=e(this);"none"!=t.css("display")&&(y=y.add(t),x=x.add(t))});if(f.filter(":visible").length==t&&!y.length&&!r){if(a.origLayout==a.layoutMode)return l(),!1;if(1==f.length)return"list"==a.layoutMode?(n.addClass(a.listClass),n.removeClass(a.gridClass),x.css("display",a.targetDisplayList)):(n.addClass(a.gridClass),n.removeClass(a.listClass),x.css("display",a.targetDisplayGrid)),l(),!1}a.origHeight=m.height();if(f.length){n.removeClass(a.failClass);f.each(function(){var t=e(this);"none"==t.css("display")?b=b.add(t):x=x.add(t)});if(a.origLayout!=a.layoutMode&&!1==a.animateGridList)return"list"==a.layoutMode?(n.addClass(a.listClass),n.removeClass(a.gridClass),x.css("display",a.targetDisplayList)):(n.addClass(a.gridClass),n.removeClass(a.listClass),x.css("display",a.targetDisplayGrid)),l(),!1;if(!window.atob)return l(),!1;p.css(a.clean);x.each(function(){this.data.origPos=e(this).offset()});"list"==a.layoutMode?(n.addClass(a.listClass),n.removeClass(a.gridClass),b.css("display",a.targetDisplayList)):(n.addClass(a.gridClass),n.removeClass(a.listClass),b.css("display",a.targetDisplayGrid));b.each(function(){this.data.showInterPos=e(this).offset()});y.each(function(){this.data.hideInterPos=e(this).offset()});x.each(function(){this.data.preInterPos=e(this).offset()});"list"==a.layoutMode?x.css("display",a.targetDisplayList):x.css("display",a.targetDisplayGrid);r&&o(r,s,n,a);if(t=r)e:if(t=a.origSort,c=a.checkSort,t.length!=c.length)t=!1;else{for(u=0;u<c.length;u++)if(t[u].compare&&!t[u].compare(c[u])||t[u]!==c[u]){t=!1;break e}t=!0}if(t)return l(),!1;y.hide();b.each(function(){this.data.finalPos=e(this).offset()});x.each(function(){this.data.finalPrePos=e(this).offset()});a.newHeight=m.height();r&&o("reset",null,n,a);b.hide();x.css("display",a.origDisplay);"block"==a.origDisplay?(n.addClass(a.listClass),b.css("display",a.targetDisplayList)):(n.removeClass(a.listClass),b.css("display",a.targetDisplayGrid));a.resizeContainer&&m.css("height",a.origHeight+"px");t={};for(c=0;2>c;c++)u=0==c?u=a.prefix:"",t[u+"transform"]=a.scale+" "+a.rotateX+" "+a.rotateY+" "+a.rotateZ,t[u+"filter"]=a.blur+" "+a.grayscale;b.css(t);x.each(function(){var t=this.data,o=e(this);o.hasClass("mix_tohide")?(t.preTX=t.origPos.left-t.hideInterPos.left,t.preTY=t.origPos.top-t.hideInterPos.top):(t.preTX=t.origPos.left-t.preInterPos.left,t.preTY=t.origPos.top-t.preInterPos.top);for(var i={},r=0;2>r;r++){var s=0==r?s=a.prefix:"";i[s+"transform"]="translate("+t.preTX+"px,"+t.preTY+"px)"}o.css(i)});"list"==a.layoutMode?(n.addClass(a.listClass),n.removeClass(a.gridClass)):(n.addClass(a.gridClass),n.removeClass(a.listClass));setTimeout(function(){if(a.resizeContainer){for(var t={},o=0;2>o;o++){var i=0==o?i=a.prefix:"";t[i+"transition"]="all "+d+"ms ease-in-out";t.height=a.newHeight+"px"}m.css(t)}y.css("opacity",a.fade);b.css("opacity",1);b.each(function(){var t=this.data;t.tX=t.finalPos.left-t.showInterPos.left;t.tY=t.finalPos.top-t.showInterPos.top;for(var o={},i=0;2>i;i++){var r=0==i?r=a.prefix:"";o[r+"transition-property"]=r+"transform, "+r+"filter, opacity";o[r+"transition-timing-function"]=a.easing+", linear, linear";o[r+"transition-duration"]=d+"ms";o[r+"transition-delay"]="0";o[r+"transform"]="translate("+t.tX+"px,"+t.tY+"px)";o[r+"filter"]="none"}e(this).css("-webkit-transition","all "+d+"ms "+a.easingFallback).css(o)});x.each(function(){var t=this.data;t.tX=0!=t.finalPrePos.left?t.finalPrePos.left-t.preInterPos.left:0;t.tY=0!=t.finalPrePos.left?t.finalPrePos.top-t.preInterPos.top:0;for(var o={},i=0;2>i;i++){var r=0==i?r=a.prefix:"";o[r+"transition"]="all "+d+"ms "+a.easing;o[r+"transform"]="translate("+t.tX+"px,"+t.tY+"px)"}e(this).css("-webkit-transition","all "+d+"ms "+a.easingFallback).css(o)});t={};for(o=0;2>o;o++)i=0==o?i=a.prefix:"",t[i+"transition"]="all "+d+"ms "+a.easing+", "+i+"filter "+d+"ms linear, opacity "+d+"ms linear",t[i+"transform"]=a.scale+" "+a.rotateX+" "+a.rotateY+" "+a.rotateZ,t[i+"filter"]=a.blur+" "+a.grayscale,t.opacity=a.fade;y.css(t);m.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd",function(t){if(-1<t.originalEvent.propertyName.indexOf("transform")||-1<t.originalEvent.propertyName.indexOf("opacity"))-1<h.indexOf(".")?e(t.target).hasClass(h.replace(".",""))&&l():e(t.target).is(h)&&l()})},10);a.failsafe=setTimeout(function(){a.mixing&&l()},d+400)}else{a.resizeContainer&&m.css("height",a.origHeight+"px");if(!window.atob)return l(),!1;y=g;setTimeout(function(){m.css(a.perspective);if(a.resizeContainer){for(var e={},t=0;2>t;t++){var o=0==t?o=a.prefix:"";e[o+"transition"]="height "+d+"ms ease-in-out";e.height=a.minHeight+"px"}m.css(e)}p.css(a.transition);if(g.length){e={};for(t=0;2>t;t++)o=0==t?o=a.prefix:"",e[o+"transform"]=a.scale+" "+a.rotateX+" "+a.rotateY+" "+a.rotateZ,e[o+"filter"]=a.blur+" "+a.grayscale,e.opacity=a.fade;y.css(e);m.bind("webkitTransitionEnd transitionend otransitionend oTransitionEnd",function(e){if(-1<e.originalEvent.propertyName.indexOf("transform")||-1<e.originalEvent.propertyName.indexOf("opacity"))n.addClass(a.failClass),l()})}else a.mixing=!1},10)}}function o(t,o,i,r){function s(e,o){var i=isNaN(1*e.attr(t))?e.attr(t).toLowerCase():1*e.attr(t),r=isNaN(1*o.attr(t))?o.attr(t).toLowerCase():1*o.attr(t);return i<r?-1:i>r?1:0}function n(e){"asc"==o?a.prepend(e).prepend(" "):a.append(e).append(" ")}i.find(r.targetSelector).wrapAll('<div class="mix_sorter"/>');var a=i.find(".mix_sorter");r.origSort.length||a.find(r.targetSelector+":visible").each(function(){e(this).wrap("<s/>");r.origSort.push(e(this).parent().html().replace(/\s+/g,""));e(this).unwrap()});a.empty();if("reset"==t)e.each(r.startOrder,function(){a.append(this).append(" ")});else if("default"==t)e.each(r.origOrder,function(){n(this)});else if("random"==t){if(!r.newOrder.length){for(var l=r.startOrder.slice(),c=l.length,d=c;d--;){var u=parseInt(Math.random()*c),h=l[d];l[d]=l[u];l[u]=h}r.newOrder=l}e.each(r.newOrder,function(){a.append(this).append(" ")})}else if("custom"==t)e.each(o,function(){n(this)});else{if("undefined"===typeof r.origOrder[0].attr(t))return console.log("No such attribute found. Terminating"),!1;r.newOrder.length||(e.each(r.origOrder,function(){r.newOrder.push(e(this))}),r.newOrder.sort(s));e.each(r.newOrder,function(){n(this)})}r.checkSort=[];a.find(r.targetSelector+":visible").each(function(t){var o=e(this);0==t&&o.attr("data-checksum","1");o.wrap("<s/>");r.checkSort.push(o.parent().html().replace(/\s+/g,""));o.unwrap()});i.find(r.targetSelector).unwrap()}function i(t){t=t.replace(/\s{2,}/g," ");var o=t.split(" ");e.each(o,function(e){"all"==this&&(o[e]="mix_all")});""==o[0]&&o.shift();return o}var r={init:function(i){return this.each(function(){var r={targetSelector:".mix",filterSelector:".filter",sortSelector:".sort",buttonEvent:"click",effects:["fade","scale"],listEffects:null,easing:"smooth",layoutMode:"grid",targetDisplayGrid:"inline-block",targetDisplayList:"block",listClass:"",gridClass:"",transitionSpeed:600,showOnLoad:"all",sortOnLoad:!1,multiFilter:!1,filterLogic:"or",resizeContainer:!0,minHeight:0,failClass:"fail",perspectiveDistance:"3000",perspectiveOrigin:"50% 50%",animateGridList:!0,onMixLoad:null,onMixStart:null,onMixEnd:null,container:null,origOrder:[],startOrder:[],newOrder:[],origSort:[],checkSort:[],filter:"",mixing:!1,origDisplay:"",origLayout:"",origHeight:0,newHeight:0,isTouch:!1,resetDelay:0,failsafe:null,prefix:"",easingFallback:"ease-in-out",transition:{},perspective:{},clean:{},fade:"1",scale:"",rotateX:"",rotateY:"",rotateZ:"",blur:"",grayscale:""};i&&e.extend(r,i);this.config=r;e.support.touch="ontouchend"in document;e.support.touch&&(r.isTouch=!0,r.resetDelay=350);r.container=e(this);var s=r.container,n;e:{n=s[0];for(var a=["Webkit","Moz","O","ms"],l=0;l<a.length;l++)if(a[l]+"Transition" in n.style){n=a[l];break e}n="transition"in n.style?"":!1}r.prefix=n;r.prefix=r.prefix?"-"+r.prefix.toLowerCase()+"-":"";s.find(r.targetSelector).each(function(){r.origOrder.push(e(this))});if(r.sortOnLoad){var c;e.isArray(r.sortOnLoad)?(n=r.sortOnLoad[0],c=r.sortOnLoad[1],e(r.sortSelector+"[data-sort="+r.sortOnLoad[0]+"][data-order="+r.sortOnLoad[1]+"]").addClass("active")):(e(r.sortSelector+"[data-sort="+r.sortOnLoad+"]").addClass("active"),n=r.sortOnLoad,r.sortOnLoad="desc");o(n,c,s,r)}for(c=0;2>c;c++)n=0==c?n=r.prefix:"",r.transition[n+"transition"]="all "+r.transitionSpeed+"ms ease-in-out",r.perspective[n+"perspective"]=r.perspectiveDistance+"px",r.perspective[n+"perspective-origin"]=r.perspectiveOrigin;for(c=0;2>c;c++)n=0==c?n=r.prefix:"",r.clean[n+"transition"]="none";"list"==r.layoutMode?(s.addClass(r.listClass),r.origDisplay=r.targetDisplayList):(s.addClass(r.gridClass),r.origDisplay=r.targetDisplayGrid);r.origLayout=r.layoutMode;c=r.showOnLoad.split(" ");e.each(c,function(){e(r.filterSelector+'[data-filter="'+this+'"]').addClass("active")});s.find(r.targetSelector).addClass("mix_all");"all"==c[0]&&(c[0]="mix_all",r.showOnLoad="mix_all");var d=e();e.each(c,function(){d=d.add(e("."+this))});d.each(function(){var t=e(this);"list"==r.layoutMode?t.css("display",r.targetDisplayList):t.css("display",r.targetDisplayGrid);t.css(r.transition)});setTimeout(function(){r.mixing=!0;d.css("opacity","1");setTimeout(function(){"list"==r.layoutMode?d.removeStyle(r.prefix+"transition, transition").css({display:r.targetDisplayList,opacity:1}):d.removeStyle(r.prefix+"transition, transition").css({display:r.targetDisplayGrid,opacity:1});r.mixing=!1;if("function"==typeof r.onMixLoad){var e=r.onMixLoad.call(this,r);r=e?e:r}},r.transitionSpeed)},10);r.filter=r.showOnLoad;e(r.sortSelector).bind(r.buttonEvent,function(){if(!r.mixing){var o=e(this),i=o.attr("data-sort"),n=o.attr("data-order");if(o.hasClass("active")){if("random"!=i)return!1}else e(r.sortSelector).removeClass("active"),o.addClass("active");s.find(r.targetSelector).each(function(){r.startOrder.push(e(this))});t(r.filter,i,n,s,r)}});e(r.filterSelector).bind(r.buttonEvent,function(){if(!r.mixing){var o=e(this);if(!1==r.multiFilter)e(r.filterSelector).removeClass("active"),o.addClass("active"),r.filter=o.attr("data-filter"),e(r.filterSelector+'[data-filter="'+r.filter+'"]').addClass("active");else{var i=o.attr("data-filter");o.hasClass("active")?(o.removeClass("active"),r.filter=r.filter.replace(RegExp("(\\s|^)"+i),"")):(o.addClass("active"),r.filter=r.filter+" "+i)}t(r.filter,null,null,s,r)}})})},toGrid:function(){return this.each(function(){var o=this.config;"grid"!=o.layoutMode&&(o.layoutMode="grid",t(o.filter,null,null,e(this),o))})},toList:function(){return this.each(function(){var o=this.config;"list"!=o.layoutMode&&(o.layoutMode="list",t(o.filter,null,null,e(this),o))})},filter:function(o){return this.each(function(){var i=this.config;i.mixing||(e(i.filterSelector).removeClass("active"),e(i.filterSelector+'[data-filter="'+o+'"]').addClass("active"),t(o,null,null,e(this),i))})},sort:function(o){return this.each(function(){var i=this.config,r=e(this);if(!i.mixing){e(i.sortSelector).removeClass("active");if(e.isArray(o)){var s=o[0],n=o[1];e(i.sortSelector+'[data-sort="'+o[0]+'"][data-order="'+o[1]+'"]').addClass("active")}else e(i.sortSelector+'[data-sort="'+o+'"]').addClass("active"),s=o,n="desc";r.find(i.targetSelector).each(function(){i.startOrder.push(e(this))});t(i.filter,s,n,r,i)}})},multimix:function(o){return this.each(function(){var i=this.config,r=e(this);multiOut={filter:i.filter,sort:null,order:"desc",layoutMode:i.layoutMode};e.extend(multiOut,o);i.mixing||(e(i.filterSelector).add(i.sortSelector).removeClass("active"),e(i.filterSelector+'[data-filter="'+multiOut.filter+'"]').addClass("active"),"undefined"!==typeof multiOut.sort&&(e(i.sortSelector+'[data-sort="'+multiOut.sort+'"][data-order="'+multiOut.order+'"]').addClass("active"),r.find(i.targetSelector).each(function(){i.startOrder.push(e(this))})),i.layoutMode=multiOut.layoutMode,t(multiOut.filter,multiOut.sort,multiOut.order,r,i))})},remix:function(o){return this.each(function(){var i=this.config,r=e(this);i.origOrder=[];r.find(i.targetSelector).each(function(){var t=e(this);t.addClass("mix_all");i.origOrder.push(t)});!i.mixing&&"undefined"!==typeof o&&(e(i.filterSelector).removeClass("active"),e(i.filterSelector+'[data-filter="'+o+'"]').addClass("active"),t(o,null,null,r,i))})}};e.fn.mixitup=function(e,t){if(r[e])return r[e].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof e||!e)return r.init.apply(this,arguments)};e.fn.removeStyle=function(t){return this.each(function(){var o=e(this);t=t.replace(/\s+/g,"");var i=t.split(",");e.each(i,function(){var e=RegExp(this.toString()+"[^;]+;?","g");o.attr("style",function(t,o){if(o)return o.replace(e,"")})})})}})(jQuery);(function(e){"function"===typeof define&&define.amd?define(["jquery"],e):"object"===typeof exports?module.exports=e(require("jquery")):e(jQuery)})(function(e){var t=!1,o=!1,i=0,r=2e3,s=0,n=["webkit","ms","moz","o"],a=window.requestAnimationFrame||!1,l=window.cancelAnimationFrame||!1;if(!a)for(var c in n){var d=n[c];if(a=window[d+"RequestAnimationFrame"]){l=window[d+"CancelAnimationFrame"]||window[d+"CancelRequestAnimationFrame"];break}}var u=window.MutationObserver||window.WebKitMutationObserver||!1,h={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=document.getElementsByTagName("script"),e=e.length?e[e.length-1].src.split("?")[0]:"";return 0<e.split("/").length?e.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1},p=!1,m=function(){if(p)return p;var e=document.createElement("DIV"),t=e.style,o=navigator.userAgent,i=navigator.platform,r={haspointerlock:"pointerLockElement"in document||"webkitPointerLockElement"in document||"mozPointerLockElement"in document};r.isopera="opera"in window;r.isopera12=r.isopera&&"getUserMedia"in navigator;r.isoperamini="[object OperaMini]"===Object.prototype.toString.call(window.operamini);r.isie="all"in document&&"attachEvent"in e&&!r.isopera;r.isieold=r.isie&&!("msInterpolationMode"in t);r.isie7=r.isie&&!r.isieold&&(!("documentMode"in document)||7==document.documentMode);r.isie8=r.isie&&"documentMode"in document&&8==document.documentMode;r.isie9=r.isie&&"performance"in window&&9==document.documentMode;r.isie10=r.isie&&"performance"in window&&10==document.documentMode;r.isie11="msRequestFullscreen"in e&&11<=document.documentMode;r.isieedge12=navigator.userAgent.match(/Edge\/12\./);r.isieedge="msOverflowStyle"in e;r.ismodernie=r.isie11||r.isieedge;r.isie9mobile=/iemobile.9/i.test(o);r.isie9mobile&&(r.isie9=!1);r.isie7mobile=!r.isie9mobile&&r.isie7&&/iemobile/i.test(o);r.ismozilla="MozAppearance"in t;r.iswebkit="WebkitAppearance"in t;r.ischrome="chrome"in window;r.ischrome38=r.ischrome&&"touchAction"in t;r.ischrome22=!r.ischrome38&&r.ischrome&&r.haspointerlock;r.ischrome26=!r.ischrome38&&r.ischrome&&"transition"in t;r.cantouch="ontouchstart"in document.documentElement||"ontouchstart"in window;r.hasw3ctouch=(window.PointerEvent||!1)&&(0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints);r.hasmstouch=!r.hasw3ctouch&&(window.MSPointerEvent||!1);r.ismac=/^mac$/i.test(i);r.isios=r.cantouch&&/iphone|ipad|ipod/i.test(i);r.isios4=r.isios&&!("seal"in Object);r.isios7=r.isios&&"webkitHidden"in document;r.isios8=r.isios&&"hidden"in document;r.isandroid=/android/i.test(o);r.haseventlistener="addEventListener"in e;r.trstyle=!1;r.hastransform=!1;r.hastranslate3d=!1;r.transitionstyle=!1;r.hastransition=!1;r.transitionend=!1;i=["transform","msTransform","webkitTransform","MozTransform","OTransform"];for(o=0;o<i.length;o++)if(void 0!==t[i[o]]){r.trstyle=i[o];break}r.hastransform=!!r.trstyle;r.hastransform&&(t[r.trstyle]="translate3d(1px,2px,3px)",r.hastranslate3d=/translate3d/.test(t[r.trstyle]));r.transitionstyle=!1;r.prefixstyle="";r.transitionend=!1;for(var i="transition webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),s=" -webkit- -ms- -moz- -o- -o -khtml-".split(" "),n="transitionend webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),o=0;o<i.length;o++)if(i[o]in t){r.transitionstyle=i[o];r.prefixstyle=s[o];r.transitionend=n[o];break}r.ischrome26&&(r.prefixstyle=s[1]);r.hastransition=r.transitionstyle;e:{o=["grab","-webkit-grab","-moz-grab"];if(r.ischrome&&!r.ischrome38||r.isie)o=[];for(i=0;i<o.length;i++)if(s=o[i],t.cursor=s,t.cursor==s){t=s;break e}t="url(//patriciaportfolio.googlecode.com/files/openhand.cur),n-resize"}r.cursorgrabvalue=t;r.hasmousecapture="setCapture"in e;r.hasMutationObserver=!1!==u;return p=r},f=function(n,c){function d(){var e=y.doc.css(S.trstyle);return e&&"matrix"==e.substr(0,6)?e.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function p(){var e=y.win;if("zIndex"in e)return e.zIndex();for(;0<e.length&&9!=e[0].nodeType;){var t=e.css("zIndex");if(!isNaN(t)&&0!=t)return parseInt(t);e=e.parent()}return!1}function f(e,t,o){t=e.css(t);e=parseFloat(t);return isNaN(e)?(e=M[t]||0,o=3==e?o?y.win.outerHeight()-y.win.innerHeight():y.win.outerWidth()-y.win.innerWidth():1,y.isie8&&e&&(e+=1),o?e:0):e}function w(e,t,o,i){y._bind(e,t,function(i){i=i?i:window.event;var r={original:i,target:i.target||i.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==i.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){i.preventDefault?i.preventDefault():i.returnValue=!1;return!1},stopImmediatePropagation:function(){i.stopImmediatePropagation?i.stopImmediatePropagation():i.cancelBubble=!0}};"mousewheel"==t?(i.wheelDeltaX&&(r.deltaX=-.025*i.wheelDeltaX),i.wheelDeltaY&&(r.deltaY=-.025*i.wheelDeltaY),r.deltaY||r.deltaX||(r.deltaY=-.025*i.wheelDelta)):r.deltaY=i.detail;return o.call(e,r)},i)}function v(e,t,o){var i,r;0==e.deltaMode?(i=-Math.floor(y.opt.mousescrollstep/54*e.deltaX),r=-Math.floor(y.opt.mousescrollstep/54*e.deltaY)):1==e.deltaMode&&(i=-Math.floor(e.deltaX*y.opt.mousescrollstep),r=-Math.floor(e.deltaY*y.opt.mousescrollstep));t&&y.opt.oneaxismousemode&&0==i&&r&&(i=r,r=0,o&&(0>i?y.getScrollLeft()>=y.page.maxw:0>=y.getScrollLeft())&&(r=i,i=0));y.isrtlmode&&(i=-i);i&&(y.scrollmom&&y.scrollmom.stop(),y.lastdeltax+=i,y.debounced("mousewheelx",function(){var e=y.lastdeltax;y.lastdeltax=0;y.rail.drag||y.doScrollLeftBy(e)},15));if(r){if(y.opt.nativeparentscrolling&&o&&!y.ispage&&!y.zoomactive){if(0>r){if(y.getScrollTop()>=y.page.maxh)return!0}else if(0>=y.getScrollTop())return!0}y.scrollmom&&y.scrollmom.stop();y.lastdeltay+=r;y.synched("mousewheely",function(){var e=y.lastdeltay;y.lastdeltay=0;y.rail.drag||y.doScrollBy(e)},15)}e.stopImmediatePropagation();return e.preventDefault()}var y=this;this.version="3.6.8";this.name="nicescroll";this.me=c;this.opt={doc:e("body"),win:!1};e.extend(this.opt,h);this.opt.snapbackspeed=80;if(n)for(var b in y.opt)void 0!==n[b]&&(y.opt[b]=n[b]);y.opt.disablemutationobserver&&(u=!1);this.iddoc=(this.doc=y.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(y.opt.win?y.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==y.opt.win;this.win=y.opt.win||(this.ispage?e(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?e(window):this.win;this.body=e("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=y.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;if("auto"==this.opt.rtlmode){b=this.win[0]==window?this.body:this.win;var x=b.css("writing-mode")||b.css("-webkit-writing-mode")||b.css("-ms-writing-mode")||b.css("-moz-writing-mode");"horizontal-tb"==x||"lr-tb"==x||""==x?(this.isrtlmode="rtl"==b.css("direction"),this.isvertical=!1):(this.isrtlmode="vertical-rl"==x||"tb"==x||"tb-rl"==x||"rl-tb"==x,this.isvertical="vertical-rl"==x||"tb"==x||"tb-rl"==x)}else this.isrtlmode=!0===this.opt.rtlmode,this.isvertical=!1;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+r++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=y.opt.overflowx;this.overflowy=y.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=m();var S=e.extend({},this.detected);this.ishwscroll=(this.canhwscroll=S.hastransform&&y.opt.hwacceleration)&&y.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?!(S.iswebkit||S.isie||S.isie11):!(S.iswebkit||S.isie&&!S.isie10&&!S.isie11):!1;this.istouchcapable=!1;S.cantouch||!S.hasw3ctouch&&!S.hasmstouch?!S.cantouch||S.isios||S.isandroid||!S.iswebkit&&!S.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;y.opt.enablemouselockapi||(S.hasmousecapture=!1,S.haspointerlock=!1);this.debounced=function(e,t,o){y&&(y.delaylist[e]||(t.call(y),y.delaylist[e]={h:a(function(){y.delaylist[e].fn.call(y);y.delaylist[e]=!1},o)}),y.delaylist[e].fn=t)};var z=!1;this.synched=function(e,t){y.synclist[e]=t;(function(){z||(a(function(){if(y){z=!1;for(var e in y.synclist){var t=y.synclist[e];t&&t.call(y);y.synclist[e]=!1}}}),z=!0)})();return e};this.unsynched=function(e){y.synclist[e]&&(y.synclist[e]=!1)};this.css=function(e,t){for(var o in t)y.saved.css.push([e,o,e.css(o)]),e.css(o,t[o])};this.scrollTop=function(e){return void 0===e?y.getScrollTop():y.setScrollTop(e)};this.scrollLeft=function(e){return void 0===e?y.getScrollLeft():y.setScrollLeft(e)};var k=function(e,t,o,i,r,s,n){this.st=e;this.ed=t;this.spd=o;this.p1=i||0;this.p2=r||1;this.p3=s||0;this.p4=n||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};k.prototype={B2:function(e){return 3*e*e*(1-e)},B3:function(e){return 3*e*(1-e)*(1-e)},B4:function(e){return(1-e)*(1-e)*(1-e)},getNow:function(){var e=1-((new Date).getTime()-this.ts)/this.spd,t=this.B2(e)+this.B3(e)+this.B4(e);return 0>e?this.ed:this.st+Math.round(this.df*t)},update:function(e,t){this.st=this.getNow();this.ed=e;this.spd=t;this.ts=(new Date).getTime();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};S.hastranslate3d&&S.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(e){if(!e){if(e=d())return 16==e.length?-e[13]:-e[5];if(y.timerscroll&&y.timerscroll.bz)return y.timerscroll.bz.getNow()}return y.doc.translate.y};this.getScrollLeft=function(e){if(!e){if(e=d())return 16==e.length?-e[12]:-e[4];if(y.timerscroll&&y.timerscroll.bh)return y.timerscroll.bh.getNow()}return y.doc.translate.x};this.notifyScrollEvent=function(e){var t=document.createEvent("UIEvents");t.initUIEvent("scroll",!1,!0,window,1);t.niceevent=!0;e.dispatchEvent(t)};var T=this.isrtlmode?1:-1;S.hastranslate3d&&y.opt.enabletranslate3d?(this.setScrollTop=function(e,t){y.doc.translate.y=e;y.doc.translate.ty=-1*e+"px";y.doc.css(S.trstyle,"translate3d("+y.doc.translate.tx+","+y.doc.translate.ty+",0px)");t||y.notifyScrollEvent(y.win[0])},this.setScrollLeft=function(e,t){y.doc.translate.x=e;y.doc.translate.tx=e*T+"px";y.doc.css(S.trstyle,"translate3d("+y.doc.translate.tx+","+y.doc.translate.ty+",0px)");t||y.notifyScrollEvent(y.win[0])}):(this.setScrollTop=function(e,t){y.doc.translate.y=e;y.doc.translate.ty=-1*e+"px";y.doc.css(S.trstyle,"translate("+y.doc.translate.tx+","+y.doc.translate.ty+")");t||y.notifyScrollEvent(y.win[0])},this.setScrollLeft=function(e,t){y.doc.translate.x=e;y.doc.translate.tx=e*T+"px";y.doc.css(S.trstyle,"translate("+y.doc.translate.tx+","+y.doc.translate.ty+")");t||y.notifyScrollEvent(y.win[0])})}else this.getScrollTop=function(){return y.docscroll.scrollTop()},this.setScrollTop=function(e){return setTimeout(function(){y&&y.docscroll.scrollTop(e)},1)},this.getScrollLeft=function(){return y.hasreversehr?y.detected.ismozilla?y.page.maxw-Math.abs(y.docscroll.scrollLeft()):y.page.maxw-y.docscroll.scrollLeft():y.docscroll.scrollLeft()},this.setScrollLeft=function(e){return setTimeout(function(){if(y)return y.hasreversehr&&(e=y.detected.ismozilla?-(y.page.maxw-e):y.page.maxw-e),y.docscroll.scrollLeft(e)},1)};this.getTarget=function(e){return e?e.target?e.target:e.srcElement?e.srcElement:!1:!1};this.hasParent=function(e,t){if(!e)return!1;for(var o=e.target||e.srcElement||e||!1;o&&o.id!=t;)o=o.parentNode||!1;return!1!==o};var M={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(y.isfixed){var e=y.win.offset(),t=y.getDocumentScrollOffset();e.top-=t.top;e.left-=t.left;return e}e=y.win.offset();if(!y.viewport)return e;t=y.viewport.offset();return{top:e.top-t.top,left:e.left-t.left}};this.updateScrollBar=function(e){var t,o,i;if(y.ishwscroll)y.rail.css({height:y.win.innerHeight()-(y.opt.railpadding.top+y.opt.railpadding.bottom)}),y.railh&&y.railh.css({width:y.win.innerWidth()-(y.opt.railpadding.left+y.opt.railpadding.right)});else{var r=y.getOffset();t=r.top;o=r.left-(y.opt.railpadding.left+y.opt.railpadding.right);t+=f(y.win,"border-top-width",!0);o+=y.rail.align?y.win.outerWidth()-f(y.win,"border-right-width")-y.rail.width:f(y.win,"border-left-width");if(i=y.opt.railoffset)i.top&&(t+=i.top),i.left&&(o+=i.left);y.railslocked||y.rail.css({top:t,left:o,height:(e?e.h:y.win.innerHeight())-(y.opt.railpadding.top+y.opt.railpadding.bottom)});y.zoom&&y.zoom.css({top:t+1,left:1==y.rail.align?o-20:o+y.rail.width+4});if(y.railh&&!y.railslocked){t=r.top;o=r.left;if(i=y.opt.railhoffset)i.top&&(t+=i.top),i.left&&(o+=i.left);e=y.railh.align?t+f(y.win,"border-top-width",!0)+y.win.innerHeight()-y.railh.height:t+f(y.win,"border-top-width",!0);o+=f(y.win,"border-left-width");y.railh.css({top:e-(y.opt.railpadding.top+y.opt.railpadding.bottom),left:o,width:y.railh.width})}}};this.doRailClick=function(e,t,o){var i;y.railslocked||(y.cancelEvent(e),t?(t=o?y.doScrollLeft:y.doScrollTop,i=o?(e.pageX-y.railh.offset().left-y.cursorwidth/2)*y.scrollratio.x:(e.pageY-y.rail.offset().top-y.cursorheight/2)*y.scrollratio.y,t(i)):(t=o?y.doScrollLeftBy:y.doScrollBy,i=o?y.scroll.x:y.scroll.y,e=o?e.pageX-y.railh.offset().left:e.pageY-y.rail.offset().top,o=o?y.view.w:y.view.h,t(i>=e?o:-o)))};y.hasanimationframe=a;y.hascancelanimationframe=l;y.hasanimationframe?y.hascancelanimationframe||(l=function(){y.cancelAnimationFrame=!0}):(a=function(e){return setTimeout(e,15-Math.floor(+new Date/1e3)%16)},l=clearTimeout);this.init=function(){y.saved.css=[];if(S.isie7mobile||S.isoperamini)return!0;S.hasmstouch&&y.css(y.ispage?e("html"):y.win,{_touchaction:"none"});var r=S.ismodernie||S.isie10?{"-ms-overflow-style":"none"}:{"overflow-y":"hidden"};y.zindex="auto";y.zindex=y.ispage||"auto"!=y.opt.zindex?y.opt.zindex:p()||"auto";!y.ispage&&"auto"!=y.zindex&&y.zindex>s&&(s=y.zindex);y.isie&&0==y.zindex&&"auto"==y.opt.zindex&&(y.zindex="auto");if(!y.ispage||!S.cantouch&&!S.isieold&&!S.isie9mobile){var n=y.docscroll;y.ispage&&(n=y.haswrapper?y.win:y.doc);S.isie9mobile||y.css(n,r);y.ispage&&S.isie7&&("BODY"==y.doc[0].nodeName?y.css(e("html"),{"overflow-y":"hidden"}):"HTML"==y.doc[0].nodeName&&y.css(e("body"),r));!S.isios||y.ispage||y.haswrapper||y.css(e("body"),{"-webkit-overflow-scrolling":"touch"});var a=e(document.createElement("div"));a.css({position:"relative",top:0,"float":"right",width:y.opt.cursorwidth,height:0,"background-color":y.opt.cursorcolor,border:y.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":y.opt.cursorborderradius,"-moz-border-radius":y.opt.cursorborderradius,"border-radius":y.opt.cursorborderradius});a.hborder=parseFloat(a.outerHeight()-a.innerHeight());a.addClass("nicescroll-cursors");y.cursor=a;var l=e(document.createElement("div"));l.attr("id",y.id);l.addClass("nicescroll-rails nicescroll-rails-vr");var c,d,h=["left","right","top","bottom"],m;for(m in h)d=h[m],(c=y.opt.railpadding[d])?l.css("padding-"+d,c+"px"):y.opt.railpadding[d]=0;l.append(a);l.width=Math.max(parseFloat(y.opt.cursorwidth),a.outerWidth());l.css({width:l.width+"px",zIndex:y.zindex,background:y.opt.background,cursor:"default"});l.visibility=!0;l.scrollable=!0;l.align="left"==y.opt.railalign?0:1;y.rail=l;a=y.rail.drag=!1;!y.opt.boxzoom||y.ispage||S.isieold||(a=document.createElement("div"),y.bind(a,"click",y.doZoom),y.bind(a,"mouseenter",function(){y.zoom.css("opacity",y.opt.cursoropacitymax)}),y.bind(a,"mouseleave",function(){y.zoom.css("opacity",y.opt.cursoropacitymin)}),y.zoom=e(a),y.zoom.css({cursor:"pointer",zIndex:y.zindex,backgroundImage:"url("+y.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),y.opt.dblclickzoom&&y.bind(y.win,"dblclick",y.doZoom),S.cantouch&&y.opt.gesturezoom&&(y.ongesturezoom=function(e){1.5<e.scale&&y.doZoomIn(e);.8>e.scale&&y.doZoomOut(e);return y.cancelEvent(e)},y.bind(y.win,"gestureend",y.ongesturezoom)));y.railh=!1;var f;y.opt.horizrailenabled&&(y.css(n,{overflowX:"hidden"}),a=e(document.createElement("div")),a.css({position:"absolute",top:0,height:y.opt.cursorwidth,width:0,backgroundColor:y.opt.cursorcolor,border:y.opt.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":y.opt.cursorborderradius,"-moz-border-radius":y.opt.cursorborderradius,"border-radius":y.opt.cursorborderradius}),S.isieold&&a.css("overflow","hidden"),a.wborder=parseFloat(a.outerWidth()-a.innerWidth()),a.addClass("nicescroll-cursors"),y.cursorh=a,f=e(document.createElement("div")),f.attr("id",y.id+"-hr"),f.addClass("nicescroll-rails nicescroll-rails-hr"),f.height=Math.max(parseFloat(y.opt.cursorwidth),a.outerHeight()),f.css({height:f.height+"px",zIndex:y.zindex,background:y.opt.background}),f.append(a),f.visibility=!0,f.scrollable=!0,f.align="top"==y.opt.railvalign?0:1,y.railh=f,y.railh.drag=!1);y.ispage?(l.css({position:"fixed",top:0,height:"100%"}),l.align?l.css({right:0}):l.css({left:0}),y.body.append(l),y.railh&&(f.css({position:"fixed",left:0,width:"100%"}),f.align?f.css({bottom:0}):f.css({top:0}),y.body.append(f))):(y.ishwscroll?("static"==y.win.css("position")&&y.css(y.win,{position:"relative"}),n="HTML"==y.win[0].nodeName?y.body:y.win,e(n).scrollTop(0).scrollLeft(0),y.zoom&&(y.zoom.css({position:"absolute",top:1,right:0,"margin-right":l.width+4}),n.append(y.zoom)),l.css({position:"absolute",top:0}),l.align?l.css({right:0}):l.css({left:0}),n.append(l),f&&(f.css({position:"absolute",left:0,bottom:0}),f.align?f.css({bottom:0}):f.css({top:0}),n.append(f))):(y.isfixed="fixed"==y.win.css("position"),n=y.isfixed?"fixed":"absolute",y.isfixed||(y.viewport=y.getViewport(y.win[0])),y.viewport&&(y.body=y.viewport,0==/fixed|absolute/.test(y.viewport.css("position"))&&y.css(y.viewport,{position:"relative"})),l.css({position:n}),y.zoom&&y.zoom.css({position:n}),y.updateScrollBar(),y.body.append(l),y.zoom&&y.body.append(y.zoom),y.railh&&(f.css({position:n}),y.body.append(f))),S.isios&&y.css(y.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),S.isie&&y.opt.disableoutline&&y.win.attr("hideFocus","true"),S.iswebkit&&y.opt.disableoutline&&y.win.css("outline","none"));!1===y.opt.autohidemode?(y.autohidedom=!1,y.rail.css({opacity:y.opt.cursoropacitymax}),y.railh&&y.railh.css({opacity:y.opt.cursoropacitymax})):!0===y.opt.autohidemode||"leave"===y.opt.autohidemode?(y.autohidedom=e().add(y.rail),S.isie8&&(y.autohidedom=y.autohidedom.add(y.cursor)),y.railh&&(y.autohidedom=y.autohidedom.add(y.railh)),y.railh&&S.isie8&&(y.autohidedom=y.autohidedom.add(y.cursorh))):"scroll"==y.opt.autohidemode?(y.autohidedom=e().add(y.rail),y.railh&&(y.autohidedom=y.autohidedom.add(y.railh))):"cursor"==y.opt.autohidemode?(y.autohidedom=e().add(y.cursor),y.railh&&(y.autohidedom=y.autohidedom.add(y.cursorh))):"hidden"==y.opt.autohidemode&&(y.autohidedom=!1,y.hide(),y.railslocked=!1);if(S.isie9mobile)y.scrollmom=new g(y),y.onmangotouch=function(){var e=y.getScrollTop(),t=y.getScrollLeft();if(e==y.scrollmom.lastscrolly&&t==y.scrollmom.lastscrollx)return!0;var o=e-y.mangotouch.sy,i=t-y.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(i,2)+Math.pow(o,2)))){var r=0>o?-1:1,s=0>i?-1:1,n=+new Date;y.mangotouch.lazy&&clearTimeout(y.mangotouch.lazy);80<n-y.mangotouch.tm||y.mangotouch.dry!=r||y.mangotouch.drx!=s?(y.scrollmom.stop(),y.scrollmom.reset(t,e),y.mangotouch.sy=e,y.mangotouch.ly=e,y.mangotouch.sx=t,y.mangotouch.lx=t,y.mangotouch.dry=r,y.mangotouch.drx=s,y.mangotouch.tm=n):(y.scrollmom.stop(),y.scrollmom.update(y.mangotouch.sx-i,y.mangotouch.sy-o),y.mangotouch.tm=n,o=Math.max(Math.abs(y.mangotouch.ly-e),Math.abs(y.mangotouch.lx-t)),y.mangotouch.ly=e,y.mangotouch.lx=t,2<o&&(y.mangotouch.lazy=setTimeout(function(){y.mangotouch.lazy=!1;y.mangotouch.dry=0;y.mangotouch.drx=0;y.mangotouch.tm=0;y.scrollmom.doMomentum(30)},100)))}},l=y.getScrollTop(),f=y.getScrollLeft(),y.mangotouch={sy:l,ly:l,dry:0,sx:f,lx:f,drx:0,lazy:!1,tm:0},y.bind(y.docscroll,"scroll",y.onmangotouch);else{if(S.cantouch||y.istouchcapable||y.opt.touchbehavior||S.hasmstouch){y.scrollmom=new g(y);y.ontouchstart=function(t){if(t.pointerType&&2!=t.pointerType&&"touch"!=t.pointerType)return!1;y.hasmoving=!1;if(!y.railslocked){var o;if(S.hasmstouch)for(o=t.target?t.target:!1;o;){var i=e(o).getNiceScroll();if(0<i.length&&i[0].me==y.me)break;if(0<i.length)return!1;if("DIV"==o.nodeName&&o.id==y.id)break;o=o.parentNode?o.parentNode:!1}y.cancelScroll();if((o=y.getTarget(t))&&/INPUT/i.test(o.nodeName)&&/range/i.test(o.type))return y.stopPropagation(t);!("clientX"in t)&&"changedTouches"in t&&(t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY);y.forcescreen&&(i=t,t={original:t.original?t.original:t},t.clientX=i.screenX,t.clientY=i.screenY);y.rail.drag={x:t.clientX,y:t.clientY,sx:y.scroll.x,sy:y.scroll.y,st:y.getScrollTop(),sl:y.getScrollLeft(),pt:2,dl:!1};if(y.ispage||!y.opt.directionlockdeadzone)y.rail.drag.dl="f";else{var i=e(window).width(),r=e(window).height(),r=Math.max(0,Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-r),i=Math.max(0,Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)-i);y.rail.drag.ck=!y.rail.scrollable&&y.railh.scrollable?0<r?"v":!1:y.rail.scrollable&&!y.railh.scrollable?0<i?"h":!1:!1;y.rail.drag.ck||(y.rail.drag.dl="f")}y.opt.touchbehavior&&y.isiframe&&S.isie&&(i=y.win.position(),y.rail.drag.x+=i.left,y.rail.drag.y+=i.top);y.hasmoving=!1;y.lastmouseup=!1;y.scrollmom.reset(t.clientX,t.clientY);if(!S.cantouch&&!this.istouchcapable&&!t.pointerType){if(!o||!/INPUT|SELECT|TEXTAREA/i.test(o.nodeName))return!y.ispage&&S.hasmousecapture&&o.setCapture(),y.opt.touchbehavior?(o.onclick&&!o._onclick&&(o._onclick=o.onclick,o.onclick=function(e){if(y.hasmoving)return!1;o._onclick.call(this,e)}),y.cancelEvent(t)):y.stopPropagation(t);/SUBMIT|CANCEL|BUTTON/i.test(e(o).attr("type"))&&(pc={tg:o,click:!1},y.preventclick=pc)}}};y.ontouchend=function(e){if(!y.rail.drag)return!0;if(2==y.rail.drag.pt){if(e.pointerType&&2!=e.pointerType&&"touch"!=e.pointerType)return!1;y.scrollmom.doMomentum();y.rail.drag=!1;if(y.hasmoving&&(y.lastmouseup=!0,y.hideCursor(),S.hasmousecapture&&document.releaseCapture(),!S.cantouch))return y.cancelEvent(e)}else if(1==y.rail.drag.pt)return y.onmouseup(e)};var w=y.opt.touchbehavior&&y.isiframe&&!S.hasmousecapture;y.ontouchmove=function(t,o){if(!y.rail.drag||t.targetTouches&&y.opt.preventmultitouchscrolling&&1<t.targetTouches.length||t.pointerType&&2!=t.pointerType&&"touch"!=t.pointerType)return!1;if(2==y.rail.drag.pt){if(S.cantouch&&S.isios&&void 0===t.original)return!0;y.hasmoving=!0;y.preventclick&&!y.preventclick.click&&(y.preventclick.click=y.preventclick.tg.onclick||!1,y.preventclick.tg.onclick=y.onpreventclick);t=e.extend({original:t},t);"changedTouches"in t&&(t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY);if(y.forcescreen){var i=t;t={original:t.original?t.original:t};t.clientX=i.screenX;t.clientY=i.screenY}var r,i=r=0;w&&!o&&(r=y.win.position(),i=-r.left,r=-r.top);var s=t.clientY+r;r=s-y.rail.drag.y;var n=t.clientX+i,a=n-y.rail.drag.x,l=y.rail.drag.st-r;y.ishwscroll&&y.opt.bouncescroll?0>l?l=Math.round(l/2):l>y.page.maxh&&(l=y.page.maxh+Math.round((l-y.page.maxh)/2)):(0>l&&(s=l=0),l>y.page.maxh&&(l=y.page.maxh,s=0));var c;y.railh&&y.railh.scrollable&&(c=y.isrtlmode?a-y.rail.drag.sl:y.rail.drag.sl-a,y.ishwscroll&&y.opt.bouncescroll?0>c?c=Math.round(c/2):c>y.page.maxw&&(c=y.page.maxw+Math.round((c-y.page.maxw)/2)):(0>c&&(n=c=0),c>y.page.maxw&&(c=y.page.maxw,n=0)));i=!1;if(y.rail.drag.dl)i=!0,"v"==y.rail.drag.dl?c=y.rail.drag.sl:"h"==y.rail.drag.dl&&(l=y.rail.drag.st);else{r=Math.abs(r);var a=Math.abs(a),d=y.opt.directionlockdeadzone;if("v"==y.rail.drag.ck){if(r>d&&a<=.3*r)return y.rail.drag=!1,!0;a>d&&(y.rail.drag.dl="f",e("body").scrollTop(e("body").scrollTop()))}else if("h"==y.rail.drag.ck){if(a>d&&r<=.3*a)return y.rail.drag=!1,!0;r>d&&(y.rail.drag.dl="f",e("body").scrollLeft(e("body").scrollLeft()))}}y.synched("touchmove",function(){y.rail.drag&&2==y.rail.drag.pt&&(y.prepareTransition&&y.prepareTransition(0),y.rail.scrollable&&y.setScrollTop(l),y.scrollmom.update(n,s),y.railh&&y.railh.scrollable?(y.setScrollLeft(c),y.showCursor(l,c)):y.showCursor(l),S.isie10&&document.selection.clear())});S.ischrome&&y.istouchcapable&&(i=!1);if(i)return y.cancelEvent(t)}else if(1==y.rail.drag.pt)return y.onmousemove(t)}}y.onmousedown=function(e,t){if(!y.rail.drag||1==y.rail.drag.pt){if(y.railslocked)return y.cancelEvent(e);y.cancelScroll();y.rail.drag={x:e.clientX,y:e.clientY,sx:y.scroll.x,sy:y.scroll.y,pt:1,hr:!!t};var o=y.getTarget(e);!y.ispage&&S.hasmousecapture&&o.setCapture();y.isiframe&&!S.hasmousecapture&&(y.saved.csspointerevents=y.doc.css("pointer-events"),y.css(y.doc,{"pointer-events":"none"}));y.hasmoving=!1;return y.cancelEvent(e)}};y.onmouseup=function(e){if(y.rail.drag){if(1!=y.rail.drag.pt)return!0;S.hasmousecapture&&document.releaseCapture();y.isiframe&&!S.hasmousecapture&&y.doc.css("pointer-events",y.saved.csspointerevents);y.rail.drag=!1;y.hasmoving&&y.triggerScrollEnd();return y.cancelEvent(e)}};y.onmousemove=function(e){if(y.rail.drag){if(1==y.rail.drag.pt){if(S.ischrome&&0==e.which)return y.onmouseup(e);y.cursorfreezed=!0;y.hasmoving=!0;if(y.rail.drag.hr){y.scroll.x=y.rail.drag.sx+(e.clientX-y.rail.drag.x);0>y.scroll.x&&(y.scroll.x=0);var t=y.scrollvaluemaxw;y.scroll.x>t&&(y.scroll.x=t)}else y.scroll.y=y.rail.drag.sy+(e.clientY-y.rail.drag.y),0>y.scroll.y&&(y.scroll.y=0),t=y.scrollvaluemax,y.scroll.y>t&&(y.scroll.y=t);y.synched("mousemove",function(){y.rail.drag&&1==y.rail.drag.pt&&(y.showCursor(),y.rail.drag.hr?y.hasreversehr?y.doScrollLeft(y.scrollvaluemaxw-Math.round(y.scroll.x*y.scrollratio.x),y.opt.cursordragspeed):y.doScrollLeft(Math.round(y.scroll.x*y.scrollratio.x),y.opt.cursordragspeed):y.doScrollTop(Math.round(y.scroll.y*y.scrollratio.y),y.opt.cursordragspeed))});return y.cancelEvent(e)}}else y.checkarea=0};if(S.cantouch||y.opt.touchbehavior)y.onpreventclick=function(e){if(y.preventclick)return y.preventclick.tg.onclick=y.preventclick.click,y.preventclick=!1,y.cancelEvent(e)},y.bind(y.win,"mousedown",y.ontouchstart),y.onclick=S.isios?!1:function(e){return y.lastmouseup?(y.lastmouseup=!1,y.cancelEvent(e)):!0},y.opt.grabcursorenabled&&S.cursorgrabvalue&&(y.css(y.ispage?y.doc:y.win,{cursor:S.cursorgrabvalue}),y.css(y.rail,{cursor:S.cursorgrabvalue}));else{var v=function(e){if(y.selectiondrag){if(e){var t=y.win.outerHeight();e=e.pageY-y.selectiondrag.top;0<e&&e<t&&(e=0);e>=t&&(e-=t);y.selectiondrag.df=e}0!=y.selectiondrag.df&&(y.doScrollBy(2*-Math.floor(y.selectiondrag.df/6)),y.debounced("doselectionscroll",function(){v()},50))}};y.hasTextSelected="getSelection"in document?function(){return 0<document.getSelection().rangeCount}:"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1};y.onselectionstart=function(e){y.ispage||(y.selectiondrag=y.win.offset())};y.onselectionend=function(e){y.selectiondrag=!1};y.onselectiondrag=function(e){y.selectiondrag&&y.hasTextSelected()&&y.debounced("selectionscroll",function(){v(e)},250)}}S.hasw3ctouch?(y.css(y.rail,{"touch-action":"none"}),y.css(y.cursor,{"touch-action":"none"}),y.bind(y.win,"pointerdown",y.ontouchstart),y.bind(document,"pointerup",y.ontouchend),y.bind(document,"pointermove",y.ontouchmove)):S.hasmstouch?(y.css(y.rail,{"-ms-touch-action":"none"}),y.css(y.cursor,{"-ms-touch-action":"none"}),y.bind(y.win,"MSPointerDown",y.ontouchstart),y.bind(document,"MSPointerUp",y.ontouchend),y.bind(document,"MSPointerMove",y.ontouchmove),y.bind(y.cursor,"MSGestureHold",function(e){e.preventDefault()}),y.bind(y.cursor,"contextmenu",function(e){e.preventDefault()})):this.istouchcapable&&(y.bind(y.win,"touchstart",y.ontouchstart),y.bind(document,"touchend",y.ontouchend),y.bind(document,"touchcancel",y.ontouchend),y.bind(document,"touchmove",y.ontouchmove));if(y.opt.cursordragontouch||!S.cantouch&&!y.opt.touchbehavior)y.rail.css({cursor:"default"}),y.railh&&y.railh.css({cursor:"default"}),y.jqbind(y.rail,"mouseenter",function(){if(!y.ispage&&!y.win.is(":visible"))return!1;y.canshowonmouseevent&&y.showCursor();y.rail.active=!0}),y.jqbind(y.rail,"mouseleave",function(){y.rail.active=!1;y.rail.drag||y.hideCursor()}),y.opt.sensitiverail&&(y.bind(y.rail,"click",function(e){y.doRailClick(e,!1,!1)}),y.bind(y.rail,"dblclick",function(e){y.doRailClick(e,!0,!1)}),y.bind(y.cursor,"click",function(e){y.cancelEvent(e)}),y.bind(y.cursor,"dblclick",function(e){y.cancelEvent(e)})),y.railh&&(y.jqbind(y.railh,"mouseenter",function(){if(!y.ispage&&!y.win.is(":visible"))return!1;y.canshowonmouseevent&&y.showCursor();y.rail.active=!0}),y.jqbind(y.railh,"mouseleave",function(){y.rail.active=!1;y.rail.drag||y.hideCursor()}),y.opt.sensitiverail&&(y.bind(y.railh,"click",function(e){y.doRailClick(e,!1,!0)}),y.bind(y.railh,"dblclick",function(e){y.doRailClick(e,!0,!0)}),y.bind(y.cursorh,"click",function(e){y.cancelEvent(e)}),y.bind(y.cursorh,"dblclick",function(e){y.cancelEvent(e)})));S.cantouch||y.opt.touchbehavior?(y.bind(S.hasmousecapture?y.win:document,"mouseup",y.ontouchend),y.bind(document,"mousemove",y.ontouchmove),y.onclick&&y.bind(document,"click",y.onclick),y.opt.cursordragontouch?(y.bind(y.cursor,"mousedown",y.onmousedown),y.bind(y.cursor,"mouseup",y.onmouseup),y.cursorh&&y.bind(y.cursorh,"mousedown",function(e){y.onmousedown(e,!0)}),y.cursorh&&y.bind(y.cursorh,"mouseup",y.onmouseup)):(y.bind(y.rail,"mousedown",function(e){e.preventDefault()}),y.railh&&y.bind(y.railh,"mousedown",function(e){e.preventDefault()}))):(y.bind(S.hasmousecapture?y.win:document,"mouseup",y.onmouseup),y.bind(document,"mousemove",y.onmousemove),y.onclick&&y.bind(document,"click",y.onclick),y.bind(y.cursor,"mousedown",y.onmousedown),y.bind(y.cursor,"mouseup",y.onmouseup),y.railh&&(y.bind(y.cursorh,"mousedown",function(e){y.onmousedown(e,!0)}),y.bind(y.cursorh,"mouseup",y.onmouseup)),!y.ispage&&y.opt.enablescrollonselection&&(y.bind(y.win[0],"mousedown",y.onselectionstart),y.bind(document,"mouseup",y.onselectionend),y.bind(y.cursor,"mouseup",y.onselectionend),y.cursorh&&y.bind(y.cursorh,"mouseup",y.onselectionend),y.bind(document,"mousemove",y.onselectiondrag)),y.zoom&&(y.jqbind(y.zoom,"mouseenter",function(){y.canshowonmouseevent&&y.showCursor();y.rail.active=!0}),y.jqbind(y.zoom,"mouseleave",function(){y.rail.active=!1;y.rail.drag||y.hideCursor()})));y.opt.enablemousewheel&&(y.isiframe||y.mousewheel(S.isie&&y.ispage?document:y.win,y.onmousewheel),y.mousewheel(y.rail,y.onmousewheel),y.railh&&y.mousewheel(y.railh,y.onmousewheelhr));y.ispage||S.cantouch||/HTML|^BODY/.test(y.win[0].nodeName)||(y.win.attr("tabindex")||y.win.attr({tabindex:i++}),y.jqbind(y.win,"focus",function(e){t=y.getTarget(e).id||!0;y.hasfocus=!0;y.canshowonmouseevent&&y.noticeCursor()}),y.jqbind(y.win,"blur",function(e){t=!1;y.hasfocus=!1}),y.jqbind(y.win,"mouseenter",function(e){o=y.getTarget(e).id||!0;y.hasmousefocus=!0;y.canshowonmouseevent&&y.noticeCursor()}),y.jqbind(y.win,"mouseleave",function(){o=!1;y.hasmousefocus=!1;y.rail.drag||y.hideCursor()}))}y.onkeypress=function(i){if(y.railslocked&&0==y.page.maxh)return!0;i=i?i:window.e;var r=y.getTarget(i);if(r&&/INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName)&&(!r.getAttribute("type")&&!r.type||!/submit|button|cancel/i.tp)||e(r).attr("contenteditable"))return!0;if(y.hasfocus||y.hasmousefocus&&!t||y.ispage&&!t&&!o){r=i.keyCode;if(y.railslocked&&27!=r)return y.cancelEvent(i);var s=i.ctrlKey||!1,n=i.shiftKey||!1,a=!1;switch(r){case 38:case 63233:y.doScrollBy(72);a=!0;break;case 40:case 63235:y.doScrollBy(-72);a=!0;break;case 37:case 63232:y.railh&&(s?y.doScrollLeft(0):y.doScrollLeftBy(72),a=!0);break;case 39:case 63234:y.railh&&(s?y.doScrollLeft(y.page.maxw):y.doScrollLeftBy(-72),a=!0);break;case 33:case 63276:y.doScrollBy(y.view.h);a=!0;break;case 34:case 63277:y.doScrollBy(-y.view.h);a=!0;break;case 36:case 63273:y.railh&&s?y.doScrollPos(0,0):y.doScrollTo(0);a=!0;break;case 35:case 63275:y.railh&&s?y.doScrollPos(y.page.maxw,y.page.maxh):y.doScrollTo(y.page.maxh);a=!0;break;case 32:y.opt.spacebarenabled&&(n?y.doScrollBy(y.view.h):y.doScrollBy(-y.view.h),a=!0);break;case 27:y.zoomactive&&(y.doZoom(),a=!0)}if(a)return y.cancelEvent(i)}};y.opt.enablekeyboard&&y.bind(document,S.isopera&&!S.isopera12?"keypress":"keydown",y.onkeypress);y.bind(document,"keydown",function(e){e.ctrlKey&&(y.wheelprevented=!0)});y.bind(document,"keyup",function(e){e.ctrlKey||(y.wheelprevented=!1)});y.bind(window,"blur",function(e){y.wheelprevented=!1});y.bind(window,"resize",y.lazyResize);y.bind(window,"orientationchange",y.lazyResize);y.bind(window,"load",y.lazyResize);if(S.ischrome&&!y.ispage&&!y.haswrapper){var b=y.win.attr("style"),l=parseFloat(y.win.css("width"))+1;y.win.css("width",l);y.synched("chromefix",function(){y.win.attr("style",b)})}y.onAttributeChange=function(e){y.lazyResize(y.isieold?250:30)};y.isie11||!1===u||(y.observerbody=new u(function(t){t.forEach(function(t){if("attributes"==t.type)return e("body").hasClass("modal-open")&&e("body").hasClass("modal-dialog")&&!e.contains(e(".modal-dialog")[0],y.doc[0])?y.hide():y.show()});if(document.body.scrollHeight!=y.page.maxh)return y.lazyResize(30)}),y.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]}));y.ispage||y.haswrapper||(!1!==u?(y.observer=new u(function(e){e.forEach(y.onAttributeChange)}),y.observer.observe(y.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),y.observerremover=new u(function(e){e.forEach(function(e){if(0<e.removedNodes.length){for(var t in e.removedNodes)if(y&&e.removedNodes[t]==y.win[0])return y.remove()}})}),y.observerremover.observe(y.win[0].parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(y.bind(y.win,S.isie&&!S.isie9?"propertychange":"DOMAttrModified",y.onAttributeChange),S.isie9&&y.win[0].attachEvent("onpropertychange",y.onAttributeChange),y.bind(y.win,"DOMNodeRemoved",function(e){e.target==y.win[0]&&y.remove()})));!y.ispage&&y.opt.boxzoom&&y.bind(window,"resize",y.resizeZoom);y.istextarea&&(y.bind(y.win,"keydown",y.lazyResize),y.bind(y.win,"mouseup",y.lazyResize));y.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var x=function(){y.iframexd=!1;var t;try{t="contentDocument"in this?this.contentDocument:this.contentWindow.document}catch(e){y.iframexd=!0,t=!1}if(y.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;y.forcescreen=!0;y.isiframe&&(y.iframe={doc:e(t),html:y.doc.contents().find("html")[0],body:y.doc.contents().find("body")[0]},y.getContentSize=function(){return{w:Math.max(y.iframe.html.scrollWidth,y.iframe.body.scrollWidth),h:Math.max(y.iframe.html.scrollHeight,y.iframe.body.scrollHeight)}},y.docscroll=e(y.iframe.body));if(!S.isios&&y.opt.iframeautoresize&&!y.isiframe){y.win.scrollTop(0);y.doc.height("");var o=Math.max(t.getElementsByTagName("html")[0].scrollHeight,t.body.scrollHeight);y.doc.height(o)}y.lazyResize(30);S.isie7&&y.css(e(y.iframe.html),r);y.css(e(y.iframe.body),r);S.isios&&y.haswrapper&&y.css(e(t.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?y.bind(this.contentWindow,"scroll",y.onscroll):y.bind(t,"scroll",y.onscroll);y.opt.enablemousewheel&&y.mousewheel(t,y.onmousewheel);y.opt.enablekeyboard&&y.bind(t,S.isopera?"keypress":"keydown",y.onkeypress);if(S.cantouch||y.opt.touchbehavior)y.bind(t,"mousedown",y.ontouchstart),y.bind(t,"mousemove",function(e){return y.ontouchmove(e,!0)}),y.opt.grabcursorenabled&&S.cursorgrabvalue&&y.css(e(t.body),{cursor:S.cursorgrabvalue});y.bind(t,"mouseup",y.ontouchend);y.zoom&&(y.opt.dblclickzoom&&y.bind(t,"dblclick",y.doZoom),y.ongesturezoom&&y.bind(t,"gestureend",y.ongesturezoom))};this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){x.call(y.doc[0],!1)},500);y.bind(this.doc,"load",x)}};this.showCursor=function(e,t){y.cursortimeout&&(clearTimeout(y.cursortimeout),y.cursortimeout=0);if(y.rail){y.autohidedom&&(y.autohidedom.stop().css({opacity:y.opt.cursoropacitymax}),y.cursoractive=!0);y.rail.drag&&1==y.rail.drag.pt||(void 0!==e&&!1!==e&&(y.scroll.y=Math.round(1*e/y.scrollratio.y)),void 0!==t&&(y.scroll.x=Math.round(1*t/y.scrollratio.x)));y.cursor.css({height:y.cursorheight,top:y.scroll.y});if(y.cursorh){var o=y.hasreversehr?y.scrollvaluemaxw-y.scroll.x:y.scroll.x;!y.rail.align&&y.rail.visibility?y.cursorh.css({width:y.cursorwidth,left:o+y.rail.width}):y.cursorh.css({width:y.cursorwidth,left:o});y.cursoractive=!0}y.zoom&&y.zoom.stop().css({opacity:y.opt.cursoropacitymax})}};this.hideCursor=function(e){y.cursortimeout||!y.rail||!y.autohidedom||y.hasmousefocus&&"leave"==y.opt.autohidemode||(y.cursortimeout=setTimeout(function(){y.rail.active&&y.showonmouseevent||(y.autohidedom.stop().animate({opacity:y.opt.cursoropacitymin}),y.zoom&&y.zoom.stop().animate({opacity:y.opt.cursoropacitymin}),y.cursoractive=!1);y.cursortimeout=0},e||y.opt.hidecursordelay))};this.noticeCursor=function(e,t,o){y.showCursor(t,o);y.rail.active||y.hideCursor(e)};this.getContentSize=y.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:y.haswrapper?function(){return{w:y.doc.outerWidth()+parseInt(y.win.css("paddingLeft"))+parseInt(y.win.css("paddingRight")),h:y.doc.outerHeight()+parseInt(y.win.css("paddingTop"))+parseInt(y.win.css("paddingBottom"))}}:function(){return{w:y.docscroll[0].scrollWidth,h:y.docscroll[0].scrollHeight}};this.onResize=function(e,t){if(!y||!y.win)return!1;if(!y.haswrapper&&!y.ispage){if("none"==y.win.css("display"))return y.visibility&&y.hideRail().hideRailHr(),!1;y.hidden||y.visibility||y.showRail().showRailHr()}var o=y.page.maxh,i=y.page.maxw,r=y.view.h,s=y.view.w;y.view={w:y.ispage?y.win.width():parseInt(y.win[0].clientWidth),h:y.ispage?y.win.height():parseInt(y.win[0].clientHeight)};y.page=t?t:y.getContentSize();y.page.maxh=Math.max(0,y.page.h-y.view.h);y.page.maxw=Math.max(0,y.page.w-y.view.w);if(y.page.maxh==o&&y.page.maxw==i&&y.view.w==s&&y.view.h==r){if(y.ispage)return y;o=y.win.offset();if(y.lastposition&&(i=y.lastposition,i.top==o.top&&i.left==o.left))return y;y.lastposition=o}0==y.page.maxh?(y.hideRail(),y.scrollvaluemax=0,y.scroll.y=0,y.scrollratio.y=0,y.cursorheight=0,y.setScrollTop(0),y.rail&&(y.rail.scrollable=!1)):(y.page.maxh-=y.opt.railpadding.top+y.opt.railpadding.bottom,y.rail.scrollable=!0);0==y.page.maxw?(y.hideRailHr(),y.scrollvaluemaxw=0,y.scroll.x=0,y.scrollratio.x=0,y.cursorwidth=0,y.setScrollLeft(0),y.railh&&(y.railh.scrollable=!1)):(y.page.maxw-=y.opt.railpadding.left+y.opt.railpadding.right,y.railh&&(y.railh.scrollable=y.opt.horizrailenabled));y.railslocked=y.locked||0==y.page.maxh&&0==y.page.maxw;if(y.railslocked)return y.ispage||y.updateScrollBar(y.view),!1;y.hidden||y.visibility?!y.railh||y.hidden||y.railh.visibility||y.showRailHr():y.showRail().showRailHr();y.istextarea&&y.win.css("resize")&&"none"!=y.win.css("resize")&&(y.view.h-=20);y.cursorheight=Math.min(y.view.h,Math.round(y.view.h/y.page.h*y.view.h));y.cursorheight=y.opt.cursorfixedheight?y.opt.cursorfixedheight:Math.max(y.opt.cursorminheight,y.cursorheight);y.cursorwidth=Math.min(y.view.w,Math.round(y.view.w/y.page.w*y.view.w));y.cursorwidth=y.opt.cursorfixedheight?y.opt.cursorfixedheight:Math.max(y.opt.cursorminheight,y.cursorwidth);y.scrollvaluemax=y.view.h-y.cursorheight-y.cursor.hborder-(y.opt.railpadding.top+y.opt.railpadding.bottom);y.railh&&(y.railh.width=0<y.page.maxh?y.view.w-y.rail.width:y.view.w,y.scrollvaluemaxw=y.railh.width-y.cursorwidth-y.cursorh.wborder-(y.opt.railpadding.left+y.opt.railpadding.right));y.ispage||y.updateScrollBar(y.view);y.scrollratio={x:y.page.maxw/y.scrollvaluemaxw,y:y.page.maxh/y.scrollvaluemax};y.getScrollTop()>y.page.maxh?y.doScrollTop(y.page.maxh):(y.scroll.y=Math.round(y.getScrollTop()*(1/y.scrollratio.y)),y.scroll.x=Math.round(y.getScrollLeft()*(1/y.scrollratio.x)),y.cursoractive&&y.noticeCursor());y.scroll.y&&0==y.getScrollTop()&&y.doScrollTo(Math.floor(y.scroll.y*y.scrollratio.y));return y};this.resize=y.onResize;this.hlazyresize=0;this.lazyResize=function(e){y.haswrapper||y.hide();y.hlazyresize&&clearTimeout(y.hlazyresize);y.hlazyresize=setTimeout(function(){y&&y.show().resize()},240);return y};this.jqbind=function(t,o,i){y.events.push({e:t,n:o,f:i,q:!0});e(t).bind(o,i)};this.mousewheel=function(e,t,o){e="jquery"in e?e[0]:e;if("onwheel"in document.createElement("div"))y._bind(e,"wheel",t,o||!1);else{var i=void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";w(e,i,t,o||!1);"DOMMouseScroll"==i&&w(e,"MozMousePixelScroll",t,o||!1)}};S.haseventlistener?(this.bind=function(e,t,o,i){y._bind("jquery"in e?e[0]:e,t,o,i||!1)},this._bind=function(e,t,o,i){y.events.push({e:e,n:t,f:o,b:i,q:!1});e.addEventListener(t,o,i||!1)},this.cancelEvent=function(e){if(!e)return!1;e=e.original?e.original:e;e.cancelable&&e.preventDefault();e.stopPropagation();e.preventManipulation&&e.preventManipulation();return!1},this.stopPropagation=function(e){if(!e)return!1;e=e.original?e.original:e;e.stopPropagation();return!1},this._unbind=function(e,t,o,i){e.removeEventListener(t,o,i)}):(this.bind=function(e,t,o,i){var r="jquery"in e?e[0]:e;y._bind(r,t,function(e){(e=e||window.event||!1)&&e.srcElement&&(e.target=e.srcElement);"pageY"in e||(e.pageX=e.clientX+document.documentElement.scrollLeft,e.pageY=e.clientY+document.documentElement.scrollTop);return!1===o.call(r,e)||!1===i?y.cancelEvent(e):!0})},this._bind=function(e,t,o,i){y.events.push({e:e,n:t,f:o,b:i,q:!1});e.attachEvent?e.attachEvent("on"+t,o):e["on"+t]=o},this.cancelEvent=function(e){e=window.event||!1;if(!e)return!1;e.cancelBubble=!0;e.cancel=!0;return e.returnValue=!1},this.stopPropagation=function(e){e=window.event||!1;if(!e)return!1;e.cancelBubble=!0;return!1},this._unbind=function(e,t,o,i){e.detachEvent?e.detachEvent("on"+t,o):e["on"+t]=!1});this.unbindAll=function(){for(var e=0;e<y.events.length;e++){var t=y.events[e];t.q?t.e.unbind(t.n,t.f):y._unbind(t.e,t.n,t.f,t.b)}};this.showRail=function(){0==y.page.maxh||!y.ispage&&"none"==y.win.css("display")||(y.visibility=!0,y.rail.visibility=!0,y.rail.css("display","block"));return y};this.showRailHr=function(){if(!y.railh)return y;0==y.page.maxw||!y.ispage&&"none"==y.win.css("display")||(y.railh.visibility=!0,y.railh.css("display","block"));return y};this.hideRail=function(){y.visibility=!1;y.rail.visibility=!1;y.rail.css("display","none");return y};this.hideRailHr=function(){if(!y.railh)return y;y.railh.visibility=!1;y.railh.css("display","none");return y};this.show=function(){y.hidden=!1;y.railslocked=!1;return y.showRail().showRailHr()};this.hide=function(){y.hidden=!0;y.railslocked=!0;return y.hideRail().hideRailHr()};this.toggle=function(){return y.hidden?y.show():y.hide()};this.remove=function(){y.stop();y.cursortimeout&&clearTimeout(y.cursortimeout);for(var t in y.delaylist)y.delaylist[t]&&l(y.delaylist[t].h);y.doZoomOut();y.unbindAll();S.isie9&&y.win[0].detachEvent("onpropertychange",y.onAttributeChange);!1!==y.observer&&y.observer.disconnect();!1!==y.observerremover&&y.observerremover.disconnect();!1!==y.observerbody&&y.observerbody.disconnect();y.events=null;y.cursor&&y.cursor.remove();y.cursorh&&y.cursorh.remove();y.rail&&y.rail.remove();y.railh&&y.railh.remove();y.zoom&&y.zoom.remove();for(t=0;t<y.saved.css.length;t++){var o=y.saved.css[t];o[0].css(o[1],void 0===o[2]?"":o[2])}y.saved=!1;y.me.data("__nicescroll","");var i=e.nicescroll;i.each(function(e){if(this&&this.id===y.id){delete i[e];for(var t=++e;t<i.length;t++,e++)i[e]=i[t];i.length--;i.length&&delete i[i.length]}});for(var r in y)y[r]=null,delete y[r];y=null};this.scrollstart=function(e){this.onscrollstart=e;return y};this.scrollend=function(e){this.onscrollend=e;return y};this.scrollcancel=function(e){this.onscrollcancel=e;return y};this.zoomin=function(e){this.onzoomin=e;return y};this.zoomout=function(e){this.onzoomout=e;return y};this.isScrollable=function(t){t=t.target?t.target:t;if("OPTION"==t.nodeName)return!0;for(;t&&1==t.nodeType&&!/^BODY|HTML/.test(t.nodeName);){var o=e(t),o=o.css("overflowY")||o.css("overflowX")||o.css("overflow")||"";if(/scroll|auto/.test(o))return t.clientHeight!=t.scrollHeight;t=t.parentNode?t.parentNode:!1}return!1};this.getViewport=function(t){for(t=t&&t.parentNode?t.parentNode:!1;t&&1==t.nodeType&&!/^BODY|HTML/.test(t.nodeName);){var o=e(t);if(/fixed|absolute/.test(o.css("position")))return o;var i=o.css("overflowY")||o.css("overflowX")||o.css("overflow")||"";if(/scroll|auto/.test(i)&&t.clientHeight!=t.scrollHeight||0<o.getNiceScroll().length)return o;t=t.parentNode?t.parentNode:!1}return!1};this.triggerScrollEnd=function(){if(y.onscrollend){var e=y.getScrollLeft(),t=y.getScrollTop();y.onscrollend.call(y,{type:"scrollend",current:{x:e,y:t},end:{x:e,y:t}})}};this.onmousewheel=function(e){if(!y.wheelprevented){if(y.railslocked)return y.debounced("checkunlock",y.resize,250),!0;if(y.rail.drag)return y.cancelEvent(e);"auto"==y.opt.oneaxismousemode&&0!=e.deltaX&&(y.opt.oneaxismousemode=!1);if(y.opt.oneaxismousemode&&0==e.deltaX&&!y.rail.scrollable)return y.railh&&y.railh.scrollable?y.onmousewheelhr(e):!0;var t=+new Date,o=!1;y.opt.preservenativescrolling&&y.checkarea+600<t&&(y.nativescrollingarea=y.isScrollable(e),o=!0);y.checkarea=t;if(y.nativescrollingarea)return!0;if(e=v(e,!1,o))y.checkarea=0;return e}};this.onmousewheelhr=function(e){if(!y.wheelprevented){if(y.railslocked||!y.railh.scrollable)return!0;if(y.rail.drag)return y.cancelEvent(e);var t=+new Date,o=!1;y.opt.preservenativescrolling&&y.checkarea+600<t&&(y.nativescrollingarea=y.isScrollable(e),o=!0);y.checkarea=t;return y.nativescrollingarea?!0:y.railslocked?y.cancelEvent(e):v(e,!0,o)}};this.stop=function(){y.cancelScroll();y.scrollmon&&y.scrollmon.stop();y.cursorfreezed=!1;y.scroll.y=Math.round(y.getScrollTop()*(1/y.scrollratio.y));y.noticeCursor();return y};this.getTransitionSpeed=function(e){e=Math.min(Math.round(10*y.opt.scrollspeed),Math.round(e/20*y.opt.scrollspeed));return 20<e?e:0};y.opt.smoothscroll?y.ishwscroll&&S.hastransition&&y.opt.usetransition&&y.opt.smoothscroll?(this.prepareTransition=function(e,t){var o=t?20<e?e:0:y.getTransitionSpeed(e),i=o?S.prefixstyle+"transform "+o+"ms ease-out":"";y.lasttransitionstyle&&y.lasttransitionstyle==i||(y.lasttransitionstyle=i,y.doc.css(S.transitionstyle,i));return o},this.doScrollLeft=function(e,t){var o=y.scrollrunning?y.newscrolly:y.getScrollTop();y.doScrollPos(e,o,t)},this.doScrollTop=function(e,t){var o=y.scrollrunning?y.newscrollx:y.getScrollLeft();y.doScrollPos(o,e,t)},this.doScrollPos=function(e,t,o){var i=y.getScrollTop(),r=y.getScrollLeft();(0>(y.newscrolly-i)*(t-i)||0>(y.newscrollx-r)*(e-r))&&y.cancelScroll();0==y.opt.bouncescroll&&(0>t?t=0:t>y.page.maxh&&(t=y.page.maxh),0>e?e=0:e>y.page.maxw&&(e=y.page.maxw));if(y.scrollrunning&&e==y.newscrollx&&t==y.newscrolly)return!1;y.newscrolly=t;y.newscrollx=e;y.newscrollspeed=o||!1;if(y.timer)return!1;y.timer=setTimeout(function(){var o=y.getScrollTop(),i=y.getScrollLeft(),r=Math.round(Math.sqrt(Math.pow(e-i,2)+Math.pow(t-o,2))),r=y.newscrollspeed&&1<y.newscrollspeed?y.newscrollspeed:y.getTransitionSpeed(r);y.newscrollspeed&&1>=y.newscrollspeed&&(r*=y.newscrollspeed);y.prepareTransition(r,!0);y.timerscroll&&y.timerscroll.tm&&clearInterval(y.timerscroll.tm);0<r&&(!y.scrollrunning&&y.onscrollstart&&y.onscrollstart.call(y,{type:"scrollstart",current:{x:i,y:o},request:{x:e,y:t},end:{x:y.newscrollx,y:y.newscrolly},speed:r}),S.transitionend?y.scrollendtrapped||(y.scrollendtrapped=!0,y.bind(y.doc,S.transitionend,y.onScrollTransitionEnd,!1)):(y.scrollendtrapped&&clearTimeout(y.scrollendtrapped),y.scrollendtrapped=setTimeout(y.onScrollTransitionEnd,r)),y.timerscroll={bz:new k(o,y.newscrolly,r,0,0,.58,1),bh:new k(i,y.newscrollx,r,0,0,.58,1)},y.cursorfreezed||(y.timerscroll.tm=setInterval(function(){y.showCursor(y.getScrollTop(),y.getScrollLeft())},60)));y.synched("doScroll-set",function(){y.timer=0;y.scrollendtrapped&&(y.scrollrunning=!0);y.setScrollTop(y.newscrolly);y.setScrollLeft(y.newscrollx);if(!y.scrollendtrapped)y.onScrollTransitionEnd()})},50)},this.cancelScroll=function(){if(!y.scrollendtrapped)return!0;var e=y.getScrollTop(),t=y.getScrollLeft();y.scrollrunning=!1;S.transitionend||clearTimeout(S.transitionend);y.scrollendtrapped=!1;y._unbind(y.doc[0],S.transitionend,y.onScrollTransitionEnd);y.prepareTransition(0);y.setScrollTop(e);y.railh&&y.setScrollLeft(t);y.timerscroll&&y.timerscroll.tm&&clearInterval(y.timerscroll.tm);y.timerscroll=!1;y.cursorfreezed=!1;y.showCursor(e,t);return y},this.onScrollTransitionEnd=function(){y.scrollendtrapped&&y._unbind(y.doc[0],S.transitionend,y.onScrollTransitionEnd);y.scrollendtrapped=!1;y.prepareTransition(0);y.timerscroll&&y.timerscroll.tm&&clearInterval(y.timerscroll.tm);y.timerscroll=!1;var e=y.getScrollTop(),t=y.getScrollLeft();y.setScrollTop(e);y.railh&&y.setScrollLeft(t);y.noticeCursor(!1,e,t);y.cursorfreezed=!1;0>e?e=0:e>y.page.maxh&&(e=y.page.maxh);0>t?t=0:t>y.page.maxw&&(t=y.page.maxw);if(e!=y.newscrolly||t!=y.newscrollx)return y.doScrollPos(t,e,y.opt.snapbackspeed);y.onscrollend&&y.scrollrunning&&y.triggerScrollEnd();y.scrollrunning=!1}):(this.doScrollLeft=function(e,t){var o=y.scrollrunning?y.newscrolly:y.getScrollTop();y.doScrollPos(e,o,t)},this.doScrollTop=function(e,t){var o=y.scrollrunning?y.newscrollx:y.getScrollLeft();y.doScrollPos(o,e,t)},this.doScrollPos=function(e,t,o){function i(){if(y.cancelAnimationFrame)return!0;y.scrollrunning=!0;if(u=1-u)return y.timer=a(i)||1;var e=0,t,o,r=o=y.getScrollTop();if(y.dst.ay){r=y.bzscroll?y.dst.py+y.bzscroll.getNow()*y.dst.ay:y.newscrolly;t=r-o;if(0>t&&r<y.newscrolly||0<t&&r>y.newscrolly)r=y.newscrolly;y.setScrollTop(r);r==y.newscrolly&&(e=1)}else e=1;o=t=y.getScrollLeft();if(y.dst.ax){o=y.bzscroll?y.dst.px+y.bzscroll.getNow()*y.dst.ax:y.newscrollx;t=o-t;if(0>t&&o<y.newscrollx||0<t&&o>y.newscrollx)o=y.newscrollx;y.setScrollLeft(o);o==y.newscrollx&&(e+=1)}else e+=1;2==e?(y.timer=0,y.cursorfreezed=!1,y.bzscroll=!1,y.scrollrunning=!1,0>r?r=0:r>y.page.maxh&&(r=Math.max(0,y.page.maxh)),0>o?o=0:o>y.page.maxw&&(o=y.page.maxw),o!=y.newscrollx||r!=y.newscrolly?y.doScrollPos(o,r):y.onscrollend&&y.triggerScrollEnd()):y.timer=a(i)||1}t=void 0===t||!1===t?y.getScrollTop(!0):t;if(y.timer&&y.newscrolly==t&&y.newscrollx==e)return!0;y.timer&&l(y.timer);y.timer=0;var r=y.getScrollTop(),s=y.getScrollLeft();(0>(y.newscrolly-r)*(t-r)||0>(y.newscrollx-s)*(e-s))&&y.cancelScroll();y.newscrolly=t;y.newscrollx=e;y.bouncescroll&&y.rail.visibility||(0>y.newscrolly?y.newscrolly=0:y.newscrolly>y.page.maxh&&(y.newscrolly=y.page.maxh));y.bouncescroll&&y.railh.visibility||(0>y.newscrollx?y.newscrollx=0:y.newscrollx>y.page.maxw&&(y.newscrollx=y.page.maxw));y.dst={};y.dst.x=e-s;y.dst.y=t-r;y.dst.px=s;y.dst.py=r;var n=Math.round(Math.sqrt(Math.pow(y.dst.x,2)+Math.pow(y.dst.y,2)));y.dst.ax=y.dst.x/n;y.dst.ay=y.dst.y/n;var c=0,d=n;0==y.dst.x?(c=r,d=t,y.dst.ay=1,y.dst.py=0):0==y.dst.y&&(c=s,d=e,y.dst.ax=1,y.dst.px=0);n=y.getTransitionSpeed(n);o&&1>=o&&(n*=o);y.bzscroll=0<n?y.bzscroll?y.bzscroll.update(d,n):new k(c,d,n,0,1,0,1):!1;if(!y.timer){(r==y.page.maxh&&t>=y.page.maxh||s==y.page.maxw&&e>=y.page.maxw)&&y.checkContentSize();var u=1;y.cancelAnimationFrame=!1;y.timer=1;y.onscrollstart&&!y.scrollrunning&&y.onscrollstart.call(y,{type:"scrollstart",current:{x:s,y:r},request:{x:e,y:t},end:{x:y.newscrollx,y:y.newscrolly},speed:n});i();(r==y.page.maxh&&t>=r||s==y.page.maxw&&e>=s)&&y.checkContentSize();y.noticeCursor()}},this.cancelScroll=function(){y.timer&&l(y.timer);y.timer=0;y.bzscroll=!1;y.scrollrunning=!1;return y}):(this.doScrollLeft=function(e,t){var o=y.getScrollTop();y.doScrollPos(e,o,t)},this.doScrollTop=function(e,t){var o=y.getScrollLeft();y.doScrollPos(o,e,t)},this.doScrollPos=function(e,t,o){var i=e>y.page.maxw?y.page.maxw:e;0>i&&(i=0);var r=t>y.page.maxh?y.page.maxh:t;0>r&&(r=0);y.synched("scroll",function(){y.setScrollTop(r);y.setScrollLeft(i)})},this.cancelScroll=function(){});this.doScrollBy=function(e,t){var o=0,o=t?Math.floor((y.scroll.y-e)*y.scrollratio.y):(y.timer?y.newscrolly:y.getScrollTop(!0))-e;if(y.bouncescroll){var i=Math.round(y.view.h/2);o<-i?o=-i:o>y.page.maxh+i&&(o=y.page.maxh+i)}y.cursorfreezed=!1;i=y.getScrollTop(!0);if(0>o&&0>=i)return y.noticeCursor();if(o>y.page.maxh&&i>=y.page.maxh)return y.checkContentSize(),y.noticeCursor();y.doScrollTop(o)};this.doScrollLeftBy=function(e,t){var o=0,o=t?Math.floor((y.scroll.x-e)*y.scrollratio.x):(y.timer?y.newscrollx:y.getScrollLeft(!0))-e;if(y.bouncescroll){var i=Math.round(y.view.w/2);o<-i?o=-i:o>y.page.maxw+i&&(o=y.page.maxw+i)}y.cursorfreezed=!1;i=y.getScrollLeft(!0);if(0>o&&0>=i||o>y.page.maxw&&i>=y.page.maxw)return y.noticeCursor();y.doScrollLeft(o)};this.doScrollTo=function(e,t){y.cursorfreezed=!1;y.doScrollTop(e)};this.checkContentSize=function(){var e=y.getContentSize();e.h==y.page.h&&e.w==y.page.w||y.resize(!1,e)};y.onscroll=function(e){y.rail.drag||y.cursorfreezed||y.synched("scroll",function(){y.scroll.y=Math.round(y.getScrollTop()*(1/y.scrollratio.y));y.railh&&(y.scroll.x=Math.round(y.getScrollLeft()*(1/y.scrollratio.x)));y.noticeCursor()})};y.bind(y.docscroll,"scroll",y.onscroll);this.doZoomIn=function(t){if(!y.zoomactive){y.zoomactive=!0;y.zoomrestore={style:{}};var o="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),i=y.win[0].style,r;for(r in o){var n=o[r];y.zoomrestore.style[n]=void 0!==i[n]?i[n]:""}y.zoomrestore.style.width=y.win.css("width");y.zoomrestore.style.height=y.win.css("height");y.zoomrestore.padding={w:y.win.outerWidth()-y.win.width(),h:y.win.outerHeight()-y.win.height()};S.isios4&&(y.zoomrestore.scrollTop=e(window).scrollTop(),e(window).scrollTop(0));y.win.css({position:S.isios4?"absolute":"fixed",top:0,left:0,zIndex:s+100,margin:0});o=y.win.css("backgroundColor");(""==o||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(o))&&y.win.css("backgroundColor","#fff");y.rail.css({zIndex:s+101});y.zoom.css({zIndex:s+102});y.zoom.css("backgroundPosition","0px -18px");y.resizeZoom();y.onzoomin&&y.onzoomin.call(y);return y.cancelEvent(t)}};this.doZoomOut=function(t){if(y.zoomactive)return y.zoomactive=!1,y.win.css("margin",""),y.win.css(y.zoomrestore.style),S.isios4&&e(window).scrollTop(y.zoomrestore.scrollTop),y.rail.css({"z-index":y.zindex}),y.zoom.css({"z-index":y.zindex}),y.zoomrestore=!1,y.zoom.css("backgroundPosition","0px 0px"),y.onResize(),y.onzoomout&&y.onzoomout.call(y),y.cancelEvent(t)};this.doZoom=function(e){return y.zoomactive?y.doZoomOut(e):y.doZoomIn(e)};this.resizeZoom=function(){if(y.zoomactive){var t=y.getScrollTop();y.win.css({width:e(window).width()-y.zoomrestore.padding.w+"px",height:e(window).height()-y.zoomrestore.padding.h+"px"});y.onResize();y.setScrollTop(Math.min(y.page.maxh,t))}};this.init();e.nicescroll.push(this)},g=function(e){var t=this;this.nc=e;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(e,o){t.stop();var i=t.time();t.steptime=0;t.lasttime=i;t.speedx=0;t.speedy=0;t.lastx=e;t.lasty=o;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(e,o){var i=t.time();t.steptime=i-t.lasttime;t.lasttime=i;var i=o-t.lasty,r=e-t.lastx,s=t.nc.getScrollTop(),n=t.nc.getScrollLeft(),s=s+i,n=n+r;t.snapx=0>n||n>t.nc.page.maxw;t.snapy=0>s||s>t.nc.page.maxh;t.speedx=r;t.speedy=i;t.lastx=e;t.lasty=o};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&clearTimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.doSnapy=function(e,o){var i=!1;0>o?(o=0,i=!0):o>t.nc.page.maxh&&(o=t.nc.page.maxh,i=!0);0>e?(e=0,i=!0):e>t.nc.page.maxw&&(e=t.nc.page.maxw,i=!0);i?t.nc.doScrollPos(e,o,t.nc.opt.snapbackspeed):t.nc.triggerScrollEnd()};this.doMomentum=function(e){var o=t.time(),i=e?o+e:t.lasttime;e=t.nc.getScrollLeft();var r=t.nc.getScrollTop(),s=t.nc.page.maxh,n=t.nc.page.maxw;t.speedx=0<n?Math.min(60,t.speedx):0;t.speedy=0<s?Math.min(60,t.speedy):0;i=i&&60>=o-i;if(0>r||r>s||0>e||e>n)i=!1;e=t.speedx&&i?t.speedx:!1;if(t.speedy&&i&&t.speedy||e){var a=Math.max(16,t.steptime);50<a&&(e=a/50,t.speedx*=e,t.speedy*=e,a=50);t.demulxy=0;t.lastscrollx=t.nc.getScrollLeft();t.chkx=t.lastscrollx;t.lastscrolly=t.nc.getScrollTop();t.chky=t.lastscrolly;var l=t.lastscrollx,c=t.lastscrolly,d=function(){var e=600<t.time()-o?.04:.02;t.speedx&&(l=Math.floor(t.lastscrollx-t.speedx*(1-t.demulxy)),t.lastscrollx=l,0>l||l>n)&&(e=.1);t.speedy&&(c=Math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=c,0>c||c>s)&&(e=.1);t.demulxy=Math.min(1,t.demulxy+e);t.nc.synched("domomentum2d",function(){t.speedx&&(t.nc.getScrollLeft(),t.chkx=l,t.nc.setScrollLeft(l));t.speedy&&(t.nc.getScrollTop(),t.chky=c,t.nc.setScrollTop(c));t.timer||(t.nc.hideCursor(),t.doSnapy(l,c))});1>t.demulxy?t.timer=setTimeout(d,a):(t.stop(),t.nc.hideCursor(),t.doSnapy(l,c))};d()}else t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}},w=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(t,o,i){return(o=e.data(t,"__nicescroll")||!1)&&o.ishwscroll?o.getScrollTop():w.call(t)},set:function(t,o){var i=e.data(t,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollTop(parseInt(o)):w.call(t,o);return this}};e.fn.scrollTop=function(t){if(void 0===t){var o=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollTop():w.call(this)}return this.each(function(){var o=e.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollTop(parseInt(t)):w.call(e(this),t)})};var v=e.fn.scrollLeft;e.cssHooks.pageXOffset={get:function(t,o,i){return(o=e.data(t,"__nicescroll")||!1)&&o.ishwscroll?o.getScrollLeft():v.call(t)},set:function(t,o){var i=e.data(t,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollLeft(parseInt(o)):v.call(t,o);return this}};e.fn.scrollLeft=function(t){if(void 0===t){var o=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return o&&o.ishwscroll?o.getScrollLeft():v.call(this)}return this.each(function(){var o=e.data(this,"__nicescroll")||!1;o&&o.ishwscroll?o.setScrollLeft(parseInt(t)):v.call(e(this),t)})};var y=function(t){var o=this;this.length=0;this.name="nicescrollarray";this.each=function(t){e.each(o,t);return o};this.push=function(e){o[o.length]=e;o.length++};this.eq=function(e){return o[e]};if(t)for(var i=0;i<t.length;i++){var r=e.data(t[i],"__nicescroll")||!1;r&&(this[this.length]=r,this.length++)}return this};(function(e,t,o){for(var i=0;i<t.length;i++)o(e,t[i])})(y.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(e,t){e[t]=function(){var e=arguments;return this.each(function(){this[t].apply(this,e)})}});e.fn.getNiceScroll=function(t){return void 0===t?new y(this):this[t]&&e.data(this[t],"__nicescroll")||!1};e.expr[":"].nicescroll=function(t){return void 0!==e.data(t,"__nicescroll")};e.fn.niceScroll=function(t,o){void 0!==o||"object"!=typeof t||"jquery"in t||(o=t,t=!1);o=e.extend({},o);var i=new y;void 0===o&&(o={});t&&(o.doc=e(t),o.win=e(this));var r=!("doc"in o);r||"win"in o||(o.win=e(this));this.each(function(){var t=e(this).data("__nicescroll")||!1;t||(o.doc=r?e(this):o.doc,t=new f(o,e(this)),e(this).data("__nicescroll",t));i.push(t)});return 1==i.length?i[0]:i};window.NiceScroll={getjQuery:function(){return e}};e.nicescroll||(e.nicescroll=new y,e.nicescroll.options=h)});