/* * tipper v3.0.2 - 2014-02-12 * a jquery plugin for simple tooltips. part of the formstone library. * http://formstone.it/tipper/ * * copyright 2014 ben plum; mit licensed */ !function(a){"use strict";function b(b){return h.formatter=d,a(this).not(".tipper-attached").addclass("tipper-attached").on("mouseenter.tipper",a.extend({},h,b||{}),c)}function c(b){g=a("body");var c=a(this),d=a.extend(!0,{},b.data,c.data("tipper-options")),h="";h+='
',h+='
',h+=d.formatter.apply(g,[c]),h+='',h+="
",h+="
",d.$target=c,d.$tipper=a(h),g.append(d.$tipper),d.$content=d.$tipper.find(".tipper-content"),d.$caret=d.$tipper.find(".tipper-caret"),d.offset=c.offset(),d.height=c.outerheight(),d.width=c.outerwidth(),d.tipperpos={},d.caretpos={},d.contentpos={};var i=d.$caret.outerheight(!0),j=d.$caret.outerwidth(!0),k=d.$content.outerheight(!0),l=d.$content.outerwidth(!0)+j;"right"===d.direction||"left"===d.direction?(d.caretpos.top=(k-i)/2,d.contentpos.top=-k/2,"right"===d.direction?d.contentpos.left=j+d.margin:"left"===d.direction&&(d.contentpos.left=-(l+d.margin))):(d.caretpos.left=(l-j)/2,d.contentpos.left=-l/2,"bottom"===d.direction?d.contentpos.top=d.margin:"top"===d.direction&&(d.contentpos.top=-(k+d.margin))),d.$content.css(d.contentpos),d.$caret.css(d.caretpos),d.follow?d.$target.on("mousemove.tipper",d,e).trigger("mousemove"):("right"===d.direction||"left"===d.direction?(d.tipperpos.top=d.offset.top+d.height/2,"right"===d.direction?d.tipperpos.left=d.offset.left+d.width:"left"===d.direction&&(d.tipperpos.left=d.offset.left)):(d.tipperpos.left=d.offset.left+d.width/2,"bottom"===d.direction?d.tipperpos.top=d.offset.top+d.height:"top"===d.direction&&(d.tipperpos.top=d.offset.top)),d.$tipper.css(d.tipperpos)),d.$target.one("mouseleave.tipper",d,f)}function d(a){return a.data("title")}function e(a){var b=a.data;b.$tipper.css({left:a.pagex,top:a.pagey})}function f(a){var b=a.data;b.$tipper.remove(),b.$target.off("mousemove.tipper mouseleave.tipper")}var g,h={direction:"top",follow:!1,formatter:a.noop,margin:15},i={defaults:function(b){return h=a.extend(h,b||{}),a(this)},destroy:function(){return a(this).trigger("mouseleave.tipper").off(".tipper").removeclass("tipper-attached")}};a.fn.tipper=function(a){return i[a]?i[a].apply(this,array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?this:b.apply(this,arguments)},a.tipper=function(a){"defaults"===a&&i.defaults.apply(this,array.prototype.slice.call(arguments,1))}}(jquery); /** * isotope v1.5.25 * an exquisite jquery plugin for magical layouts * http://isotope.metafizzy.co * * commercial use requires one-time license fee * http://metafizzy.co/#licenses * * copyright 2012 david desandro / metafizzy */ (function(a,b,c){"use strict";var d=a.document,e=a.modernizr,f=function(a){return a.charat(0).touppercase()+a.slice(1)},g="moz webkit o ms".split(" "),h=function(a){var b=d.documentelement.style,c;if(typeof b[a]=="string")return a;a=f(a);for(var e=0,h=g.length;e"+d+"{#modernizr{height:3px}}"+"").appendto("head"),f=b('
').appendto("html");a=f.height()===3,f.remove(),e.remove()}return a},csstransitions:function(){return!!j}},l;if(e)for(l in k)e.hasownproperty(l)||e.addtest(l,k[l]);else{e=a.modernizr={_version:"1.6ish: minimodernizr for isotope"};var m=" ",n;for(l in k)n=k[l](),e[l]=n,m+=" "+(n?"":"no-")+l;b("html").addclass(m)}if(e.csstransforms){var o=e.csstransforms3d?{translate:function(a){return"translate3d("+a[0]+"px, "+a[1]+"px, 0) "},scale:function(a){return"scale3d("+a+", "+a+", 1) "}}:{translate:function(a){return"translate("+a[0]+"px, "+a[1]+"px) "},scale:function(a){return"scale("+a+") "}},p=function(a,c,d){var e=b.data(a,"isotransform")||{},f={},g,h={},j;f[c]=d,b.extend(e,f);for(g in e)j=e[g],h[g]=o[g](j);var k=h.translate||"",l=h.scale||"",m=k+l;b.data(a,"isotransform",e),a.style[i]=m};b.cssnumber.scale=!0,b.csshooks.scale={set:function(a,b){p(a,"scale",b)},get:function(a,c){var d=b.data(a,"isotransform");return d&&d.scale?d.scale:1}},b.fx.step.scale=function(a){b.csshooks.scale.set(a.elem,a.now+a.unit)},b.cssnumber.translate=!0,b.csshooks.translate={set:function(a,b){p(a,"translate",b)},get:function(a,c){var d=b.data(a,"isotransform");return d&&d.translate?d.translate:[0,0]}}}var q,r;e.csstransitions&&(q={webkittransitionproperty:"webkittransitionend",moztransitionproperty:"transitionend",otransitionproperty:"otransitionend otransitionend",transitionproperty:"transitionend"}[j],r=h("transitionduration"));var s=b.event,t=b.event.handle?"handle":"dispatch",u;s.special.smartresize={setup:function(){b(this).bind("resize",s.special.smartresize.handler)},teardown:function(){b(this).unbind("resize",s.special.smartresize.handler)},handler:function(a,b){var c=this,d=arguments;a.type="smartresize",u&&cleartimeout(u),u=settimeout(function(){s[t].apply(c,d)},b==="execasap"?0:100)}},b.fn.smartresize=function(a){return a?this.bind("smartresize",a):this.trigger("smartresize",["execasap"])},b.isotope=function(a,c,d){this.element=b(c),this._create(a),this._init(d)};var v=["width","height"],w=b(a);b.isotope.settings={resizable:!0,layoutmode:"masonry",containerclass:"isotope",itemclass:"isotope-item",hiddenclass:"isotope-hidden",hiddenstyle:{opacity:0,scale:.001},visiblestyle:{opacity:1,scale:1},containerstyle:{position:"relative",overflow:"hidden"},animationengine:"best-available",animationoptions:{queue:!1,duration:800},sortby:"original-order",sortascending:!0,resizescontainer:!0,transformsenabled:!0,itempositiondataenabled:!1},b.isotope.prototype={_create:function(a){this.options=b.extend({},b.isotope.settings,a),this.stylequeue=[],this.elemcount=0;var c=this.element[0].style;this.originalstyle={};var d=v.slice(0);for(var e in this.options.containerstyle)d.push(e);for(var f=0,g=d.length;fg?1:f0&&(i=function(a,b){b.$el[d](b.style,f).one(q,k)},j=!1)}}b.each(this.stylequeue,i),j&&k(),this.stylequeue=[]},resize:function(){this["_"+this.options.layoutmode+"resizechanged"]()&&this.relayout()},relayout:function(a){this["_"+this.options.layoutmode+"reset"](),this.layout(this.$filteredatoms,a)},additems:function(a,b){var c=this._getatoms(a);this.$allatoms=this.$allatoms.add(c),b&&b(c)},insert:function(a,b){this.element.append(a);var c=this;this.additems(a,function(a){var d=c._filter(a);c._addhideappended(d),c._sort(),c.relayout(),c._revealappended(d,b)})},appended:function(a,b){var c=this;this.additems(a,function(a){c._addhideappended(a),c.layout(a),c._revealappended(a,b)})},_addhideappended:function(a){this.$filteredatoms=this.$filteredatoms.add(a),a.addclass("no-transition"),this._isinserting=!0,this.stylequeue.push({$el:a,style:this.options.hiddenstyle})},_revealappended:function(a,b){var c=this;settimeout(function(){a.removeclass("no-transition"),c.stylequeue.push({$el:a,style:c.options.visiblestyle}),c._isinserting=!1,c._processstylequeue(a,b)},10)},reloaditems:function(){this.$allatoms=this._getatoms(this.element.children())},remove:function(a,b){this.$allatoms=this.$allatoms.not(a),this.$filteredatoms=this.$filteredatoms.not(a);var c=this,d=function(){a.remove(),b&&b.call(c.element)};a.filter(":not(."+this.options.hiddenclass+")").length?(this.stylequeue.push({$el:a,style:this.options.hiddenstyle}),this._sort(),this.relayout(d)):d()},shuffle:function(a){this.updatesortdata(this.$allatoms),this.options.sortby="random",this._sort(),this.relayout(a)},destroy:function(){var a=this.usingtransforms,b=this.options;this.$allatoms.removeclass(b.hiddenclass+" "+b.itemclass).each(function(){var b=this.style;b.position="",b.top="",b.left="",b.opacity="",a&&(b[i]="")});var c=this.element[0].style;for(var d in this.originalstyle)c[d]=this.originalstyle[d];this.element.unbind(".isotope").undelegate("."+b.hiddenclass,"click").removeclass(b.containerclass).removedata("isotope"),w.unbind(".isotope")},_getsegments:function(a){var b=this.options.layoutmode,c=a?"rowheight":"columnwidth",d=a?"height":"width",e=a?"rows":"cols",g=this.element[d](),h,i=this.options[b]&&this.options[b][c]||this.$filteredatoms["outer"+f(d)](!0)||g;h=math.floor(g/i),h=math.max(h,1),this[b][e]=h,this[b][c]=i},_checkifsegmentschanged:function(a){var b=this.options.layoutmode,c=a?"rows":"cols",d=this[b][c];return this._getsegments(a),this[b][c]!==d},_masonryreset:function(){this.masonry={},this._getsegments();var a=this.masonry.cols;this.masonry.colys=[];while(a--)this.masonry.colys.push(0)},_masonrylayout:function(a){var c=this,d=c.masonry;a.each(function(){var a=b(this),e=math.ceil(a.outerwidth(!0)/d.columnwidth);e=math.min(e,d.cols);if(e===1)c._masonryplacebrick(a,d.colys);else{var f=d.cols+1-e,g=[],h,i;for(i=0;id&&(e.x=0,e.y=e.height),c._pushposition(a,e.x,e.y),e.height=math.max(e.y+g,e.height),e.x+=f})},_fitrowsgetcontainersize:function(){return{height:this.fitrows.height}},_fitrowsresizechanged:function(){return!0},_cellsbyrowreset:function(){this.cellsbyrow={index:0},this._getsegments(),this._getsegments(!0)},_cellsbyrowlayout:function(a){var c=this,d=this.cellsbyrow;a.each(function(){var a=b(this),e=d.index%d.cols,f=math.floor(d.index/d.cols),g=(e+.5)*d.columnwidth-a.outerwidth(!0)/2,h=(f+.5)*d.rowheight-a.outerheight(!0)/2;c._pushposition(a,g,h),d.index++})},_cellsbyrowgetcontainersize:function(){return{height:math.ceil(this.$filteredatoms.length/this.cellsbyrow.cols)*this.cellsbyrow.rowheight+this.offset.top}},_cellsbyrowresizechanged:function(){return this._checkifsegmentschanged()},_straightdownreset:function(){this.straightdown={y:0}},_straightdownlayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushposition(d,0,c.straightdown.y),c.straightdown.y+=d.outerheight(!0)})},_straightdowngetcontainersize:function(){return{height:this.straightdown.y}},_straightdownresizechanged:function(){return!0},_masonryhorizontalreset:function(){this.masonryhorizontal={},this._getsegments(!0);var a=this.masonryhorizontal.rows;this.masonryhorizontal.rowxs=[];while(a--)this.masonryhorizontal.rowxs.push(0)},_masonryhorizontallayout:function(a){var c=this,d=c.masonryhorizontal;a.each(function(){var a=b(this),e=math.ceil(a.outerheight(!0)/d.rowheight);e=math.min(e,d.rows);if(e===1)c._masonryhorizontalplacebrick(a,d.rowxs);else{var f=d.rows+1-e,g=[],h,i;for(i=0;id&&(e.x=e.width,e.y=0),c._pushposition(a,e.x,e.y),e.width=math.max(e.x+f,e.width),e.y+=g})},_fitcolumnsgetcontainersize:function(){return{width:this.fitcolumns.width}},_fitcolumnsresizechanged:function(){return!0},_cellsbycolumnreset:function(){this.cellsbycolumn={index:0},this._getsegments(),this._getsegments(!0)},_cellsbycolumnlayout:function(a){var c=this,d=this.cellsbycolumn;a.each(function(){var a=b(this),e=math.floor(d.index/d.rows),f=d.index%d.rows,g=(e+.5)*d.columnwidth-a.outerwidth(!0)/2,h=(f+.5)*d.rowheight-a.outerheight(!0)/2;c._pushposition(a,g,h),d.index++})},_cellsbycolumngetcontainersize:function(){return{width:math.ceil(this.$filteredatoms.length/this.cellsbycolumn.rows)*this.cellsbycolumn.columnwidth}},_cellsbycolumnresizechanged:function(){return this._checkifsegmentschanged(!0)},_straightacrossreset:function(){this.straightacross={x:0}},_straightacrosslayout:function(a){var c=this;a.each(function(a){var d=b(this);c._pushposition(d,c.straightacross.x,0),c.straightacross.x+=d.outerwidth(!0)})},_straightacrossgetcontainersize:function(){return{width:this.straightacross.x}},_straightacrossresizechanged:function(){return!0}},b.fn.imagesloaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&&b.inarray(c,g)===-1&&(g.push(c),--e<=0&&(settimeout(h),d.unbind(".imagesloaded",i)))}var c=this,d=c.find("img").add(c.filter("img")),e=d.length,f="data:image/gif;base64,r0lgodlhaqabaiaaaaaaap///ywaaaaaaqabaaacauwaow==",g=[];return e||h(),d.bind("load.imagesloaded error.imagesloaded",i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var x=function(b){a.console&&a.console.error(b)};b.fn.isotope=function(a,c){if(typeof a=="string"){var d=array.prototype.slice.call(arguments,1);this.each(function(){var c=b.data(this,"isotope");if(!c){x("cannot call methods on isotope prior to initialization; attempted to call method '"+a+"'");return}if(!b.isfunction(c[a])||a.charat(0)==="_"){x("no such method '"+a+"' for isotope instance");return}c[a].apply(c,d)})}else this.each(function(){var d=b.data(this,"isotope");d?(d.option(a),d._init(c)):b.data(this,"isotope",new b.isotope(a,this,c))});return this}})(window,jquery); /*! * jquery.counterup.js 1.0 * * copyright 2013, benjamin intal http://gambit.ph @bfintal * released under the gpl v2 license * * date: nov 26, 2013 */(function(e){"use strict";e.fn.counterup=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseint(i/n*f);u&&(l=parsefloat(i/n*f).tofixed(a));if(s)while(/(\d+)(\d{3})/.test(l.tostring()))l=l.tostring().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)settimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);settimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggeronce:!0})})}})(jquery); // generated by coffeescript 1.6.2 /* jquery waypoints - v2.0.3 copyright (c) 2011-2013 caleb troughton dual licensed under the mit license and gpl license. https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt */ (function(){var t=[].indexof||function(t){for(var e=0,n=this.length;e=0;s={horizontal:{},vertical:{}};f=1;a={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didresize=false;this.didscroll=false;this.id="context"+f++;this.oldscroll={x:t.scrollleft(),y:t.scrolltop()};this.waypoints={horizontal:{},vertical:{}};t.data(u,this.id);a[this.id]=this;t.bind(y,function(){var t;if(!(e.didscroll||c)){e.didscroll=true;t=function(){e.doscroll();return e.didscroll=false};return r.settimeout(t,n[m].settings.scrollthrottle)}});t.bind(p,function(){var t;if(!e.didresize){e.didresize=true;t=function(){n[m]("refresh");return e.didresize=false};return r.settimeout(t,n[m].settings.resizethrottle)}})}t.prototype.doscroll=function(){var t,e=this;t={horizontal:{newscroll:this.$element.scrollleft(),oldscroll:this.oldscroll.x,forward:"right",backward:"left"},vertical:{newscroll:this.$element.scrolltop(),oldscroll:this.oldscroll.y,forward:"down",backward:"up"}};if(c&&(!t.vertical.oldscroll||!t.vertical.newscroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newscroll>r.oldscroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldscroll<(n=e.offset)&&n<=r.newscroll){return l.push(e)}else if(r.newscroll<(i=e.offset)&&i<=r.oldscroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldscroll={x:t.horizontal.newscroll,y:t.vertical.newscroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.iswindow(this.element);e=this.$element.offset();this.doscroll();t={horizontal:{contextoffset:r?0:e.left,contextscroll:r?0:this.oldscroll.x,contextdimension:this.$element.width(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:r?0:e.top,contextscroll:r?0:this.oldscroll.y,contextdimension:r?n[m]("viewportheight"):this.$element.height(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.iswindow(r.element)?0:r.$element.offset()[e.offsetprop];if(n.isfunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parsefloat(i);if(r.options.offset.indexof("%")>-1){i=math.ceil(e.contextdimension*i/100)}}r.offset=o-e.contextoffset+e.contextscroll-i;if(r.options.onlyonscroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldscroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldscroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldscroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkempty=function(){if(n.isemptyobject(this.waypoints.horizontal)&&n.isemptyobject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete a[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;r=n.extend({},n.fn[g].defaults,r);if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportheight");if(!n.iswindow(e.element)){t=e.$element.height()}return t-n(this).outerheight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=t.data(w))!=null?o:[];i.push(this.id);t.data(w,i)}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggeronce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkempty()};t.getwaypointsbyelement=function(t){var e,r;r=n(t).data(w);if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;if(e==null){e={}}if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.iswindow(i)){i=t.closest(i)}i=n(i);r=a[i.data(u)];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke(this,"disable")},enable:function(){return d._invoke(this,"enable")},destroy:function(){return d._invoke(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(et.oldscroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldscroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldscroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendfn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=a[n(t).data(u)];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizethrottle:100,scrollthrottle:30};return i.load(function(){return n[m]("refresh")})})}).call(this); /* _ _ _____ _ _ | | | __ \ | | (_) ___ ___ _ __ ___ | | | |__) |_____ _____ __ _| | _ ___ / __|/ __| '__/ _ \| | | _ // _ \ \ / / _ \/ _` | | | / __| \__ \ (__| | | (_) | | | | \ \ __/\ v / __/ (_| | |_| \__ \ |___/\___|_| \___/|_|_|_| \_\___| \_/ \___|\__,_|_(_) |___/ _/ | |__/ "declarative on-scroll reveal animations." /*============================================================================= scrollreveal.js is inspired by cbpscroller.js, © 2014, codrops. licensed under the mit license. http://www.opensource.org/licenses/mit-license.php scrollreveal.js, © 2014 https://twitter.com/julianlloyd =============================================================================*/ ;(function(window){'use strict';var docelem=window.document.documentelement;function getviewporth(){var client=docelem['clientheight'],inner=window['innerheight'];return(client=scrolled}function extend(a,b){for(var key in b){if(b.hasownproperty(key)){a[key]=b[key]}}return a}function scrollreveal(options){this.options=extend(this.defaults,options);this._init()}scrollreveal.prototype={defaults:{axis:'y',distance:'25px',duration:'0.66s',delay:'0s',viewportfactor:0.33},_init:function(){var self=this;this.elems=array.prototype.slice.call(docelem.queryselectorall('[data-scrollreveal]'));this.scrolled=false;this.elems.foreach(function(el,i){self.animate(el)});var scrollhandler=function(){if(!self.scrolled){self.scrolled=true;settimeout(function(){self._scrollpage()},60)}};var resizehandler=function(){function delayed(){self._scrollpage();self.resizetimeout=null}if(self.resizetimeout){cleartimeout(self.resizetimeout)}self.resizetimeout=settimeout(delayed,200)};window.addeventlistener('scroll',scrollhandler,false);window.addeventlistener('resize',resizehandler,false)},_scrollpage:function(){var self=this;this.elems.foreach(function(el,i){if(iselementinviewport(el,self.options.viewportfactor)){self.animate(el)}});this.scrolled=false},parselanguage:function(el){var words=el.getattribute('data-scrollreveal').split(/[, ]+/),enterfrom,parsed={};function filter(words){var ret=[],blacklist=["from","the","and","then","but"];words.foreach(function(word,i){if(blacklist.indexof(word)>-1){return}ret.push(word)});return ret}words=filter(words);words.foreach(function(word,i){switch(word){case"enter":enterfrom=words[i+1];if(enterfrom=="top"||enterfrom=="bottom"){parsed.axis="y"}if(enterfrom=="left"||enterfrom=="right"){parsed.axis="x"}return;case"after":parsed.delay=words[i+1];return;case"wait":parsed.delay=words[i+1];return;case"move":parsed.distance=words[i+1];return;case"over":parsed.duration=words[i+1];return;case"trigger":parsed.eventname=words[i+1];return;default:return}});if(enterfrom=="top"||enterfrom=="left"){if(!typeof parsed.distance=="undefined"){parsed.distance="-"+parsed.distance}else{parsed.distance="-"+this.options.distance}}return parsed},gencss:function(el,axis){var parsed=this.parselanguage(el);var dist=parsed.distance||this.options.distance,dur=parsed.duration||this.options.duration,delay=parsed.delay||this.options.delay,axis=parsed.axis||this.options.axis;var transition="-webkit-transition: all "+dur+" ease "+delay+";"+"-moz-transition: all "+dur+" ease "+delay+";"+"-o-transition: all "+dur+" ease "+delay+";"+"transition: all "+dur+" ease "+delay+";";var initial="-webkit-transform: translate"+axis+"("+dist+");"+"-moz-transform: translate"+axis+"("+dist+");"+"transform: translate"+axis+"("+dist+");"+"opacity: 0;";var target="-webkit-transform: translate"+axis+"(0);"+"-moz-transform: translate"+axis+"(0);"+"transform: translate"+axis+"(0);"+"opacity: 1;";return{transition:transition,initial:initial,target:target,totalduration:((parsefloat(dur)+parsefloat(delay))*1000)}},animate:function(el){var css=this.gencss(el);if(!el.getattribute('data-sr-init')){el.setattribute('style',css.initial);el.setattribute('data-sr-init',true)}if(el.getattribute('data-sr-complete')){return}if(iselementinviewport(el,this.options.viewportfactor)){el.setattribute('style',css.target+css.transition);settimeout(function(){el.removeattribute('style');el.setattribute('data-sr-complete',true)},css.totalduration)}}};document.addeventlistener("domcontentloaded",function(evt){window.scrollreveal=new scrollreveal()})})(window); /* jquery.nicescroll 3.1.2 inuyaksa*2012 mit http://areaaperta.com/nicescroll */(function(e){var r=false,w=false,b=5e3,c=2e3,d=function(){var e=document.getelementsbytagname("script"),e=e[e.length-1].src.split("?")[0];return e.split("/").length>0?e.split("/").slice(0,-1).join("/")+"/":""}(),p=window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||window.orequestanimationframe||window.msrequestanimationframe||false,q=window.cancelrequestanimationframe||window.webkitcancelrequestanimationframe||window.mozcancelrequestanimationframe||window.ocancelrequestanimationframe||window.mscancelrequestanimationframe||false,x=false,e=function(){if(x)return x;var e=document.createelement("div"),c={haspointerlock:"pointerlockelement"in document||"mozpointerlockelement"in document||"webkitpointerlockelement"in document};c.isopera="opera"in window;c.isopera12=c.isopera&&"getusermedia"in navigator;c.isie="all"in document&&"attachevent"in e&&!c.isopera;c.isieold=c.isie&&!("msinterpolationmode"in e.style);c.isie7=c.isie&&!c.isieold&&(!("documentmode"in document)||document.documentmode==7);c.isie8=c.isie&&"documentmode"in document&&document.documentmode==8;c.isie9=c.isie&&"performance"in window&&document.documentmode>=9;c.isie10=c.isie&&"performance"in window&&document.documentmode>=10;c.isie9mobile=/iemobile.9/i.test(navigator.useragent);if(c.isie9mobile)c.isie9=false;c.isie7mobile=!c.isie9mobile&&c.isie7&&/iemobile/i.test(navigator.useragent);c.ismozilla="mozappearance"in e.style;c.iswebkit="webkitappearance"in e.style;c.ischrome="chrome"in window;c.ischrome22=c.ischrome&&c.haspointerlock;c.cantouch="ontouchstart"in document.documentelement||"ontouchstart"in window;c.hasmstouch=window.navigator.mspointerenabled||false;c.ismac=/^mac$/i.test(navigator.platform);c.isios=c.cantouch&&/iphone|ipad|ipod/i.test(navigator.platform);c.isios4=c.isios&&!("seal"in object);c.isandroid=/android/i.test(navigator.useragent);c.trstyle=false;c.hastransform=false;c.hastranslate3d=false;c.transitionstyle=false;c.hastransition=false;c.transitionend=false;for(var h=["transform","mstransform","webkittransform","moztransform","otransform"],i=0;ih&&!e.tt)b.delaylist[d]={last:h+g,tt:settimeout(function(){b.delaylist[d].tt=0;c.call()},g)};else if(!e||!e.tt)b.delaylist[d]={last:h,tt:0},settimeout(function(){c.call()},0)};this.synched=function(d,c){b.synclist[d]=c;(function(){if(!b.onsync)p(function(){b.onsync=false;for(d in b.synclist){var c=b.synclist[d];c&&c.call(b);b.synclist[d]=false}}),b.onsync=true})();return d};this.unsynched=function(d){b.synclist[d]&&(b.synclist[d]=false)};this.css=function(d,c){for(var g in c)b.saved.css.push([d,g,d.css(g)]),d.css(g,c[g])};this.scrolltop=function(d){return typeof d=="undefined"?b.getscrolltop():b.setscrolltop(d)};this.scrollleft=function(d){return typeof d=="undefined"?b.getscrollleft():b.setscrollleft(d)};bezierclass=function(b,c,g,f,e,h,i){this.st=b;this.ed=c;this.spd=g;this.p1=f||0;this.p2=e||1;this.p3=h||0;this.p4=i||1;this.ts=(new date).gettime();this.df=this.ed-this.st};bezierclass.prototype={b2:function(b){return 3*b*b*(1-b)},b3:function(b){return 3*b*(1-b)*(1-b)},b4:function(b){return(1-b)*(1-b)*(1-b)},getnow:function(){var b=1-((new date).gettime()-this.ts)/this.spd,c=this.b2(b)+this.b3(b)+this.b4(b);return b<0?this.ed:this.st+math.round(this.df*c)},update:function(b,c){this.st=this.getnow();this.ed=b;this.spd=c;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"};f.hastranslate3d&&f.isios&&this.doc.css("-webkit-backface-visibility","hidden");var m=function(){var d=b.doc.css(f.trstyle);return d&&d.substr(0,6)=="matrix"?d.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):false};this.getscrolltop=function(d){if(!d){if(d=m())return d.length==16?-d[13]:-d[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getnow()}return b.doc.translate.y};this.getscrollleft=function(d){if(!d){if(d=m())return d.length==16?-d[12]:-d[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getnow()}return b.doc.translate.x};this.notifyscrollevent=document.createevent?function(b){var c=document.createevent("uievents");c.inituievent("scroll",false,true,window,1);b.dispatchevent(c)}:document.fireevent?function(b){var c=document.createeventobject();b.fireevent("onscroll");c.cancelbubble=true}:function(){};f.hastranslate3d&&b.opt.enabletranslate3d?(this.setscrolltop=function(d,c){b.doc.translate.y=d;b.doc.translate.ty=d*-1+"px";b.doc.css(f.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0px)");c||b.notifyscrollevent(b.win[0])},this.setscrollleft=function(d,c){b.doc.translate.x=d;b.doc.translate.tx=d*-1+"px";b.doc.css(f.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0px)");c||b.notifyscrollevent(b.win[0])}):(this.setscrolltop=function(d,c){b.doc.translate.y=d;b.doc.translate.ty=d*-1+"px";b.doc.css(f.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");c||b.notifyscrollevent(b.win[0])},this.setscrollleft=function(d,c){b.doc.translate.x=d;b.doc.translate.tx=d*-1+"px";b.doc.css(f.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");c||b.notifyscrollevent(b.win[0])})}else this.getscrolltop=function(){return b.docscroll.scrolltop()},this.setscrolltop=function(d){return b.docscroll.scrolltop(d)},this.getscrollleft=function(){return b.docscroll.scrollleft()},this.setscrollleft=function(d){return b.docscroll.scrollleft(d)};this.gettarget=function(b){return!b?false:b.target?b.target:b.srcelement?b.srcelement:false};this.hasparent=function(b,c){if(!b)return false;for(var g=b.target||b.srcelement||b||false;g&&g.id!=c;)g=g.parentnode||false;return g!==false};var o={thin:1,medium:3,thick:5};this.getoffset=function(){if(b.isfixed)return{top:parsefloat(b.win.css("top")),left:parsefloat(b.win.css("left"))};if(!b.viewport)return b.win.offset();var d=b.win.offset(),c=b.viewport.offset();return{top:d.top-c.top+b.viewport.scrolltop(),left:d.left-c.left+b.viewport.scrollleft()}};this.updatescrollbar=function(d){if(b.ishwscroll)b.rail.css({height:b.win.innerheight()}),b.railh&&b.railh.css({width:b.win.innerwidth()});else{var c=b.getoffset(),g=c.top,f=c.left;g+=h(b.win,"border-top-width",true);b.win.outerwidth();b.win.innerwidth();f+=b.rail.align?b.win.outerwidth()-h(b.win,"border-right-width")-b.rail.width:h(b.win,"border-left-width");var e=b.opt.railoffset;e&&(e.top&&(g+=e.top),b.rail.align&&e.left&&(f+=e.left));b.locked||b.rail.css({top:g,left:f,height:d?d.h:b.win.innerheight()});b.zoom&&b.zoom.css({top:g+1,left:b.rail.align==1?f-20:f+b.rail.width+4});if(b.railh&&!b.locked)g=c.top,f=c.left,d=b.railh.align?g+h(b.win,"border-top-width",true)+b.win.innerheight()-b.railh.height:g+h(b.win,"border-top-width",true),f+=h(b.win,"border-left-width"),b.railh.css({top:d,left:f,width:b.railh.width})}};this.dorailclick=function(d,c,g){var f;!(b.rail.drag&&b.rail.drag.pt!=1)&&!b.locked&&!b.rail.drag&&(b.cancelscroll(),b.cancelevent(d),c?(c=g?b.doscrollleft:b.doscrolltop,f=g?(d.pagex-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(d.pagey-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y,c(f)):(c=g?b.doscrollleftby:b.doscrollby,f=g?b.scroll.x:b.scroll.y,d=g?d.pagex-b.railh.offset().left:d.pagey-b.rail.offset().top,g=g?b.view.w:b.view.h,f>=d?c(g):c(-g)))};b.hasanimationframe=p;b.hascancelanimationframe=q;b.hasanimationframe?b.hascancelanimationframe||(q=function(){b.cancelanimationframe=true}):(p=function(b){return settimeout(b,16)},q=clearinterval);this.init=function(){b.saved.css=[];if(f.isie7mobile)return true;f.hasmstouch&&b.css(b.ispage?e("html"):b.win,{"-ms-touch-action":"none"});if(!b.ispage||!f.cantouch&&!f.isieold&&!f.isie9mobile){var d=b.docscroll;b.ispage&&(d=b.haswrapper?b.win:b.doc);f.isie9mobile||b.css(d,{"overflow-y":"hidden"});b.ispage&&f.isie7&&(b.doc[0].nodename=="body"?b.css(e("html"),{"overflow-y":"hidden"}):b.doc[0].nodename=="html"&&b.css(e("body"),{"overflow-y":"hidden"}));f.isios&&!b.ispage&&!b.haswrapper&&b.css(e("body"),{"-webkit-overflow-scrolling":"touch"});var c=e(document.createelement("div"));c.css({position:"relative",top:0,"float":"right",width:b.opt.cursorwidth,height:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.hborder=parsefloat(c.outerheight()-c.innerheight());b.cursor=c;var g=e(document.createelement("div"));g.attr("id",b.id);var h,i,j=["left","right"],y;for(y in j)i=j[y],(h=b.opt.railpadding[i])?g.css("padding-"+i,h+"px"):b.opt.railpadding[i]=0;g.append(c);g.width=math.max(parsefloat(b.opt.cursorwidth),c.outerwidth())+b.opt.railpadding.left+b.opt.railpadding.right;g.css({width:g.width+"px",zindex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});g.visibility=true;g.scrollable=true;g.align=b.opt.railalign=="left"?0:1;b.rail=g;c=b.rail.drag=false;if(b.opt.boxzoom&&!b.ispage&&!f.isieold&&(c=document.createelement("div"),b.bind(c,"click",b.dozoom),b.zoom=e(c),b.zoom.css({cursor:"pointer","z-index":b.opt.zindex,backgroundimage:"url("+d+"zoomico.png)",height:18,width:18,backgroundposition:"0px 0px"}),b.opt.dblclickzoom&&b.bind(b.win,"dblclick",b.dozoom),f.cantouch&&b.opt.gesturezoom))b.ongesturezoom=function(d){d.scale>1.5&&b.dozoomin(d);d.scale<0.8&&b.dozoomout(d);return b.cancelevent(d)},b.bind(b.win,"gestureend",b.ongesturezoom);b.railh=false;if(b.opt.horizrailenabled){b.css(d,{"overflow-x":"hidden"});c=e(document.createelement("div"));c.css({position:"relative",top:0,height:b.opt.cursorwidth,width:"0px","background-color":b.opt.cursorcolor,border:b.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":b.opt.cursorborderradius,"-moz-border-radius":b.opt.cursorborderradius,"border-radius":b.opt.cursorborderradius});c.wborder=parsefloat(c.outerwidth()-c.innerwidth());b.cursorh=c;var k=e(document.createelement("div"));k.attr("id",b.id+"-hr");k.height=1+math.max(parsefloat(b.opt.cursorwidth),c.outerheight());k.css({height:k.height+"px",zindex:b.ispage?b.opt.zindex:b.opt.zindex+2,background:b.opt.background});k.append(c);k.visibility=true;k.scrollable=true;k.align=b.opt.railvalign=="top"?0:1;b.railh=k;b.railh.drag=false}if(b.ispage)g.css({position:"fixed",top:"0px",height:"100%"}),g.align?g.css({right:"0px"}):g.css({left:"0px"}),b.body.append(g),b.railh&&(k.css({position:"fixed",left:"0px",width:"100%"}),k.align?k.css({bottom:"0px"}):k.css({top:"0px"}),b.body.append(k));else{if(b.ishwscroll)b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),d=b.win[0].nodename=="html"?b.body:b.win,b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":g.width+4}),d.append(b.zoom)),g.css({position:"absolute",top:0}),g.align?g.css({right:0}):g.css({left:0}),d.append(g),k&&(k.css({position:"absolute",left:0,bottom:0}),k.align?k.css({bottom:0}):k.css({top:0}),d.append(k));else{b.isfixed=b.win.css("position")=="fixed";d=b.isfixed?"fixed":"absolute";if(!b.isfixed)b.viewport=b.getviewport(b.win[0]);if(b.viewport)b.body=b.viewport;g.css({position:d});b.zoom&&b.zoom.css({position:d});b.updatescrollbar();b.body.append(g);b.zoom&&b.body.append(b.zoom);b.railh&&(k.css({position:d}),b.body.append(k))}f.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"});f.isie&&b.opt.disableoutline&&b.win.attr("hidefocus","true");f.iswebkit&&b.opt.disableoutline&&b.win.css({outline:"none"})}if(b.opt.autohidemode===false)b.autohidedom=false,b.rail.css({opacity:b.opt.cursoropacitymax}),b.railh&&b.railh.css({opacity:b.opt.cursoropacitymax});else if(b.opt.autohidemode===true){if(b.autohidedom=e().add(b.rail),b.railh)b.autohidedom=b.autohidedom.add(b.railh)}else if(b.opt.autohidemode=="scroll"){if(b.autohidedom=e().add(b.rail),b.railh)b.autohidedom=b.autohidedom.add(b.railh)}else if(b.opt.autohidemode=="cursor"){if(b.autohidedom=e().add(b.cursor),b.railh)b.autohidedom=b.autohidedom.add(b.railh.cursor)}else if(b.opt.autohidemode=="hidden")b.autohidedom=false,b.hide(),b.locked=false;if(f.isie9mobile)b.scrollmom=new z(b),b.onmangotouch=function(){var d=b.getscrolltop(),c=b.getscrollleft();if(d==b.scrollmom.lastscrolly&&c==b.scrollmom.lastscrollx)return true;var g=d-b.mangotouch.sy,l=c-b.mangotouch.sx;if(math.round(math.sqrt(math.pow(l,2)+math.pow(g,2)))!=0){var f=g<0?-1:1,e=l<0?-1:1,h=+new date;b.mangotouch.lazy&&cleartimeout(b.mangotouch.lazy);if(h-b.mangotouch.tm>80||b.mangotouch.dry!=f||b.mangotouch.drx!=e)b.scrollmom.stop(),b.scrollmom.reset(c,d),b.mangotouch.sy=d,b.mangotouch.ly=d,b.mangotouch.sx=c,b.mangotouch.lx=c,b.mangotouch.dry=f,b.mangotouch.drx=e,b.mangotouch.tm=h;else if(b.scrollmom.stop(),b.scrollmom.update(b.mangotouch.sx-l,b.mangotouch.sy-g),b.mangotouch.tm=h,g=math.max(math.abs(b.mangotouch.ly-d),math.abs(b.mangotouch.lx-c)),b.mangotouch.ly=d,b.mangotouch.lx=c,g>2)b.mangotouch.lazy=settimeout(function(){b.mangotouch.lazy=false;b.mangotouch.dry=0;b.mangotouch.drx=0;b.mangotouch.tm=0;b.scrollmom.domomentum(30)},100)}},g=b.getscrolltop(),k=b.getscrollleft(),b.mangotouch={sy:g,ly:g,dry:0,sx:k,lx:k,drx:0,lazy:false,tm:0},b.bind(b.docscroll,"scroll",b.onmangotouch);else{if(f.cantouch||b.istouchcapable||b.opt.touchbehavior||f.hasmstouch){b.scrollmom=new z(b);b.ontouchstart=function(d){if(d.pointertype&&d.pointertype!=2)return false;if(!b.locked){if(f.hasmstouch)for(var c=d.target?d.target:false;c;){var g=e(c).getnicescroll();if(g.length>0&&g[0].me==b.me)break;if(g.length>0)return false;if(c.nodename=="div"&&c.id==b.id)break;c=c.parentnode?c.parentnode:false}b.cancelscroll();if((c=b.gettarget(d))&&/input/i.test(c.nodename)&&/range/i.test(c.type))return b.stoppropagation(d);if(!("clientx"in d)&&"changedtouches"in d)d.clientx=d.changedtouches[0].clientx,d.clienty=d.changedtouches[0].clienty;if(b.forcescreen)g=d,d={original:d.original?d.original:d},d.clientx=g.screenx,d.clienty=g.screeny;b.rail.drag={x:d.clientx,y:d.clienty,sx:b.scroll.x,sy:b.scroll.y,st:b.getscrolltop(),sl:b.getscrollleft(),pt:2};b.opt.touchbehavior&&b.isiframe&&f.isie&&(g=b.win.position(),b.rail.drag.x+=g.left,b.rail.drag.y+=g.top);b.hasmoving=false;b.lastmouseup=false;b.scrollmom.reset(d.clientx,d.clienty);if(!f.cantouch&&!this.istouchcapable&&!f.hasmstouch){if(!c||!/input|select|textarea/i.test(c.nodename))return!b.ispage&&f.hasmousecapture&&c.setcapture(),b.cancelevent(d);if(/submit|cancel|button/i.test(e(c).attr("type")))pc={tg:c,click:false},b.preventclick=pc}}};b.ontouchend=function(d){if(d.pointertype&&d.pointertype!=2)return false;if(b.rail.drag&&b.rail.drag.pt==2&&(b.scrollmom.domomentum(),b.rail.drag=false,b.hasmoving&&(b.hasmoving=false,b.lastmouseup=true,b.hidecursor(),f.hasmousecapture&&document.releasecapture(),!f.cantouch)))return b.cancelevent(d)};var n=b.opt.touchbehavior&&b.isiframe&&!f.hasmousecapture;b.ontouchmove=function(d,c){if(d.pointertype&&d.pointertype!=2)return false;if(b.rail.drag&&b.rail.drag.pt==2){if(f.cantouch&&typeof d.original=="undefined")return true;b.hasmoving=true;if(b.preventclick&&!b.preventclick.click)b.preventclick.click=b.preventclick.tg.onclick||false,b.preventclick.tg.onclick=b.onpreventclick;d=e.extend({original:d},d);if("changedtouches"in d)d.clientx=d.changedtouches[0].clientx,d.clienty=d.changedtouches[0].clienty;if(b.forcescreen){var g=d,d={original:d.original?d.original:d};d.clientx=g.screenx;d.clienty=g.screeny}g=ofy=0;if(n&&!c){var l=b.win.position(),g=-l.left;ofy=-l.top}var h=d.clienty+ofy,i=b.rail.drag.st-(h-b.rail.drag.y);if(b.ishwscroll&&b.opt.bouncescroll)i<0?i=math.round(i/2):i>b.page.maxh&&(i=b.page.maxh+math.round((i-b.page.maxh)/2));else if(i<0&&(h=i=0),i>b.page.maxh)i=b.page.maxh,h=0;var s=d.clientx+g;if(b.railh&&b.railh.scrollable){var j=b.rail.drag.sl-(s-b.rail.drag.x);if(b.ishwscroll&&b.opt.bouncescroll)j<0?j=math.round(j/2):j>b.page.maxw&&(j=b.page.maxw+math.round((j-b.page.maxw)/2));else if(j<0&&(s=j=0),j>b.page.maxw)j=b.page.maxw,s=0}b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==2&&(b.preparetransition&&b.preparetransition(0),b.rail.scrollable&&b.setscrolltop(i),b.scrollmom.update(s,h),b.railh&&b.railh.scrollable?(b.setscrollleft(j),b.showcursor(i,j)):b.showcursor(i),f.isie10&&document.selection.clear())});if(!f.ischrome&&!b.istouchcapable)return b.cancelevent(d)}}}f.cantouch||b.opt.touchbehavior?(b.onpreventclick=function(d){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=false,b.cancelevent(d)},b.onmousedown=b.ontouchstart,b.onmouseup=b.ontouchend,b.onclick=f.isios?false:function(d){return b.lastmouseup?(b.lastmouseup=false,b.cancelevent(d)):true},b.onmousemove=b.ontouchmove,f.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:f.cursorgrabvalue}),b.css(b.rail,{cursor:f.cursorgrabvalue}))):(b.onmousedown=function(d,c){if(!(b.rail.drag&&b.rail.drag.pt!=1)){if(b.locked)return b.cancelevent(d);b.cancelscroll();b.rail.drag={x:d.clientx,y:d.clienty,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:!!c};var g=b.gettarget(d);!b.ispage&&f.hasmousecapture&&g.setcapture();if(b.isiframe&&!f.hasmousecapture)b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"});return b.cancelevent(d)}},b.onmouseup=function(d){if(b.rail.drag&&(f.hasmousecapture&&document.releasecapture(),b.isiframe&&!f.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag.pt==1))return b.rail.drag=false,b.cancelevent(d)},b.onmousemove=function(d){if(b.rail.drag){if(b.rail.drag.pt==1){if(f.ischrome&&d.which==0)return b.onmouseup(d);b.cursorfreezed=true;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(d.clientx-b.rail.drag.x);if(b.scroll.x<0)b.scroll.x=0;var c=b.scrollvaluemaxw;if(b.scroll.x>c)b.scroll.x=c}else{b.scroll.y=b.rail.drag.sy+(d.clienty-b.rail.drag.y);if(b.scroll.y<0)b.scroll.y=0;c=b.scrollvaluemax;if(b.scroll.y>c)b.scroll.y=c}b.synched("mousemove",function(){b.rail.drag&&b.rail.drag.pt==1&&(b.showcursor(),b.rail.drag.hr?b.doscrollleft(math.round(b.scroll.x*b.scrollratio.x)):b.doscrolltop(math.round(b.scroll.y*b.scrollratio.y)))});return b.cancelevent(d)}}else b.checkarea=true});(f.cantouch||b.opt.touchbehavior)&&b.bind(b.win,"mousedown",b.onmousedown);f.hasmstouch&&(b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,{"-ms-touch-action":"none"}),b.bind(b.win,"mspointerdown",b.ontouchstart),b.bind(document,"mspointerup",b.ontouchend),b.bind(document,"mspointermove",b.ontouchmove),b.bind(b.cursor,"msgesturehold",function(b){b.preventdefault()}),b.bind(b.cursor,"contextmenu",function(b){b.preventdefault()}));this.istouchcapable&&(b.bind(b.win,"touchstart",b.ontouchstart),b.bind(document,"touchend",b.ontouchend),b.bind(document,"touchcancel",b.ontouchend),b.bind(document,"touchmove",b.ontouchmove));b.bind(b.cursor,"mousedown",b.onmousedown);b.bind(b.cursor,"mouseup",b.onmouseup);b.railh&&(b.bind(b.cursorh,"mousedown",function(d){b.onmousedown(d,true)}),b.bind(b.cursorh,"mouseup",function(d){if(!(b.rail.drag&&b.rail.drag.pt==2))return b.rail.drag=false,b.hasmoving=false,b.hidecursor(),f.hasmousecapture&&document.releasecapture(),b.cancelevent(d)}));b.bind(document,"mouseup",b.onmouseup);f.hasmousecapture&&b.bind(b.win,"mouseup",b.onmouseup);b.bind(document,"mousemove",b.onmousemove);b.onclick&&b.bind(document,"click",b.onclick);!f.cantouch&&!b.opt.touchbehavior&&(b.jqbind(b.rail,"mouseenter",function(){b.canshowonmouseevent&&b.showcursor();b.rail.active=true}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=false;b.rail.drag||b.hidecursor()}),b.opt.sensitiverail&&(b.bind(b.rail,"click",function(d){b.dorailclick(d,false,false)}),b.bind(b.rail,"dblclick",function(d){b.dorailclick(d,true,false)}),b.bind(b.cursor,"click",function(d){b.cancelevent(d)}),b.bind(b.cursor,"dblclick",function(d){b.cancelevent(d)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){b.canshowonmouseevent&&b.showcursor();b.rail.active=true}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=false;b.rail.drag||b.hidecursor()}),b.opt.sensitiverail&&(b.bind(b.railh,"click",function(d){b.dorailclick(d,false,true)}),b.bind(b.railh,"dblclick",function(d){b.dorailclick(d,true,true)}),b.bind(b.cursorh,"click",function(d){b.cancelevent(d)}),b.bind(b.cursorh,"dblclick",function(d){b.cancelevent(d)}))),b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showcursor();b.rail.active=true}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=false;b.rail.drag||b.hidecursor()})));b.opt.enablemousewheel&&(b.isiframe||b.bind(f.isie&&b.ispage?document:b.docscroll,"mousewheel",b.onmousewheel),b.bind(b.rail,"mousewheel",b.onmousewheel),b.railh&&b.bind(b.railh,"mousewheel",b.onmousewheelhr));!b.ispage&&!f.cantouch&&!/html|body/.test(b.win[0].nodename)&&(b.win.attr("tabindex")||b.win.attr({tabindex:b++}),b.jqbind(b.win,"focus",function(d){r=b.gettarget(d).id||true;b.hasfocus=true;b.canshowonmouseevent&&b.noticecursor()}),b.jqbind(b.win,"blur",function(){r=false;b.hasfocus=false}),b.jqbind(b.win,"mouseenter",function(d){w=b.gettarget(d).id||true;b.hasmousefocus=true;b.canshowonmouseevent&&b.noticecursor()}),b.jqbind(b.win,"mouseleave",function(){w=false;b.hasmousefocus=false}))}b.onkeypress=function(d){if(b.locked&&b.page.maxh==0)return true;var d=d?d:window.e,c=b.gettarget(d);if(c&&/input|textarea|select|option/.test(c.nodename)&&(!c.getattribute("type")&&!c.type||!/submit|button|cancel/i.tp))return true;if(b.hasfocus||b.hasmousefocus&&!r||b.ispage&&!r&&!w){c=d.keycode;if(b.locked&&c!=27)return b.cancelevent(d);var g=d.ctrlkey||false,l=d.shiftkey||false,f=false;switch(c){case 38:case 63233:b.doscrollby(72);f=true;break;case 40:case 63235:b.doscrollby(-72);f=true;break;case 37:case 63232:b.railh&&(g?b.doscrollleft(0):b.doscrollleftby(72),f=true);break;case 39:case 63234:b.railh&&(g?b.doscrollleft(b.page.maxw):b.doscrollleftby(-72),f=true);break;case 33:case 63276:b.doscrollby(b.view.h);f=true;break;case 34:case 63277:b.doscrollby(-b.view.h);f=true;break;case 36:case 63273:b.railh&&g?b.doscrollpos(0,0):b.doscrollto(0);f=true;break;case 35:case 63275:b.railh&&g?b.doscrollpos(b.page.maxw,b.page.maxh):b.doscrollto(b.page.maxh);f=true;break;case 32:b.opt.spacebarenabled&&(l?b.doscrollby(b.view.h):b.doscrollby(-b.view.h),f=true);break;case 27:b.zoomactive&&(b.dozoom(),f=true)}if(f)return b.cancelevent(d)}};b.opt.enablekeyboard&&b.bind(document,f.isopera&&!f.isopera12?"keypress":"keydown",b.onkeypress);b.bind(window,"resize",b.resize);b.bind(window,"orientationchange",b.resize);b.bind(window,"load",b.resize);if(f.ischrome&&!b.ispage&&!b.haswrapper){var m=b.win.attr("style"),g=parsefloat(b.win.css("width"))+1;b.win.css("width",g);b.synched("chromefix",function(){b.win.attr("style",m)})}b.onattributechange=function(){b.lazyresize()};if(!b.ispage&&!b.haswrapper)"webkitmutationobserver"in window?(b.observer=new webkitmutationobserver(function(d){d.foreach(b.onattributechange)}),b.observer.observe(b.win[0],{attributes:true,subtree:false})):(b.bind(b.win,f.isie&&!f.isie9?"propertychange":"domattrmodified",b.onattributechange),f.isie9&&b.win[0].attachevent("onpropertychange",b.onattributechange));!b.ispage&&b.opt.boxzoom&&b.bind(window,"resize",b.resizezoom);b.istextarea&&b.bind(b.win,"mouseup",b.resize);b.resize()}if(this.doc[0].nodename=="iframe"){var a=function(){b.iframexd=false;try{var d="contentdocument"in this?this.contentdocument:this.contentwindow.document}catch(c){b.iframexd=true,d=false}if(b.iframexd)return"console"in window&&console.log("nicescroll error: policy restriced iframe"),true;b.forcescreen=true;if(b.isiframe)b.iframe={doc:e(d),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getcontentsize=function(){return{w:math.max(b.iframe.html.scrollwidth,b.iframe.body.scrollwidth),h:math.max(b.iframe.html.scrollheight,b.iframe.body.scrollheight)}},b.docscroll=e(b.iframe.body);if(!f.isios&&b.opt.iframeautoresize&&!b.isiframe){b.win.scrolltop(0);b.doc.height("");var g=math.max(d.getelementsbytagname("html")[0].scrollheight,d.body.scrollheight);b.doc.height(g)}b.resize();f.isie7&&b.css(e(b.iframe.html),{"overflow-y":"hidden"});b.css(e(b.iframe.body),{"overflow-y":"hidden"});"contentwindow"in this?b.bind(this.contentwindow,"scroll",b.onscroll):b.bind(d,"scroll",b.onscroll);b.opt.enablemousewheel&&b.bind(d,"mousewheel",b.onmousewheel);b.opt.enablekeyboard&&b.bind(d,f.isopera?"keypress":"keydown",b.onkeypress);if(f.cantouch||b.opt.touchbehavior)b.bind(d,"mousedown",b.onmousedown),b.bind(d,"mousemove",function(d){b.onmousemove(d,true)}),f.cursorgrabvalue&&b.css(e(d.body),{cursor:f.cursorgrabvalue});b.bind(d,"mouseup",b.onmouseup);b.zoom&&(b.opt.dblclickzoom&&b.bind(d,"dblclick",b.dozoom),b.ongesturezoom&&b.bind(d,"gestureend",b.ongesturezoom))};this.doc[0].readystate&&this.doc[0].readystate=="complete"&&settimeout(function(){a.call(b.doc[0],false)},500);b.bind(this.doc,"load",a)}};this.showcursor=function(d,c){if(b.cursortimeout)cleartimeout(b.cursortimeout),b.cursortimeout=0;if(b.rail){if(b.autohidedom)b.autohidedom.stop().css({opacity:b.opt.cursoropacitymax}),b.cursoractive=true;if(typeof d!="undefined"&&d!==false)b.scroll.y=math.round(d*1/b.scrollratio.y);if(typeof c!="undefined")b.scroll.x=math.round(c*1/b.scrollratio.x);b.cursor.css({height:b.cursorheight,top:b.scroll.y});if(b.cursorh)!b.rail.align&&b.rail.visibility?b.cursorh.css({width:b.cursorwidth,left:b.scroll.x+b.rail.width}):b.cursorh.css({width:b.cursorwidth,left:b.scroll.x}),b.cursoractive=true;b.zoom&&b.zoom.stop().css({opacity:b.opt.cursoropacitymax})}};this.hidecursor=function(d){if(!b.cursortimeout&&b.rail&&b.autohidedom)b.cursortimeout=settimeout(function(){if(!b.rail.active||!b.showonmouseevent)b.autohidedom.stop().animate({opacity:b.opt.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:b.opt.cursoropacitymin}),b.cursoractive=false;b.cursortimeout=0},d||400)};this.noticecursor=function(d,c,g){b.showcursor(c,g);b.rail.active||b.hidecursor(d)};this.getcontentsize=b.ispage?function(){return{w:math.max(document.body.scrollwidth,document.documentelement.scrollwidth),h:math.max(document.body.scrollheight,document.documentelement.scrollheight)}}:b.haswrapper?function(){return{w:b.doc.outerwidth()+parseint(b.win.css("paddingleft"))+parseint(b.win.css("paddingright")),h:b.doc.outerheight()+parseint(b.win.css("paddingtop"))+parseint(b.win.css("paddingbottom"))}}:function(){return{w:b.docscroll[0].scrollwidth,h:b.docscroll[0].scrollheight}};this.onresize=function(d,c){if(!b.win)return false;if(!b.haswrapper&&!b.ispage)if(b.win.css("display")=="none")return b.visibility&&b.hiderail().hiderailhr(),false;else!b.hidden&&!b.visibility&&b.showrail().showrailhr();var g=b.page.maxh,f=b.page.maxw,e=b.view.w;b.view={w:b.ispage?b.win.width():parseint(b.win[0].clientwidth),h:b.ispage?b.win.height():parseint(b.win[0].clientheight)};b.page=c?c:b.getcontentsize();b.page.maxh=math.max(0,b.page.h-b.view.h);b.page.maxw=math.max(0,b.page.w-b.view.w);if(b.page.maxh==g&&b.page.maxw==f&&b.view.w==e)if(b.ispage)return b;else{g=b.win.offset();if(b.lastposition&&(f=b.lastposition,f.top==g.top&&f.left==g.left))return b;b.lastposition=g}b.page.maxh==0?(b.hiderail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setscrolltop(0),b.rail.scrollable=false):b.rail.scrollable=true;b.page.maxw==0?(b.hiderailhr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setscrollleft(0),b.railh.scrollable=false):b.railh.scrollable=true;b.locked=b.page.maxh==0&&b.page.maxw==0;if(b.locked)return b.ispage||b.updatescrollbar(b.view),false;!b.hidden&&!b.visibility?b.showrail().showrailhr():!b.hidden&&!b.railh.visibility&&b.showrailhr();b.istextarea&&b.win.css("resize")&&b.win.css("resize")!="none"&&(b.view.h-=20);b.ispage||b.updatescrollbar(b.view);b.cursorheight=math.min(b.view.h,math.round(b.view.h*(b.view.h/b.page.h)));b.cursorheight=b.opt.cursorfixedheight?b.opt.cursorfixedheight:math.max(b.opt.cursorminheight,b.cursorheight);b.cursorwidth=math.min(b.view.w,math.round(b.view.w*(b.view.w/b.page.w)));b.cursorwidth=b.opt.cursorfixedheight?b.opt.cursorfixedheight:math.max(b.opt.cursorminheight,b.cursorwidth);b.scrollvaluemax=b.view.h-b.cursorheight-b.cursor.hborder;if(b.railh)b.railh.width=b.page.maxh>0?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-b.cursorh.wborder;b.scrollratio={x:b.page.maxw/b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};b.getscrolltop()>b.page.maxh?b.doscrolltop(b.page.maxh):(b.scroll.y=math.round(b.getscrolltop()*(1/b.scrollratio.y)),b.scroll.x=math.round(b.getscrollleft()*(1/b.scrollratio.x)),b.cursoractive&&b.noticecursor());b.scroll.y&&b.getscrolltop()==0&&b.doscrollto(math.floor(b.scroll.y*b.scrollratio.y));return b};this.resize=function(){b.delayed("resize",b.onresize,30);return b};this.lazyresize=function(){b.delayed("resize",b.resize,250)};this._bind=function(d,c,g,f){b.events.push({e:d,n:c,f:g,b:f,q:false});d.addeventlistener?d.addeventlistener(c,g,f||false):d.attachevent?d.attachevent("on"+c,g):d["on"+c]=g};this.jqbind=function(d,c,g){b.events.push({e:d,n:c,f:g,q:true});e(d).bind(c,g)};this.bind=function(d,c,g,e){var h="jquery"in d?d[0]:d;h.addeventlistener?(f.cantouch&&/mouseup|mousedown|mousemove/.test(c)&&b._bind(h,c=="mousedown"?"touchstart":c=="mouseup"?"touchend":"touchmove",function(b){if(b.touches){if(b.touches.length<2){var d=b.touches.length?b.touches[0]:b;d.original=b;g.call(this,d)}}else if(b.changedtouches)d=b.changedtouches[0],d.original=b,g.call(this,d)},e||false),b._bind(h,c,g,e||false),c=="mousewheel"&&b._bind(h,"dommousescroll",g,e||false),f.cantouch&&c=="mouseup"&&b._bind(h,"touchcancel",g,e||false)):b._bind(h,c,function(d){if((d=d||window.event||false)&&d.srcelement)d.target=d.srcelement;return g.call(h,d)===false||e===false?b.cancelevent(d):true})};this._unbind=function(b,c,g,f){b.removeeventlistener?b.removeeventlistener(c,g,f):b.detachevent?b.detachevent("on"+c,g):b["on"+c]=false};this.unbindall=function(){for(var d=0;d0)return c;b=b.parentnode?b.parentnode:false}return false};this.onmousewheel=function(d){if(b.locked)return true;if(!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(d):true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isscrollable(d);if(b.nativescrollingarea)return true;if(b.locked)return b.cancelevent(d);if(b.rail.drag)return b.cancelevent(d);i(d,false);return b.cancelevent(d)};this.onmousewheelhr=function(d){if(b.locked||!b.railh.scrollable)return true;if(b.opt.preservenativescrolling&&b.checkarea)b.checkarea=false,b.nativescrollingarea=b.isscrollable(d);if(b.nativescrollingarea)return true;if(b.locked)return b.cancelevent(d);if(b.rail.drag)return b.cancelevent(d);i(d,true);return b.cancelevent(d)};this.stop=function(){b.cancelscroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=false;b.scroll.y=math.round(b.getscrolltop()*(1/b.scrollratio.y));b.noticecursor();return b};this.gettransitionspeed=function(d){var c=math.round(b.opt.scrollspeed*10),d=math.min(c,math.round(d/20*b.opt.scrollspeed));return d>20?d:0};b.opt.smoothscroll?b.ishwscroll&&f.hastransition&&b.opt.usetransition?(this.preparetransition=function(d,c){var g=c?d>20?d:0:b.gettransitionspeed(d),e=g?f.prefixstyle+"transform "+g+"ms ease-out":"";if(!b.lasttransitionstyle||b.lasttransitionstyle!=e)b.lasttransitionstyle=e,b.doc.css(f.transitionstyle,e);return g},this.doscrollleft=function(d,c){var g=b.scrollrunning?b.newscrolly:b.getscrolltop();b.doscrollpos(d,g,c)},this.doscrolltop=function(c,f){var g=b.scrollrunning?b.newscrollx:b.getscrollleft();b.doscrollpos(g,c,f)},this.doscrollpos=function(c,e,g){var h=b.getscrolltop(),i=b.getscrollleft();((b.newscrolly-h)*(e-h)<0||(b.newscrollx-i)*(c-i)<0)&&b.cancelscroll();if(b.opt.bouncescroll==false){if(e<0)e=0;else if(e>b.page.maxh)e=b.page.maxh;if(c<0)c=0;else if(c>b.page.maxw)c=b.page.maxw}if(c==b.newscrollx&&e==b.newscrolly)return false;b.newscrolly=e;b.newscrollx=c;b.newscrollspeed=g||false;if(b.timer)return false;b.timer=settimeout(function(){var g=b.getscrolltop(),h=b.getscrollleft(),i,j;i=c-h;j=e-g;i=math.round(math.sqrt(math.pow(i,2)+math.pow(j,2)));i=b.preparetransition(b.newscrollspeed?b.newscrollspeed:i);b.timerscroll&&b.timerscroll.tm&&clearinterval(b.timerscroll.tm);if(i>0){!b.scrollrunning&&b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:h,y:g},request:{x:c,y:e},end:{x:b.newscrollx,y:b.newscrolly},speed:i});if(f.transitionend){if(!b.scrollendtrapped)b.scrollendtrapped=true,b.bind(b.doc,f.transitionend,b.onscrollend,false)}else b.scrollendtrapped&&cleartimeout(b.scrollendtrapped),b.scrollendtrapped=settimeout(b.onscrollend,i);b.timerscroll={bz:new bezierclass(g,b.newscrolly,i,0,0,0.58,1),bh:new bezierclass(h,b.newscrollx,i,0,0,0.58,1)};if(!b.cursorfreezed)b.timerscroll.tm=setinterval(function(){b.showcursor(b.getscrolltop(),b.getscrollleft())},60)}b.synched("doscroll-set",function(){b.timer=0;if(b.scrollendtrapped)b.scrollrunning=true;b.setscrolltop(b.newscrolly);b.setscrollleft(b.newscrollx);if(!b.scrollendtrapped)b.onscrollend()})},50)},this.cancelscroll=function(){if(!b.scrollendtrapped)return true;var c=b.getscrolltop(),e=b.getscrollleft();b.scrollrunning=false;f.transitionend||cleartimeout(f.transitionend);b.scrollendtrapped=false;b._unbind(b.doc,f.transitionend,b.onscrollend);b.preparetransition(0);b.setscrolltop(c);b.railh&&b.setscrollleft(e);b.timerscroll&&b.timerscroll.tm&&clearinterval(b.timerscroll.tm);b.timerscroll=false;b.cursorfreezed=false;b.showcursor(c,e);return b},this.onscrollend=function(){b.scrollendtrapped&&b._unbind(b.doc,f.transitionend,b.onscrollend);b.scrollendtrapped=false;b.preparetransition(0);b.timerscroll&&b.timerscroll.tm&&clearinterval(b.timerscroll.tm);b.timerscroll=false;var c=b.getscrolltop(),e=b.getscrollleft();b.setscrolltop(c);b.railh&&b.setscrollleft(e);b.noticecursor(false,c,e);b.cursorfreezed=false;if(c<0)c=0;else if(c>b.page.maxh)c=b.page.maxh;if(e<0)e=0;else if(e>b.page.maxw)e=b.page.maxw;if(c!=b.newscrolly||e!=b.newscrollx)return b.doscrollpos(e,c,b.opt.snapbackspeed);b.onscrollend&&b.scrollrunning&&b.onscrollend.call(b,{type:"scrollend",current:{x:e,y:c},end:{x:b.newscrollx,y:b.newscrolly}});b.scrollrunning=false}):(this.doscrollleft=function(c){var f=b.scrollrunning?b.newscrolly:b.getscrolltop();b.doscrollpos(c,f)},this.doscrolltop=function(c){var f=b.scrollrunning?b.newscrollx:b.getscrollleft();b.doscrollpos(f,c)},this.doscrollpos=function(c,f){function g(){if(b.cancelanimationframe)return true;b.scrollrunning=true;if(n=1-n)return b.timer=p(g)||1;var c=0,d=sy=b.getscrolltop();if(b.dst.ay){var d=b.bzscroll?b.dst.py+b.bzscroll.getnow()*b.dst.ay:b.newscrolly,f=d-sy;if(f<0&&d0&&d>b.newscrolly)d=b.newscrolly;b.setscrolltop(d);d==b.newscrolly&&(c=1)}else c=1;var e=sx=b.getscrollleft();if(b.dst.ax){e=b.bzscroll?b.dst.px+b.bzscroll.getnow()*b.dst.ax:b.newscrollx;f=e-sx;if(f<0&&e0&&e>b.newscrollx)e=b.newscrollx;b.setscrollleft(e);e==b.newscrollx&&(c+=1)}else c+=1;if(c==2){b.timer=0;b.cursorfreezed=false;b.bzscroll=false;b.scrollrunning=false;if(d<0)d=0;else if(d>b.page.maxh)d=b.page.maxh;if(e<0)e=0;else if(e>b.page.maxw)e=b.page.maxw;e!=b.newscrollx||d!=b.newscrolly?b.doscrollpos(e,d):b.onscrollend&&b.onscrollend.call(b,{type:"scrollend",current:{x:sx,y:sy},end:{x:b.newscrollx,y:b.newscrolly}})}else b.timer=p(g)||1}f=typeof f=="undefined"||f===false?b.getscrolltop(true):f;if(b.timer&&b.newscrolly==f&&b.newscrollx==c)return true;b.timer&&q(b.timer);b.timer=0;var e=b.getscrolltop(),h=b.getscrollleft();((b.newscrolly-e)*(f-e)<0||(b.newscrollx-h)*(c-h)<0)&&b.cancelscroll();b.newscrolly=f;b.newscrollx=c;if(!b.bouncescroll||!b.rail.visibility)if(b.newscrolly<0)b.newscrolly=0;else if(b.newscrolly>b.page.maxh)b.newscrolly=b.page.maxh;if(!b.bouncescroll||!b.railh.visibility)if(b.newscrollx<0)b.newscrollx=0;else if(b.newscrollx>b.page.maxw)b.newscrollx=b.page.maxw;b.dst={};b.dst.x=c-h;b.dst.y=f-e;b.dst.px=h;b.dst.py=e;var i=math.round(math.sqrt(math.pow(b.dst.x,2)+math.pow(b.dst.y,2)));b.dst.ax=b.dst.x/i;b.dst.ay=b.dst.y/i;var j=0,k=i;if(b.dst.x==0)j=e,k=f,b.dst.ay=1,b.dst.py=0;else if(b.dst.y==0)j=h,k=c,b.dst.ax=1,b.dst.px=0;i=b.gettransitionspeed(i);b.bzscroll=i>0?b.bzscroll?b.bzscroll.update(k,i):new bezierclass(j,k,i,0,1,0,1):false;if(!b.timer){(e==b.page.maxh&&f>=b.page.maxh||h==b.page.maxw&&c>=b.page.maxw)&&b.checkcontentsize();var n=1;b.cancelanimationframe=false;b.timer=1;b.onscrollstart&&!b.scrollrunning&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:h,y:e},request:{x:c,y:f},end:{x:b.newscrollx,y:b.newscrolly},speed:i});g();(e==b.page.maxh&&f>=e||h==b.page.maxw&&c>=h)&&b.checkcontentsize();b.noticecursor()}},this.cancelscroll=function(){b.timer&&q(b.timer);b.timer=0;b.bzscroll=false;b.scrollrunning=false;return b}):(this.doscrollleft=function(c,f){var g=b.getscrolltop();b.doscrollpos(c,g,f)},this.doscrolltop=function(c,f){var g=b.getscrollleft();b.doscrollpos(g,c,f)},this.doscrollpos=function(c,f){var g=c>b.page.maxw?b.page.maxw:c;g<0&&(g=0);var e=f>b.page.maxh?b.page.maxh:f;e<0&&(e=0);b.synched("scroll",function(){b.setscrolltop(e);b.setscrollleft(g)})},this.cancelscroll=function(){});this.doscrollby=function(c,f){var g=0,g=f?math.floor((b.scroll.y-c)*b.scrollratio.y):(b.timer?b.newscrolly:b.getscrolltop(true))-c;if(b.bouncescroll){var e=math.round(b.view.h/2);g<-e?g=-e:g>b.page.maxh+e&&(g=b.page.maxh+e)}b.cursorfreezed=false;py=b.getscrolltop(true);if(g<0&&py<=0)return b.noticecursor();else if(g>b.page.maxh&&py>=b.page.maxh)return b.checkcontentsize(),b.noticecursor();b.doscrolltop(g)};this.doscrollleftby=function(c,f){var e=0,e=f?math.floor((b.scroll.x-c)*b.scrollratio.x):(b.timer?b.newscrollx:b.getscrollleft(true))-c;if(b.bouncescroll){var h=math.round(b.view.w/2);e<-h?e=-h:e>b.page.maxw+h&&(e=b.page.maxw+h)}b.cursorfreezed=false;px=b.getscrollleft(true);if(e<0&&px<=0)return b.noticecursor();else if(e>b.page.maxw&&px>=b.page.maxw)return b.noticecursor();b.doscrollleft(e)};this.doscrollto=function(c,e){e&&math.round(c*b.scrollratio.y);b.cursorfreezed=false;b.doscrolltop(c)};this.checkcontentsize=function(){var c=b.getcontentsize();(c.h!=b.page.h||c.w!=b.page.w)&&b.resize(false,c)};b.onscroll=function(){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=math.round(b.getscrolltop()*(1/b.scrollratio.y));if(b.railh)b.scroll.x=math.round(b.getscrollleft()*(1/b.scrollratio.x));b.noticecursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.dozoomin=function(c){if(!b.zoomactive){b.zoomactive=true;b.zoomrestore={style:{}};var h="position,top,left,zindex,backgroundcolor,margintop,marginbottom,marginleft,marginright".split(","),g=b.win[0].style,i;for(i in h){var j=h[i];b.zoomrestore.style[j]=typeof g[j]!="undefined"?g[j]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");b.zoomrestore.padding={w:b.win.outerwidth()-b.win.width(),h:b.win.outerheight()-b.win.height()};if(f.isios4)b.zoomrestore.scrolltop=e(window).scrolltop(),e(window).scrolltop(0);b.win.css({position:f.isios4?"absolute":"fixed",top:0,left:0,"z-index":b.opt.zindex+100,margin:"0px"});h=b.win.css("backgroundcolor");(h==""||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(h))&&b.win.css("backgroundcolor","#fff");b.rail.css({"z-index":b.opt.zindex+110});b.zoom.css({"z-index":b.opt.zindex+112});b.zoom.css("backgroundposition","0px -18px");b.resizezoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelevent(c)}};this.dozoomout=function(c){if(b.zoomactive)return b.zoomactive=false,b.win.css("margin",""),b.win.css(b.zoomrestore.style),f.isios4&&e(window).scrolltop(b.zoomrestore.scrolltop),b.rail.css({"z-index":b.ispage?b.opt.zindex:b.opt.zindex+2}),b.zoom.css({"z-index":b.opt.zindex}),b.zoomrestore=false,b.zoom.css("backgroundposition","0px 0px"),b.onresize(),b.onzoomout&&b.onzoomout.call(b),b.cancelevent(c)};this.dozoom=function(c){return b.zoomactive?b.dozoomout(c):b.dozoomin(c)};this.resizezoom=function(){if(b.zoomactive){var c=b.getscrolltop();b.win.css({width:e(window).width()-b.zoomrestore.padding.w+"px",height:e(window).height()-b.zoomrestore.padding.h+"px"});b.onresize();console.log(c);b.setscrolltop(math.min(b.page.maxh,c))}};this.init();e.nicescroll.push(this)},z=function(e){var c=this;this.nc=e;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=false;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,i){c.stop();var b=c.time();c.steptime=0;c.lasttime=b;c.speedx=0;c.speedy=0;c.lastx=e;c.lasty=i;c.lastscrollx=-1;c.lastscrolly=-1};this.update=function(e,i){var b=c.time();c.steptime=b-c.lasttime;c.lasttime=b;var b=i-c.lasty,j=e-c.lastx,f=c.nc.getscrolltop(),m=c.nc.getscrollleft();f+=b;m+=j;c.snapx=m<0||m>c.nc.page.maxw;c.snapy=f<0||f>c.nc.page.maxh;c.speedx=j;c.speedy=b;c.lastx=e;c.lasty=i};this.stop=function(){c.nc.unsynched("domomentum2d");c.timer&&cleartimeout(c.timer);c.timer=0;c.lastscrollx=-1;c.lastscrolly=-1};this.dosnapy=function(e,i){var b=false;if(i<0)i=0,b=true;else if(i>c.nc.page.maxh)i=c.nc.page.maxh,b=true;if(e<0)e=0,b=true;else if(e>c.nc.page.maxw)e=c.nc.page.maxw,b=true;b&&c.nc.doscrollpos(e,i,c.nc.opt.snapbackspeed)};this.domomentum=function(e){var i=c.time(),b=e?i+e:c.lasttime,e=c.nc.getscrollleft(),j=c.nc.getscrolltop(),f=c.nc.page.maxh,m=c.nc.page.maxw;c.speedx=m>0?math.min(60,c.speedx):0;c.speedy=f>0?math.min(60,c.speedy):0;b=b&&i-b<=50;if(j<0||j>f||e<0||e>m)b=false;e=c.speedx&&b?c.speedx:false;if(c.speedy&&b&&c.speedy||e){var o=math.max(16,c.steptime);o>50&&(e=o/50,c.speedx*=e,c.speedy*=e,o=50);c.demulxy=0;c.lastscrollx=c.nc.getscrollleft();c.chkx=c.lastscrollx;c.lastscrolly=c.nc.getscrolltop();c.chky=c.lastscrolly;var d=c.lastscrollx,l=c.lastscrolly,g=function(){var b=c.time()-i>600?0.04:0.02;if(c.speedx&&(d=math.floor(c.lastscrollx-c.speedx*(1-c.demulxy)),c.lastscrollx=d,d<0||d>m))b=0.1;if(c.speedy&&(l=math.floor(c.lastscrolly-c.speedy*(1-c.demulxy)),c.lastscrolly=l,l<0||l>f))b=0.1;c.demulxy=math.min(1,c.demulxy+b);c.nc.synched("domomentum2d",function(){if(c.speedx)c.nc.getscrollleft()!=c.chkx&&c.stop(),c.chkx=d,c.nc.setscrollleft(d);if(c.speedy)c.nc.getscrolltop()!=c.chky&&c.stop(),c.chky=l,c.nc.setscrolltop(l);c.timer||(c.nc.hidecursor(),c.dosnapy(d,l))});c.demulxy<1?c.timer=settimeout(g,o):(c.stop(),c.nc.hidecursor(),c.dosnapy(d,l))};g()}else c.dosnapy(c.nc.getscrollleft(),c.nc.getscrolltop())}},t=e.fn.scrolltop;e.csshooks.pageyoffset={get:function(j){var c=e.data(j,"__nicescroll")||false;return c&&c.ishwscroll?c.getscrolltop():t.call(j)},set:function(j,c){var h=e.data(j,"__nicescroll")||false;h&&h.ishwscroll?h.setscrolltop(parseint(c)):t.call(j,c);return this}};e.fn.scrolltop=function(j){if(typeof j=="undefined"){var c=this[0]?e.data(this[0],"__nicescroll")||false:false;return c&&c.ishwscroll?c.getscrolltop():t.call(this)}else return this.each(function(){var c=e.data(this,"__nicescroll")||false;c&&c.ishwscroll?c.setscrolltop(parseint(j)):t.call(e(this),j)})};var u=e.fn.scrollleft;e.csshooks.pagexoffset={get:function(j){var c=e.data(j,"__nicescroll")||false;return c&&c.ishwscroll?c.getscrollleft():u.call(j)},set:function(j,c){var h=e.data(j,"__nicescroll")||false;h&&h.ishwscroll?h.setscrollleft(parseint(c)):u.call(j,c);return this}};e.fn.scrollleft=function(j){if(typeof j=="undefined"){var c=this[0]?e.data(this[0],"__nicescroll")||false:false;return c&&c.ishwscroll?c.getscrollleft():u.call(this)}else return this.each(function(){var c=e.data(this,"__nicescroll")||false;c&&c.ishwscroll?c.setscrollleft(parseint(j)):u.call(e(this),j)})};var v=function(j){var c=this;this.length=0;this.name="nicescrollarray";this.each=function(e){for(var b=0;b'+$options.collapsertitle+'
',$menu_collapser;$menu.before($collapser);$menu_collapser=$menu.prev('.menu-collapser');$menu.on('click','.sub-collapser',function(e){e.preventdefault();e.stoppropagation();var $parent_li=$(this).closest('li');if($(this).hasclass('expanded')){$(this).removeclass('expanded');$(this).find('i').html('▼');$parent_li.find('>ul').slideup($options.animspeed,$options.easingeffect)}else{$(this).addclass('expanded');$(this).find('i').html('▲');$parent_li.find('>ul').slidedown($options.animspeed,$options.easingeffect)}});$menu_collapser.on('click','.collapse-button',function(e){e.preventdefault();$menu.slidetoggle($options.animspeed,$options.easingeffect)});this.resizemenu({data:{el:this.element,options:this.options}});$(window).on('resize',{el:this.element,options:this.options},this.resizemenu)},resizemenu:function(event){var $window=$(window),$options=event.data.options,$menu=$(event.data.el),$menu_collapser=$('body').find('.menu-collapser');$menu.find('li').each(function(){if($(this).has('ul').length){if($(this).has('.sub-collapser').length){$(this).children('.sub-collapser i').html('▼')}else{$(this).append('')}}$(this).children('ul').hide();$(this).find('.sub-collapser').removeclass('expanded').children('i').html('▼')});if($options.resizewidth>=$window.width()){if($options.indentchildren){$menu.find('ul').each(function(){var $depth=$(this).parents('ul').length;if(!$(this).children('li').children('a').has('i').length){$(this).children('li').children('a').prepend(plugin.prototype.indent($depth,$options))}})}$menu.find('li').has('ul').off('mouseenter mouseleave');$menu.addclass('collapsed').hide();$menu_collapser.show()}else{$menu.find('li').has('ul').on('mouseenter',function(){$(this).find('>ul').stop().slidedown($options.animspeed,$options.easingeffect)}).on('mouseleave',function(){$(this).find('>ul').stop().slideup($options.animspeed,$options.easingeffect)});$menu.find('li > a > i').remove();$menu.removeclass('collapsed').show();$menu_collapser.hide()}},indent:function(num,options){var $indent='';for(var i=0;i'+$indent+''}};$.fn[pluginname]=function(options){return this.each(function(){if(!$.data(this,"plugin_"+pluginname)){$.data(this,"plugin_"+pluginname,new plugin(this,options))}})}})(jquery,window,document);