Path: blob/master/web-gui/buildyourownbotnet/assets/js/joinable.js
1292 views
;(function($, window, undefined){12/* Hover Intent Plugin */3(function($) {4$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {56// default configuration values7var cfg = {8interval: 100,9sensitivity: 7,10timeout: 011};1213if ( typeof handlerIn === "object" ) {14cfg = $.extend(cfg, handlerIn );15} else if ($.isFunction(handlerOut)) {16cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );17} else {18cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );19}2021// instantiate variables22// cX, cY = current X and Y position of mouse, updated by mousemove event23// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval24var cX, cY, pX, pY;2526// A private function for getting mouse position27var track = function(ev) {28cX = ev.pageX;29cY = ev.pageY;30};3132// A private function for comparing current and previous mouse position33var compare = function(ev,ob) {34ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);35// compare mouse positions to see if they've crossed the threshold36if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {37$(ob).off("mousemove.hoverIntent",track);38// set hoverIntent state to true (so mouseOut can be called)39ob.hoverIntent_s = 1;40return cfg.over.apply(ob,[ev]);41} else {42// set previous coordinates for next time43pX = cX; pY = cY;44// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)45ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );46}47};4849// A private function for delaying the mouseOut function50var delay = function(ev,ob) {51ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);52ob.hoverIntent_s = 0;53return cfg.out.apply(ob,[ev]);54};5556// A private function for handling mouse 'hovering'57var handleHover = function(e) {58// copy objects to be passed into t (required for event object to be passed in IE)59var ev = jQuery.extend({},e);60var ob = this;6162// cancel hoverIntent timer if it exists63if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }6465// if e.type == "mouseenter"66if (e.type == "mouseenter") {67// set "previous" X and Y position based on initial entry point68pX = ev.pageX; pY = ev.pageY;69// update "current" X and Y position based on mousemove70$(ob).on("mousemove.hoverIntent",track);71// start polling interval (self-calling timeout) to compare mouse coordinates over time72if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}7374// else e.type == "mouseleave"75} else {76// unbind expensive mousemove event77$(ob).off("mousemove.hoverIntent",track);78// if hoverIntent state is true, then call the mouseOut function after the specified delay79if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}80}81};8283// listen for mouseenter and mouseleave84return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);85};86})(jQuery);87888990/* Images Loaded Plugin */91(function(c,q){var m="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";c.fn.imagesLoaded=function(f){function n(){var b=c(j),a=c(h);d&&(h.length?d.reject(e,b,a):d.resolve(e));c.isFunction(f)&&f.call(g,e,b,a)}function p(b){k(b.target,"error"===b.type)}function k(b,a){b.src===m||-1!==c.inArray(b,l)||(l.push(b),a?h.push(b):j.push(b),c.data(b,"imagesLoaded",{isBroken:a,src:b.src}),r&&d.notifyWith(c(b),[a,e,c(j),c(h)]),e.length===l.length&&(setTimeout(n),e.unbind(".imagesLoaded",92p)))}var g=this,d=c.isFunction(c.Deferred)?c.Deferred():0,r=c.isFunction(d.notify),e=g.find("img").add(g.filter("img")),l=[],j=[],h=[];c.isPlainObject(f)&&c.each(f,function(b,a){if("callback"===b)f=a;else if(d)d[b](a)});e.length?e.bind("load.imagesLoaded error.imagesLoaded",p).each(function(b,a){var d=a.src,e=c.data(a,"imagesLoaded");if(e&&e.src===d)k(a,e.isBroken);else if(a.complete&&a.naturalWidth!==q)k(a,0===a.naturalWidth||0===a.naturalHeight);else if(a.readyState||a.complete)a.src=m,a.src=d}):93n();return d?d.promise(g):g}})(jQuery);949596979899/*!100* jQuery blockUI plugin101* Version 2.66.0-2013.10.09102* Requires jQuery v1.7 or later103*104* Examples at: http://malsup.com/jquery/block/105* Copyright (c) 2007-2013 M. Alsup106* Dual licensed under the MIT and GPL licenses:107* http://www.opensource.org/licenses/mit-license.php108* http://www.gnu.org/licenses/gpl.html109*110* Thanks to Amir-Hossein Sobhi for some excellent contributions!111*/112113;(function() {114/*jshint eqeqeq:false curly:false latedef:false */115"use strict";116117function setup($) {118$.fn._fadeIn = $.fn.fadeIn;119120var noOp = $.noop || function() {};121122// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle123// confusing userAgent strings on Vista)124var msie = /MSIE/.test(navigator.userAgent);125var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);126var mode = document.documentMode || 0;127var setExpr = $.isFunction( document.createElement('div').style.setExpression );128129// global $ methods for blocking/unblocking the entire page130$.blockUI = function(opts) { install(window, opts); };131$.unblockUI = function(opts) { remove(window, opts); };132133// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl)134$.growlUI = function(title, message, timeout, onClose) {135var $m = $('<div class="growlUI"></div>');136if (title) $m.append('<h1>'+title+'</h1>');137if (message) $m.append('<h2>'+message+'</h2>');138if (timeout === undefined) timeout = 3000;139140// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications141var callBlock = function(opts) {142opts = opts || {};143144$.blockUI({145message: $m,146fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700,147fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,148timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,149centerY: false,150showOverlay: false,151onUnblock: onClose,152css: $.blockUI.defaults.growlCSS153});154};155156callBlock();157var nonmousedOpacity = $m.css('opacity');158$m.mouseover(function() {159callBlock({160fadeIn: 0,161timeout: 30000162});163164var displayBlock = $('.blockMsg');165displayBlock.stop(); // cancel fadeout if it has started166displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency167}).mouseout(function() {168$('.blockMsg').fadeOut(1000);169});170// End konapun additions171};172173// plugin method for blocking element content174$.fn.block = function(opts) {175if ( this[0] === window ) {176$.blockUI( opts );177return this;178}179var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});180this.each(function() {181var $el = $(this);182if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))183return;184$el.unblock({ fadeOut: 0 });185});186187return this.each(function() {188if ($.css(this,'position') == 'static') {189this.style.position = 'relative';190$(this).data('blockUI.static', true);191}192this.style.zoom = 1; // force 'hasLayout' in ie193install(this, opts);194});195};196197// plugin method for unblocking element content198$.fn.unblock = function(opts) {199if ( this[0] === window ) {200$.unblockUI( opts );201return this;202}203return this.each(function() {204remove(this, opts);205});206};207208$.blockUI.version = 2.66; // 2nd generation blocking at no extra cost!209210// override these in your code to change the default behavior and style211$.blockUI.defaults = {212// message displayed when blocking (use null for no message)213message: '<h1>Please wait...</h1>',214215title: null, // title string; only used when theme == true216draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded)217218theme: false, // set to true to use with jQuery UI themes219220// styles for the message when blocking; if you wish to disable221// these and use an external stylesheet then do this in your code:222// $.blockUI.defaults.css = {};223css: {224padding: 0,225margin: 0,226width: '30%',227top: '40%',228left: '35%',229textAlign: 'center',230color: '#000',231border: '3px solid #aaa',232backgroundColor:'#fff',233cursor: 'wait'234},235236// minimal style set used when themes are used237themedCSS: {238width: '30%',239top: '40%',240left: '35%'241},242243// styles for the overlay244overlayCSS: {245backgroundColor: '#000',246opacity: 0.6,247cursor: 'wait'248},249250// style to replace wait cursor before unblocking to correct issue251// of lingering wait cursor252cursorReset: 'default',253254// styles applied when using $.growlUI255growlCSS: {256width: '350px',257top: '10px',258left: '',259right: '10px',260border: 'none',261padding: '5px',262opacity: 0.6,263cursor: 'default',264color: '#fff',265backgroundColor: '#000',266'-webkit-border-radius':'10px',267'-moz-border-radius': '10px',268'border-radius': '10px'269},270271// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w272// (hat tip to Jorge H. N. de Vasconcelos)273/*jshint scripturl:true */274iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',275276// force usage of iframe in non-IE browsers (handy for blocking applets)277forceIframe: false,278279// z-index for the blocking overlay280baseZ: 1000,281282// set these to true to have the message automatically centered283centerX: true, // <-- only effects element blocking (page block controlled via css above)284centerY: true,285286// allow body element to be stetched in ie6; this makes blocking look better287// on "short" pages. disable if you wish to prevent changes to the body height288allowBodyStretch: true,289290// enable if you want key and mouse events to be disabled for content that is blocked291bindEvents: true,292293// be default blockUI will supress tab navigation from leaving blocking content294// (if bindEvents is true)295constrainTabKey: true,296297// fadeIn time in millis; set to 0 to disable fadeIn on block298fadeIn: 200,299300// fadeOut time in millis; set to 0 to disable fadeOut on unblock301fadeOut: 400,302303// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock304timeout: 0,305306// disable if you don't want to show the overlay307showOverlay: true,308309// if true, focus will be placed in the first available input field when310// page blocking311focusInput: true,312313// elements that can receive focus314focusableElements: ':input:enabled:visible',315316// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)317// no longer needed in 2012318// applyPlatformOpacityRules: true,319320// callback method invoked when fadeIn has completed and blocking message is visible321onBlock: null,322323// callback method invoked when unblocking has completed; the callback is324// passed the element that has been unblocked (which is the window object for page325// blocks) and the options that were passed to the unblock call:326// onUnblock(element, options)327onUnblock: null,328329// callback method invoked when the overlay area is clicked.330// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.331onOverlayClick: null,332333// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493334quirksmodeOffsetHack: 4,335336// class name of the message block337blockMsgClass: 'blockMsg',338339// if it is already blocked, then ignore it (don't unblock and reblock)340ignoreIfBlocked: false341};342343// private data and functions follow...344345var pageBlock = null;346var pageBlockEls = [];347348function install(el, opts) {349var css, themedCSS;350var full = (el == window);351var msg = (opts && opts.message !== undefined ? opts.message : undefined);352opts = $.extend({}, $.blockUI.defaults, opts || {});353354if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))355return;356357opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});358css = $.extend({}, $.blockUI.defaults.css, opts.css || {});359if (opts.onOverlayClick)360opts.overlayCSS.cursor = 'pointer';361362themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});363msg = msg === undefined ? opts.message : msg;364365// remove the current block (if there is one)366if (full && pageBlock)367remove(window, {fadeOut:0});368369// if an existing element is being used as the blocking content then we capture370// its current place in the DOM (and current display style) so we can restore371// it when we unblock372if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {373var node = msg.jquery ? msg[0] : msg;374var data = {};375$(el).data('blockUI.history', data);376data.el = node;377data.parent = node.parentNode;378data.display = node.style.display;379data.position = node.style.position;380if (data.parent)381data.parent.removeChild(node);382}383384$(el).data('blockUI.onUnblock', opts.onUnblock);385var z = opts.baseZ;386387// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;388// layer1 is the iframe layer which is used to supress bleed through of underlying content389// layer2 is the overlay layer which has opacity and a wait cursor (by default)390// layer3 is the message content that is displayed while blocking391var lyr1, lyr2, lyr3, s;392if (msie || opts.forceIframe)393lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');394else395lyr1 = $('<div class="blockUI" style="display:none"></div>');396397if (opts.theme)398lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');399else400lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');401402if (opts.theme && full) {403s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';404if ( opts.title ) {405s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';406}407s += '<div class="ui-widget-content ui-dialog-content"></div>';408s += '</div>';409}410else if (opts.theme) {411s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';412if ( opts.title ) {413s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || ' ')+'</div>';414}415s += '<div class="ui-widget-content ui-dialog-content"></div>';416s += '</div>';417}418else if (full) {419s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';420}421else {422s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';423}424lyr3 = $(s);425426// if we have a message, style it427if (msg) {428if (opts.theme) {429lyr3.css(themedCSS);430lyr3.addClass('ui-widget-content');431}432else433lyr3.css(css);434}435436// style the overlay437if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)438lyr2.css(opts.overlayCSS);439lyr2.css('position', full ? 'fixed' : 'absolute');440441// make iframe layer transparent in IE442if (msie || opts.forceIframe)443lyr1.css('opacity',0.0);444445//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);446var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);447$.each(layers, function() {448this.appendTo($par);449});450451if (opts.theme && opts.draggable && $.fn.draggable) {452lyr3.draggable({453handle: '.ui-dialog-titlebar',454cancel: 'li'455});456}457458// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)459var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);460if (ie6 || expr) {461// give body 100% height462if (full && opts.allowBodyStretch && $.support.boxModel)463$('html,body').css('height','100%');464465// fix ie6 issue when blocked element has a border width466if ((ie6 || !$.support.boxModel) && !full) {467var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');468var fixT = t ? '(0 - '+t+')' : 0;469var fixL = l ? '(0 - '+l+')' : 0;470}471472// simulate fixed position473$.each(layers, function(i,o) {474var s = o[0].style;475s.position = 'absolute';476if (i < 2) {477if (full)478s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');479else480s.setExpression('height','this.parentNode.offsetHeight + "px"');481if (full)482s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');483else484s.setExpression('width','this.parentNode.offsetWidth + "px"');485if (fixL) s.setExpression('left', fixL);486if (fixT) s.setExpression('top', fixT);487}488else if (opts.centerY) {489if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');490s.marginTop = 0;491}492else if (!opts.centerY && full) {493var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;494var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';495s.setExpression('top',expression);496}497});498}499500// show the message501if (msg) {502if (opts.theme)503lyr3.find('.ui-widget-content').append(msg);504else505lyr3.append(msg);506if (msg.jquery || msg.nodeType)507$(msg).show();508}509510if ((msie || opts.forceIframe) && opts.showOverlay)511lyr1.show(); // opacity is zero512if (opts.fadeIn) {513var cb = opts.onBlock ? opts.onBlock : noOp;514var cb1 = (opts.showOverlay && !msg) ? cb : noOp;515var cb2 = msg ? cb : noOp;516if (opts.showOverlay)517lyr2._fadeIn(opts.fadeIn, cb1);518if (msg)519lyr3._fadeIn(opts.fadeIn, cb2);520}521else {522if (opts.showOverlay)523lyr2.show();524if (msg)525lyr3.show();526if (opts.onBlock)527opts.onBlock();528}529530// bind key and mouse events531bind(1, el, opts);532533if (full) {534pageBlock = lyr3[0];535pageBlockEls = $(opts.focusableElements,pageBlock);536if (opts.focusInput)537setTimeout(focus, 20);538}539else540center(lyr3[0], opts.centerX, opts.centerY);541542if (opts.timeout) {543// auto-unblock544var to = setTimeout(function() {545if (full)546$.unblockUI(opts);547else548$(el).unblock(opts);549}, opts.timeout);550$(el).data('blockUI.timeout', to);551}552}553554// remove the block555function remove(el, opts) {556var count;557var full = (el == window);558var $el = $(el);559var data = $el.data('blockUI.history');560var to = $el.data('blockUI.timeout');561if (to) {562clearTimeout(to);563$el.removeData('blockUI.timeout');564}565opts = $.extend({}, $.blockUI.defaults, opts || {});566bind(0, el, opts); // unbind events567568if (opts.onUnblock === null) {569opts.onUnblock = $el.data('blockUI.onUnblock');570$el.removeData('blockUI.onUnblock');571}572573var els;574if (full) // crazy selector to handle odd field errors in ie6/7575els = $('body').children().filter('.blockUI').add('body > .blockUI');576else577els = $el.find('>.blockUI');578579// fix cursor issue580if ( opts.cursorReset ) {581if ( els.length > 1 )582els[1].style.cursor = opts.cursorReset;583if ( els.length > 2 )584els[2].style.cursor = opts.cursorReset;585}586587if (full)588pageBlock = pageBlockEls = null;589590if (opts.fadeOut) {591count = els.length;592els.stop().fadeOut(opts.fadeOut, function() {593if ( --count === 0)594reset(els,data,opts,el);595});596}597else598reset(els, data, opts, el);599}600601// move blocking element back into the DOM where it started602function reset(els,data,opts,el) {603var $el = $(el);604if ( $el.data('blockUI.isBlocked') )605return;606607els.each(function(i,o) {608// remove via DOM calls so we don't lose event handlers609if (this.parentNode)610this.parentNode.removeChild(this);611});612613if (data && data.el) {614data.el.style.display = data.display;615data.el.style.position = data.position;616if (data.parent)617data.parent.appendChild(data.el);618$el.removeData('blockUI.history');619}620621if ($el.data('blockUI.static')) {622$el.css('position', 'static'); // #22623}624625if (typeof opts.onUnblock == 'function')626opts.onUnblock(el,opts);627628// fix issue in Safari 6 where block artifacts remain until reflow629var body = $(document.body), w = body.width(), cssW = body[0].style.width;630body.width(w-1).width(w);631body[0].style.width = cssW;632}633634// bind/unbind the handler635function bind(b, el, opts) {636var full = el == window, $el = $(el);637638// don't bother unbinding if there is nothing to unbind639if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))640return;641642$el.data('blockUI.isBlocked', b);643644// don't bind events when overlay is not in use or if bindEvents is false645if (!full || !opts.bindEvents || (b && !opts.showOverlay))646return;647648// bind anchors and inputs for mouse and key events649var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';650if (b)651$(document).bind(events, opts, handler);652else653$(document).unbind(events, handler);654655// former impl...656// var $e = $('a,:input');657// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);658}659660// event handler to suppress keyboard/mouse events when blocking661function handler(e) {662// allow tab navigation (conditionally)663if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {664if (pageBlock && e.data.constrainTabKey) {665var els = pageBlockEls;666var fwd = !e.shiftKey && e.target === els[els.length-1];667var back = e.shiftKey && e.target === els[0];668if (fwd || back) {669setTimeout(function(){focus(back);},10);670return false;671}672}673}674var opts = e.data;675var target = $(e.target);676if (target.hasClass('blockOverlay') && opts.onOverlayClick)677opts.onOverlayClick(e);678679// allow events within the message content680if (target.parents('div.' + opts.blockMsgClass).length > 0)681return true;682683// allow events for content that is not being blocked684return target.parents().children().filter('div.blockUI').length === 0;685}686687function focus(back) {688if (!pageBlockEls)689return;690var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];691if (e)692e.focus();693}694695function center(el, x, y) {696var p = el.parentNode, s = el.style;697var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');698var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');699if (x) s.left = l > 0 ? (l+'px') : '0';700if (y) s.top = t > 0 ? (t+'px') : '0';701}702703function sz(el, p) {704return parseInt($.css(el,p),10)||0;705}706707}708709710/*global define:true */711if (typeof define === 'function' && define.amd && define.amd.jQuery) {712define(['jquery'], setup);713} else {714setup(jQuery);715}716717})();718719720721722723/*!724Autosize v1.18.1 - 2013-11-05725Automatically adjust textarea height based on user input.726(c) 2013 Jack Moore - http://www.jacklmoore.com/autosize727license: http://www.opensource.org/licenses/mit-license.php728*/729(function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(u,null),o=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=u,s.className=i.className,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$);730731732/*733Bootstrap - File Input734======================735736This is meant to convert all file input tags into a set of elements that displays consistently in all browsers.737738Converts all739<input type="file">740into Bootstrap buttons741<a class="btn">Browse</a>742743*/744$(function() {745746$.fn.bootstrapFileInput = function(browseText) {747748this.each(function(i,elem){749750var $elem = $(elem);751752// Maybe some fields don't need to be standardized.753if (typeof $elem.attr('data-bfi-disabled') != 'undefined') {754return;755}756757// Set the word to be displayed on the button758var buttonWord = browseText && browseText.length ? browseText : 'Browse';759760if (typeof $elem.attr('title') != 'undefined') {761buttonWord = $elem.attr('title');762}763764// Start by getting the HTML of the input element.765// Thanks for the tip http://stackoverflow.com/a/1299069766var input = $('<div>').append( $elem.eq(0).clone() ).html();767var className = '';768769if (!!$elem.attr('class')) {770className = ' ' + $elem.attr('class');771}772773// Now we're going to replace that input field with a Bootstrap button.774// The input will actually still be there, it will just be float above and transparent (done with the CSS).775$elem.replaceWith('<a class="file-input-wrapper btn' + className + '">'+buttonWord+input+'</a>');776})777778// After we have found all of the file inputs let's apply a listener for tracking the mouse movement.779// This is important because the in order to give the illusion that this is a button in FF we actually need to move the button from the file input under the cursor. Ugh.780.promise().done( function(){781782// As the cursor moves over our new Bootstrap button we need to adjust the position of the invisible file input Browse button to be under the cursor.783// This gives us the pointer cursor that FF denies us784$('.file-input-wrapper').mousemove(function(cursor) {785786var input, wrapper,787wrapperX, wrapperY,788inputWidth, inputHeight,789cursorX, cursorY;790791// This wrapper element (the button surround this file input)792wrapper = $(this);793// The invisible file input element794input = wrapper.find("input");795// The left-most position of the wrapper796wrapperX = wrapper.offset().left;797// The top-most position of the wrapper798wrapperY = wrapper.offset().top;799// The with of the browsers input field800inputWidth= input.width();801// The height of the browsers input field802inputHeight= input.height();803//The position of the cursor in the wrapper804cursorX = cursor.pageX;805cursorY = cursor.pageY;806807//The positions we are to move the invisible file input808// The 20 at the end is an arbitrary number of pixels that we can shift the input such that cursor is not pointing at the end of the Browse button but somewhere nearer the middle809moveInputX = cursorX - wrapperX - inputWidth + 20;810// Slides the invisible input Browse button to be positioned middle under the cursor811moveInputY = cursorY- wrapperY - (inputHeight/2);812813// Apply the positioning styles to actually move the invisible file input814input.css({815left:moveInputX,816top:moveInputY817});818});819820$('.file-input-wrapper input[type=file]').change(function(){821822var fileName;823fileName = $(this).val();824825// Remove any previous file names826$(this).parent().next('.file-input-name').remove();827if (!!$(this).prop('files') && $(this).prop('files').length > 1) {828fileName = $(this)[0].files.length+' files';829//$(this).parent().after('<span class="file-input-name">'+$(this)[0].files.length+' files</span>');830}831else {832// var fakepath = 'C:\\fakepath\\';833// fileName = $(this).val().replace('C:\\fakepath\\','');834fileName = fileName.substring(fileName.lastIndexOf('\\')+1,fileName.length);835}836837$(this).parent().after('<span class="file-input-name">'+fileName+'</span>');838});839840});841842};843844// Add the styles before the first stylesheet845// This ensures they can be easily overridden with developer styles846var cssHtml = '<style>'+847'.file-input-wrapper { overflow: hidden; position: relative; cursor: pointer; z-index: 1; }'+848'.file-input-wrapper input[type=file], .file-input-wrapper input[type=file]:focus, .file-input-wrapper input[type=file]:hover { position: absolute; top: 0; left: 0; cursor: pointer; opacity: 0; filter: alpha(opacity=0); z-index: 99; outline: 0; }'+849'.file-input-name { margin-left: 8px; }'+850'</style>';851$('link[rel=stylesheet]').eq(0).before(cssHtml);852853});854855856857858/* Scroll Monitor */859(function( factory ) {860if (typeof define !== 'undefined' && define.amd) {861define(['jquery'], factory);862} else if (typeof module !== 'undefined' && module.exports) {863var $ = require('jquery');864module.exports = factory( $ );865} else {866window.scrollMonitor = factory( jQuery );867}868})(function( $ ) {869870var exports = {};871872var $window = $(window);873var $document = $(document);874875var watchers = [];876877var VISIBILITYCHANGE = 'visibilityChange';878var ENTERVIEWPORT = 'enterViewport';879var FULLYENTERVIEWPORT = 'fullyEnterViewport';880var EXITVIEWPORT = 'exitViewport';881var PARTIALLYEXITVIEWPORT = 'partiallyExitViewport';882var LOCATIONCHANGE = 'locationChange';883var STATECHANGE = 'stateChange';884885var eventTypes = [886VISIBILITYCHANGE,887ENTERVIEWPORT,888FULLYENTERVIEWPORT,889EXITVIEWPORT,890PARTIALLYEXITVIEWPORT,891LOCATIONCHANGE,892STATECHANGE893];894895var defaultOffsets = {top: 0, bottom: 0};896897exports.viewportTop;898exports.viewportBottom;899exports.documentHeight;900exports.viewportHeight = windowHeight();901902var previousDocumentHeight;903var latestEvent;904905function windowHeight() {906return window.innerHeight || document.documentElement.clientHeight;907}908909var calculateViewportI;910function calculateViewport() {911exports.viewportTop = $window.scrollTop();912exports.viewportBottom = exports.viewportTop + exports.viewportHeight;913exports.documentHeight = $document.height();914if (exports.documentHeight !== previousDocumentHeight) {915calculateViewportI = watchers.length;916while( calculateViewportI-- ) {917watchers[calculateViewportI].recalculateLocation();918}919previousDocumentHeight = exports.documentHeight;920}921}922923function recalculateWatchLocationsAndTrigger() {924exports.viewportHeight = windowHeight();925calculateViewport();926updateAndTriggerWatchers();927}928929var recalculateAndTriggerTimer;930function debouncedRecalcuateAndTrigger() {931clearTimeout(recalculateAndTriggerTimer);932recalculateAndTriggerTimer = setTimeout( recalculateWatchLocationsAndTrigger, 100 );933}934935var updateAndTriggerWatchersI;936function updateAndTriggerWatchers() {937// update all watchers then trigger the events so one can rely on another being up to date.938updateAndTriggerWatchersI = watchers.length;939while( updateAndTriggerWatchersI-- ) {940watchers[updateAndTriggerWatchersI].update();941}942943updateAndTriggerWatchersI = watchers.length;944while( updateAndTriggerWatchersI-- ) {945watchers[updateAndTriggerWatchersI].triggerCallbacks();946}947948}949950function ElementWatcher( watchItem, offsets ) {951var self = this;952953this.watchItem = watchItem;954955if (!offsets) {956this.offsets = defaultOffsets;957} else if (offsets === +offsets) {958this.offsets = {top: offsets, bottom: offsets};959} else {960this.offsets = $.extend({}, defaultOffsets, offsets);961}962963this.callbacks = {}; // {callback: function, isOne: true }964965for (var i = 0, j = eventTypes.length; i < j; i++) {966self.callbacks[eventTypes[i]] = [];967}968969this.locked = false;970971var wasInViewport;972var wasFullyInViewport;973var wasAboveViewport;974var wasBelowViewport;975976var listenerToTriggerListI;977var listener;978function triggerCallbackArray( listeners ) {979if (listeners.length === 0) {980return;981}982listenerToTriggerListI = listeners.length;983while( listenerToTriggerListI-- ) {984listener = listeners[listenerToTriggerListI];985listener.callback.call( self, latestEvent );986if (listener.isOne) {987listeners.splice(listenerToTriggerListI, 1);988}989}990}991this.triggerCallbacks = function triggerCallbacks() {992993if (this.isInViewport && !wasInViewport) {994triggerCallbackArray( this.callbacks[ENTERVIEWPORT] );995}996if (this.isFullyInViewport && !wasFullyInViewport) {997triggerCallbackArray( this.callbacks[FULLYENTERVIEWPORT] );998}99910001001if (this.isAboveViewport !== wasAboveViewport &&1002this.isBelowViewport !== wasBelowViewport) {10031004triggerCallbackArray( this.callbacks[VISIBILITYCHANGE] );10051006// if you skip completely past this element1007if (!wasFullyInViewport && !this.isFullyInViewport) {1008triggerCallbackArray( this.callbacks[FULLYENTERVIEWPORT] );1009triggerCallbackArray( this.callbacks[PARTIALLYEXITVIEWPORT] );1010}1011if (!wasInViewport && !this.isInViewport) {1012triggerCallbackArray( this.callbacks[ENTERVIEWPORT] );1013triggerCallbackArray( this.callbacks[EXITVIEWPORT] );1014}1015}10161017if (!this.isFullyInViewport && wasFullyInViewport) {1018triggerCallbackArray( this.callbacks[PARTIALLYEXITVIEWPORT] );1019}1020if (!this.isInViewport && wasInViewport) {1021triggerCallbackArray( this.callbacks[EXITVIEWPORT] );1022}1023if (this.isInViewport !== wasInViewport) {1024triggerCallbackArray( this.callbacks[VISIBILITYCHANGE] );1025}1026switch( true ) {1027case wasInViewport !== this.isInViewport:1028case wasFullyInViewport !== this.isFullyInViewport:1029case wasAboveViewport !== this.isAboveViewport:1030case wasBelowViewport !== this.isBelowViewport:1031triggerCallbackArray( this.callbacks[STATECHANGE] );1032}10331034wasInViewport = this.isInViewport;1035wasFullyInViewport = this.isFullyInViewport;1036wasAboveViewport = this.isAboveViewport;1037wasBelowViewport = this.isBelowViewport;10381039};10401041this.recalculateLocation = function() {1042if (this.locked) {1043return;1044}1045var previousTop = this.top;1046var previousBottom = this.bottom;1047if (this.watchItem.nodeName) { // a dom element1048var cachedDisplay = this.watchItem.style.display;1049if (cachedDisplay === 'none') {1050this.watchItem.style.display = '';1051}10521053var elementLocation = $(this.watchItem).offset();1054this.top = elementLocation.top;1055this.bottom = elementLocation.top + this.watchItem.offsetHeight;10561057if (cachedDisplay === 'none') {1058this.watchItem.style.display = cachedDisplay;1059}10601061} else if (this.watchItem === +this.watchItem) { // number1062if (this.watchItem > 0) {1063this.top = this.bottom = this.watchItem;1064} else {1065this.top = this.bottom = exports.documentHeight - this.watchItem;1066}10671068} else { // an object with a top and bottom property1069this.top = this.watchItem.top;1070this.bottom = this.watchItem.bottom;1071}10721073this.top -= this.offsets.top;1074this.bottom += this.offsets.bottom;1075this.height = this.bottom - this.top;10761077if ( (previousTop !== undefined || previousBottom !== undefined) && (this.top !== previousTop || this.bottom !== previousBottom) ) {1078triggerCallbackArray( this.callbacks[LOCATIONCHANGE] );1079}1080};10811082this.recalculateLocation();1083this.update();10841085wasInViewport = this.isInViewport;1086wasFullyInViewport = this.isFullyInViewport;1087wasAboveViewport = this.isAboveViewport;1088wasBelowViewport = this.isBelowViewport;1089}10901091ElementWatcher.prototype = {1092on: function( event, callback, isOne ) {10931094// trigger the event if it applies to the element right now.1095switch( true ) {1096case event === VISIBILITYCHANGE && !this.isInViewport && this.isAboveViewport:1097case event === ENTERVIEWPORT && this.isInViewport:1098case event === FULLYENTERVIEWPORT && this.isFullyInViewport:1099case event === EXITVIEWPORT && this.isAboveViewport && !this.isInViewport:1100case event === PARTIALLYEXITVIEWPORT && this.isAboveViewport:1101callback();1102if (isOne) {1103return;1104}1105}11061107if (this.callbacks[event]) {1108this.callbacks[event].push({callback: callback, isOne: isOne});1109} else {1110throw new Error('Tried to add a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));1111}1112},1113off: function( event, callback ) {1114if (this.callbacks[event]) {1115for (var i = 0, item; item = this.callbacks[event][i]; i++) {1116if (item.callback === callback) {1117this.callbacks[event].splice(i, 1);1118break;1119}1120}1121} else {1122throw new Error('Tried to remove a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));1123}1124},1125one: function( event, callback ) {1126this.on( event, callback, true);1127},1128recalculateSize: function() {1129this.height = this.watchItem.offsetHeight + this.offsets.top + this.offsets.bottom;1130this.bottom = this.top + this.height;1131},1132update: function() {1133this.isAboveViewport = this.top < exports.viewportTop;1134this.isBelowViewport = this.bottom > exports.viewportBottom;11351136this.isInViewport = (this.top <= exports.viewportBottom && this.bottom >= exports.viewportTop);1137this.isFullyInViewport = (this.top >= exports.viewportTop && this.bottom <= exports.viewportBottom) ||1138(this.isAboveViewport && this.isBelowViewport);11391140},1141destroy: function() {1142var index = watchers.indexOf(this),1143self = this;1144watchers.splice(index, 1);1145for (var i = 0, j = eventTypes.length; i < j; i++) {1146self.callbacks[eventTypes[i]].length = 0;1147}1148},1149// prevent recalculating the element location1150lock: function() {1151this.locked = true;1152},1153unlock: function() {1154this.locked = false;1155}1156};11571158var eventHandlerFactory = function (type) {1159return function( callback, isOne ) {1160this.on.call(this, type, callback, isOne);1161};1162};11631164for (var i = 0, j = eventTypes.length; i < j; i++) {1165var type = eventTypes[i];1166ElementWatcher.prototype[type] = eventHandlerFactory(type);1167}11681169try {1170calculateViewport();1171} catch (e) {1172$(calculateViewport);1173}11741175function scrollMonitorListener(event) {1176latestEvent = event;1177calculateViewport();1178updateAndTriggerWatchers();1179}11801181$window.on('scroll', scrollMonitorListener);1182$window.on('resize', debouncedRecalcuateAndTrigger);11831184exports.beget = exports.create = function( element, offsets ) {1185if (typeof element === 'string') {1186element = $(element)[0];1187}1188if (element instanceof $) {1189element = element[0];1190}1191var watcher = new ElementWatcher( element, offsets );1192watchers.push(watcher);1193watcher.update();1194return watcher;1195};11961197exports.update = function() {1198latestEvent = null;1199calculateViewport();1200updateAndTriggerWatchers();1201};1202exports.recalculateLocations = function() {1203exports.documentHeight = 0;1204exports.update();1205};12061207return exports;1208});12091210121112121213/* jquery.nicescroll 3.5.4 InuYaksa*2013 MIT http://areaaperta.com/nicescroll */(function(e){"function"===typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){var y=!1,C=!1,J=5E3,K=2E3,x=0,F=["ms","moz","webkit","o"],s=window.requestAnimationFrame||!1,v=window.cancelAnimationFrame||!1;if(!s)for(var L in F){var D=F[L];s||(s=window[D+"RequestAnimationFrame"]);v||(v=window[D+"CancelAnimationFrame"]||window[D+"CancelRequestAnimationFrame"])}var z=window.MutationObserver||window.WebKitMutationObserver||!1,G={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",1214cursorwidth:"5px",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,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,1215enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:0.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var e=document.getElementsByTagName("script"),e=e[e.length-1].src.split("?")[0];return 0<e.split("/").length?e.split("/").slice(0,-1).join("/")+"/":""}()},E=!1,M=function(){if(E)return E;1216var e=document.createElement("DIV"),b={haspointerlock:"pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document};b.isopera="opera"in window;b.isopera12=b.isopera&&"getUserMedia"in navigator;b.isoperamini="[object OperaMini]"===Object.prototype.toString.call(window.operamini);b.isie="all"in document&&"attachEvent"in e&&!b.isopera;b.isieold=b.isie&&!("msInterpolationMode"in e.style);b.isie7=b.isie&&!b.isieold&&(!("documentMode"in document)||7==document.documentMode);1217b.isie8=b.isie&&"documentMode"in document&&8==document.documentMode;b.isie9=b.isie&&"performance"in window&&9<=document.documentMode;b.isie10=b.isie&&"performance"in window&&10<=document.documentMode;b.isie9mobile=/iemobile.9/i.test(navigator.userAgent);b.isie9mobile&&(b.isie9=!1);b.isie7mobile=!b.isie9mobile&&b.isie7&&/iemobile/i.test(navigator.userAgent);b.ismozilla="MozAppearance"in e.style;b.iswebkit="WebkitAppearance"in e.style;b.ischrome="chrome"in window;b.ischrome22=b.ischrome&&b.haspointerlock;1218b.ischrome26=b.ischrome&&"transition"in e.style;b.cantouch="ontouchstart"in document.documentElement||"ontouchstart"in window;b.hasmstouch=window.navigator.msPointerEnabled||!1;b.ismac=/^mac$/i.test(navigator.platform);b.isios=b.cantouch&&/iphone|ipad|ipod/i.test(navigator.platform);b.isios4=b.isios&&!("seal"in Object);b.isandroid=/android/i.test(navigator.userAgent);b.trstyle=!1;b.hastransform=!1;b.hastranslate3d=!1;b.transitionstyle=!1;b.hastransition=!1;b.transitionend=!1;for(var h=["transform",1219"msTransform","webkitTransform","MozTransform","OTransform"],k=0;k<h.length;k++)if("undefined"!=typeof e.style[h[k]]){b.trstyle=h[k];break}b.hastransform=!1!=b.trstyle;b.hastransform&&(e.style[b.trstyle]="translate3d(1px,2px,3px)",b.hastranslate3d=/translate3d/.test(e.style[b.trstyle]));b.transitionstyle=!1;b.prefixstyle="";b.transitionend=!1;for(var h="transition webkitTransition MozTransition OTransition OTransition msTransition KhtmlTransition".split(" "),l=" -webkit- -moz- -o- -o -ms- -khtml-".split(" "),1220q="transitionend webkitTransitionEnd transitionend otransitionend oTransitionEnd msTransitionEnd KhtmlTransitionEnd".split(" "),k=0;k<h.length;k++)if(h[k]in e.style){b.transitionstyle=h[k];b.prefixstyle=l[k];b.transitionend=q[k];break}b.ischrome26&&(b.prefixstyle=l[1]);b.hastransition=b.transitionstyle;a:{h=["-moz-grab","-webkit-grab","grab"];if(b.ischrome&&!b.ischrome22||b.isie)h=[];for(k=0;k<h.length;k++)if(l=h[k],e.style.cursor=l,e.style.cursor==l){h=l;break a}h="url(http://www.google.com/intl/en_ALL/mapfiles/openhand.cur),n-resize"}b.cursorgrabvalue=1221h;b.hasmousecapture="setCapture"in e;b.hasMutationObserver=!1!==z;return E=b},N=function(g,b){function h(){var c=a.win;if("zIndex"in c)return c.zIndex();for(;0<c.length&&9!=c[0].nodeType;){var b=c.css("zIndex");if(!isNaN(b)&&0!=b)return parseInt(b);c=c.parent()}return!1}function k(c,b,f){b=c.css(b);c=parseFloat(b);return isNaN(c)?(c=w[b]||0,f=3==c?f?a.win.outerHeight()-a.win.innerHeight():a.win.outerWidth()-a.win.innerWidth():1,a.isie8&&c&&(c+=1),f?c:0):c}function l(c,b,f,e){a._bind(c,b,function(a){a=1222a?a:window.event;var e={original:a,target:a.target||a.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==a.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){a.preventDefault?a.preventDefault():a.returnValue=!1;return!1},stopImmediatePropagation:function(){a.stopImmediatePropagation?a.stopImmediatePropagation():a.cancelBubble=!0}};"mousewheel"==b?(e.deltaY=-0.025*a.wheelDelta,a.wheelDeltaX&&(e.deltaX=-0.025*a.wheelDeltaX)):e.deltaY=a.detail;return f.call(c,e)},e)}function q(c,b,f){var e,d;12230==c.deltaMode?(e=-Math.floor(c.deltaX*(a.opt.mousescrollstep/54)),d=-Math.floor(c.deltaY*(a.opt.mousescrollstep/54))):1==c.deltaMode&&(e=-Math.floor(c.deltaX*a.opt.mousescrollstep),d=-Math.floor(c.deltaY*a.opt.mousescrollstep));b&&(a.opt.oneaxismousemode&&0==e&&d)&&(e=d,d=0);e&&(a.scrollmom&&a.scrollmom.stop(),a.lastdeltax+=e,a.debounced("mousewheelx",function(){var c=a.lastdeltax;a.lastdeltax=0;a.rail.drag||a.doScrollLeftBy(c)},15));if(d){if(a.opt.nativeparentscrolling&&f&&!a.ispage&&!a.zoomactive)if(0>1224d){if(a.getScrollTop()>=a.page.maxh)return!0}else if(0>=a.getScrollTop())return!0;a.scrollmom&&a.scrollmom.stop();a.lastdeltay+=d;a.debounced("mousewheely",function(){var c=a.lastdeltay;a.lastdeltay=0;a.rail.drag||a.doScrollBy(c)},15)}c.stopImmediatePropagation();return c.preventDefault()}var a=this;this.version="3.5.4";this.name="nicescroll";this.me=b;this.opt={doc:e("body"),win:!1};e.extend(this.opt,G);this.opt.snapbackspeed=80;if(g)for(var p in a.opt)"undefined"!=typeof g[p]&&(a.opt[p]=g[p]);this.iddoc=1225(this.doc=a.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(a.opt.win?a.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==a.opt.win;this.win=a.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=1226"scroll"!=a.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;this.observerremover=this.observer=this.scrollmom=this.scrollrunning=this.isrtlmode=!1;do this.id="ascrail"+K++;while(document.getElementById(this.id));this.hasmousefocus=1227this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=a.opt.overflowx;this.overflowy=a.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 d=e.extend({},this.detected);this.ishwscroll=(this.canhwscroll=d.hastransform&&a.opt.hwacceleration)&&1228a.haswrapper;this.istouchcapable=!1;d.cantouch&&(d.ischrome&&!d.isios&&!d.isandroid)&&(this.istouchcapable=!0,d.cantouch=!1);d.cantouch&&(d.ismozilla&&!d.isios&&!d.isandroid)&&(this.istouchcapable=!0,d.cantouch=!1);a.opt.enablemouselockapi||(d.hasmousecapture=!1,d.haspointerlock=!1);this.delayed=function(c,b,f,e){var d=a.delaylist[c],h=(new Date).getTime();if(!e&&d&&d.tt)return!1;d&&d.tt&&clearTimeout(d.tt);if(d&&d.last+f>h&&!d.tt)a.delaylist[c]={last:h+f,tt:setTimeout(function(){a&&(a.delaylist[c].tt=12290,b.call())},f)};else if(!d||!d.tt)a.delaylist[c]={last:h,tt:0},setTimeout(function(){b.call()},0)};this.debounced=function(c,b,f){var d=a.delaylist[c];(new Date).getTime();a.delaylist[c]=b;d||setTimeout(function(){var b=a.delaylist[c];a.delaylist[c]=!1;b.call()},f)};var r=!1;this.synched=function(c,b){a.synclist[c]=b;(function(){r||(s(function(){r=!1;for(c in a.synclist){var b=a.synclist[c];b&&b.call(a);a.synclist[c]=!1}}),r=!0)})();return c};this.unsynched=function(c){a.synclist[c]&&(a.synclist[c]=1230!1)};this.css=function(c,b){for(var f in b)a.saved.css.push([c,f,c.css(f)]),c.css(f,b[f])};this.scrollTop=function(c){return"undefined"==typeof c?a.getScrollTop():a.setScrollTop(c)};this.scrollLeft=function(c){return"undefined"==typeof c?a.getScrollLeft():a.setScrollLeft(c)};BezierClass=function(a,b,f,d,e,h,k){this.st=a;this.ed=b;this.spd=f;this.p1=d||0;this.p2=e||1;this.p3=h||0;this.p4=k||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};BezierClass.prototype={B2:function(a){return 3*a*a*(1-1231a)},B3:function(a){return 3*a*(1-a)*(1-a)},B4:function(a){return(1-a)*(1-a)*(1-a)},getNow:function(){var a=1-((new Date).getTime()-this.ts)/this.spd,b=this.B2(a)+this.B3(a)+this.B4(a);return 0>a?this.ed:this.st+Math.round(this.df*b)},update:function(a,b){this.st=this.getNow();this.ed=a;this.spd=b;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"};d.hastranslate3d&&d.isios&&this.doc.css("-webkit-backface-visibility",1232"hidden");var t=function(){var c=a.doc.css(d.trstyle);return c&&"matrix"==c.substr(0,6)?c.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1};this.getScrollTop=function(c){if(!c){if(c=t())return 16==c.length?-c[13]:-c[5];if(a.timerscroll&&a.timerscroll.bz)return a.timerscroll.bz.getNow()}return a.doc.translate.y};this.getScrollLeft=function(c){if(!c){if(c=t())return 16==c.length?-c[12]:-c[4];if(a.timerscroll&&a.timerscroll.bh)return a.timerscroll.bh.getNow()}return a.doc.translate.x};1233this.notifyScrollEvent=document.createEvent?function(a){var b=document.createEvent("UIEvents");b.initUIEvent("scroll",!1,!0,window,1);a.dispatchEvent(b)}:document.fireEvent?function(a){var b=document.createEventObject();a.fireEvent("onscroll");b.cancelBubble=!0}:function(a,b){};d.hastranslate3d&&a.opt.enabletranslate3d?(this.setScrollTop=function(c,b){a.doc.translate.y=c;a.doc.translate.ty=-1*c+"px";a.doc.css(d.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");b||a.notifyScrollEvent(a.win[0])},1234this.setScrollLeft=function(c,b){a.doc.translate.x=c;a.doc.translate.tx=-1*c+"px";a.doc.css(d.trstyle,"translate3d("+a.doc.translate.tx+","+a.doc.translate.ty+",0px)");b||a.notifyScrollEvent(a.win[0])}):(this.setScrollTop=function(c,b){a.doc.translate.y=c;a.doc.translate.ty=-1*c+"px";a.doc.css(d.trstyle,"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");b||a.notifyScrollEvent(a.win[0])},this.setScrollLeft=function(c,b){a.doc.translate.x=c;a.doc.translate.tx=-1*c+"px";a.doc.css(d.trstyle,1235"translate("+a.doc.translate.tx+","+a.doc.translate.ty+")");b||a.notifyScrollEvent(a.win[0])})}else this.getScrollTop=function(){return a.docscroll.scrollTop()},this.setScrollTop=function(c){return a.docscroll.scrollTop(c)},this.getScrollLeft=function(){return a.docscroll.scrollLeft()},this.setScrollLeft=function(c){return a.docscroll.scrollLeft(c)};this.getTarget=function(a){return!a?!1:a.target?a.target:a.srcElement?a.srcElement:!1};this.hasParent=function(a,b){if(!a)return!1;for(var f=a.target||1236a.srcElement||a||!1;f&&f.id!=b;)f=f.parentNode||!1;return!1!==f};var w={thin:1,medium:3,thick:5};this.getOffset=function(){if(a.isfixed)return{top:parseFloat(a.win.css("top")),left:parseFloat(a.win.css("left"))};if(!a.viewport)return a.win.offset();var c=a.win.offset(),b=a.viewport.offset();return{top:c.top-b.top+a.viewport.scrollTop(),left:c.left-b.left+a.viewport.scrollLeft()}};this.updateScrollBar=function(c){if(a.ishwscroll)a.rail.css({height:a.win.innerHeight()}),a.railh&&a.railh.css({width:a.win.innerWidth()});1237else{var b=a.getOffset(),f=b.top,d=b.left,f=f+k(a.win,"border-top-width",!0);a.win.outerWidth();a.win.innerWidth();var d=d+(a.rail.align?a.win.outerWidth()-k(a.win,"border-right-width")-a.rail.width:k(a.win,"border-left-width")),e=a.opt.railoffset;e&&(e.top&&(f+=e.top),a.rail.align&&e.left&&(d+=e.left));a.locked||a.rail.css({top:f,left:d,height:c?c.h:a.win.innerHeight()});a.zoom&&a.zoom.css({top:f+1,left:1==a.rail.align?d-20:d+a.rail.width+4});a.railh&&!a.locked&&(f=b.top,d=b.left,c=a.railh.align?1238f+k(a.win,"border-top-width",!0)+a.win.innerHeight()-a.railh.height:f+k(a.win,"border-top-width",!0),d+=k(a.win,"border-left-width"),a.railh.css({top:c,left:d,width:a.railh.width}))}};this.doRailClick=function(c,b,f){var d;a.locked||(a.cancelEvent(c),b?(b=f?a.doScrollLeft:a.doScrollTop,d=f?(c.pageX-a.railh.offset().left-a.cursorwidth/2)*a.scrollratio.x:(c.pageY-a.rail.offset().top-a.cursorheight/2)*a.scrollratio.y,b(d)):(b=f?a.doScrollLeftBy:a.doScrollBy,d=f?a.scroll.x:a.scroll.y,c=f?c.pageX-a.railh.offset().left:1239c.pageY-a.rail.offset().top,f=f?a.view.w:a.view.h,d>=c?b(f):b(-f)))};a.hasanimationframe=s;a.hascancelanimationframe=v;a.hasanimationframe?a.hascancelanimationframe||(v=function(){a.cancelAnimationFrame=!0}):(s=function(a){return setTimeout(a,15-Math.floor(+new Date/1E3)%16)},v=clearInterval);this.init=function(){a.saved.css=[];if(d.isie7mobile||d.isoperamini)return!0;d.hasmstouch&&a.css(a.ispage?e("html"):a.win,{"-ms-touch-action":"none"});a.zindex="auto";a.zindex=!a.ispage&&"auto"==a.opt.zindex?1240h()||"auto":a.opt.zindex;!a.ispage&&"auto"!=a.zindex&&a.zindex>x&&(x=a.zindex);a.isie&&(0==a.zindex&&"auto"==a.opt.zindex)&&(a.zindex="auto");if(!a.ispage||!d.cantouch&&!d.isieold&&!d.isie9mobile){var c=a.docscroll;a.ispage&&(c=a.haswrapper?a.win:a.doc);d.isie9mobile||a.css(c,{"overflow-y":"hidden"});a.ispage&&d.isie7&&("BODY"==a.doc[0].nodeName?a.css(e("html"),{"overflow-y":"hidden"}):"HTML"==a.doc[0].nodeName&&a.css(e("body"),{"overflow-y":"hidden"}));d.isios&&(!a.ispage&&!a.haswrapper)&&a.css(e("body"),1241{"-webkit-overflow-scrolling":"touch"});var b=e(document.createElement("div"));b.css({position:"relative",top:0,"float":"right",width:a.opt.cursorwidth,height:"0px","background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});b.hborder=parseFloat(b.outerHeight()-b.innerHeight());a.cursor=b;var f=e(document.createElement("div"));1242f.attr("id",a.id);f.addClass("nicescroll-rails");var u,k,g=["left","right"],l;for(l in g)k=g[l],(u=a.opt.railpadding[k])?f.css("padding-"+k,u+"px"):a.opt.railpadding[k]=0;f.append(b);f.width=Math.max(parseFloat(a.opt.cursorwidth),b.outerWidth())+a.opt.railpadding.left+a.opt.railpadding.right;f.css({width:f.width+"px",zIndex:a.zindex,background:a.opt.background,cursor:"default"});f.visibility=!0;f.scrollable=!0;f.align="left"==a.opt.railalign?0:1;a.rail=f;b=a.rail.drag=!1;a.opt.boxzoom&&(!a.ispage&&1243!d.isieold)&&(b=document.createElement("div"),a.bind(b,"click",a.doZoom),a.zoom=e(b),a.zoom.css({cursor:"pointer","z-index":a.zindex,backgroundImage:"url("+a.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),a.opt.dblclickzoom&&a.bind(a.win,"dblclick",a.doZoom),d.cantouch&&a.opt.gesturezoom&&(a.ongesturezoom=function(c){1.5<c.scale&&a.doZoomIn(c);0.8>c.scale&&a.doZoomOut(c);return a.cancelEvent(c)},a.bind(a.win,"gestureend",a.ongesturezoom)));a.railh=!1;if(a.opt.horizrailenabled){a.css(c,1244{"overflow-x":"hidden"});b=e(document.createElement("div"));b.css({position:"relative",top:0,height:a.opt.cursorwidth,width:"0px","background-color":a.opt.cursorcolor,border:a.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":a.opt.cursorborderradius,"-moz-border-radius":a.opt.cursorborderradius,"border-radius":a.opt.cursorborderradius});b.wborder=parseFloat(b.outerWidth()-b.innerWidth());a.cursorh=b;var m=e(document.createElement("div"));m.attr("id",a.id+"-hr");m.addClass("nicescroll-rails");1245m.height=Math.max(parseFloat(a.opt.cursorwidth),b.outerHeight());m.css({height:m.height+"px",zIndex:a.zindex,background:a.opt.background});m.append(b);m.visibility=!0;m.scrollable=!0;m.align="top"==a.opt.railvalign?0:1;a.railh=m;a.railh.drag=!1}a.ispage?(f.css({position:"fixed",top:"0px",height:"100%"}),f.align?f.css({right:"0px"}):f.css({left:"0px"}),a.body.append(f),a.railh&&(m.css({position:"fixed",left:"0px",width:"100%"}),m.align?m.css({bottom:"0px"}):m.css({top:"0px"}),a.body.append(m))):(a.ishwscroll?1246("static"==a.win.css("position")&&a.css(a.win,{position:"relative"}),c="HTML"==a.win[0].nodeName?a.body:a.win,a.zoom&&(a.zoom.css({position:"absolute",top:1,right:0,"margin-right":f.width+4}),c.append(a.zoom)),f.css({position:"absolute",top:0}),f.align?f.css({right:0}):f.css({left:0}),c.append(f),m&&(m.css({position:"absolute",left:0,bottom:0}),m.align?m.css({bottom:0}):m.css({top:0}),c.append(m))):(a.isfixed="fixed"==a.win.css("position"),c=a.isfixed?"fixed":"absolute",a.isfixed||(a.viewport=a.getViewport(a.win[0])),1247a.viewport&&(a.body=a.viewport,!1==/fixed|relative|absolute/.test(a.viewport.css("position"))&&a.css(a.viewport,{position:"relative"})),f.css({position:c}),a.zoom&&a.zoom.css({position:c}),a.updateScrollBar(),a.body.append(f),a.zoom&&a.body.append(a.zoom),a.railh&&(m.css({position:c}),a.body.append(m))),d.isios&&a.css(a.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),d.isie&&a.opt.disableoutline&&a.win.attr("hideFocus","true"),d.iswebkit&&a.opt.disableoutline&&1248a.win.css({outline:"none"}));!1===a.opt.autohidemode?(a.autohidedom=!1,a.rail.css({opacity:a.opt.cursoropacitymax}),a.railh&&a.railh.css({opacity:a.opt.cursoropacitymax})):!0===a.opt.autohidemode||"leave"===a.opt.autohidemode?(a.autohidedom=e().add(a.rail),d.isie8&&(a.autohidedom=a.autohidedom.add(a.cursor)),a.railh&&(a.autohidedom=a.autohidedom.add(a.railh)),a.railh&&d.isie8&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"scroll"==a.opt.autohidemode?(a.autohidedom=e().add(a.rail),a.railh&&(a.autohidedom=1249a.autohidedom.add(a.railh))):"cursor"==a.opt.autohidemode?(a.autohidedom=e().add(a.cursor),a.railh&&(a.autohidedom=a.autohidedom.add(a.cursorh))):"hidden"==a.opt.autohidemode&&(a.autohidedom=!1,a.hide(),a.locked=!1);if(d.isie9mobile)a.scrollmom=new H(a),a.onmangotouch=function(c){c=a.getScrollTop();var b=a.getScrollLeft();if(c==a.scrollmom.lastscrolly&&b==a.scrollmom.lastscrollx)return!0;var f=c-a.mangotouch.sy,d=b-a.mangotouch.sx;if(0!=Math.round(Math.sqrt(Math.pow(d,2)+Math.pow(f,2)))){var n=0>1250f?-1:1,e=0>d?-1:1,h=+new Date;a.mangotouch.lazy&&clearTimeout(a.mangotouch.lazy);80<h-a.mangotouch.tm||a.mangotouch.dry!=n||a.mangotouch.drx!=e?(a.scrollmom.stop(),a.scrollmom.reset(b,c),a.mangotouch.sy=c,a.mangotouch.ly=c,a.mangotouch.sx=b,a.mangotouch.lx=b,a.mangotouch.dry=n,a.mangotouch.drx=e,a.mangotouch.tm=h):(a.scrollmom.stop(),a.scrollmom.update(a.mangotouch.sx-d,a.mangotouch.sy-f),a.mangotouch.tm=h,f=Math.max(Math.abs(a.mangotouch.ly-c),Math.abs(a.mangotouch.lx-b)),a.mangotouch.ly=c,a.mangotouch.lx=1251b,2<f&&(a.mangotouch.lazy=setTimeout(function(){a.mangotouch.lazy=!1;a.mangotouch.dry=0;a.mangotouch.drx=0;a.mangotouch.tm=0;a.scrollmom.doMomentum(30)},100)))}},f=a.getScrollTop(),m=a.getScrollLeft(),a.mangotouch={sy:f,ly:f,dry:0,sx:m,lx:m,drx:0,lazy:!1,tm:0},a.bind(a.docscroll,"scroll",a.onmangotouch);else{if(d.cantouch||a.istouchcapable||a.opt.touchbehavior||d.hasmstouch){a.scrollmom=new H(a);a.ontouchstart=function(c){if(c.pointerType&&2!=c.pointerType)return!1;a.hasmoving=!1;if(!a.locked){if(d.hasmstouch)for(var b=1252c.target?c.target:!1;b;){var f=e(b).getNiceScroll();if(0<f.length&&f[0].me==a.me)break;if(0<f.length)return!1;if("DIV"==b.nodeName&&b.id==a.id)break;b=b.parentNode?b.parentNode:!1}a.cancelScroll();if((b=a.getTarget(c))&&/INPUT/i.test(b.nodeName)&&/range/i.test(b.type))return a.stopPropagation(c);!("clientX"in c)&&"changedTouches"in c&&(c.clientX=c.changedTouches[0].clientX,c.clientY=c.changedTouches[0].clientY);a.forcescreen&&(f=c,c={original:c.original?c.original:c},c.clientX=f.screenX,c.clientY=1253f.screenY);a.rail.drag={x:c.clientX,y:c.clientY,sx:a.scroll.x,sy:a.scroll.y,st:a.getScrollTop(),sl:a.getScrollLeft(),pt:2,dl:!1};if(a.ispage||!a.opt.directionlockdeadzone)a.rail.drag.dl="f";else{var f=e(window).width(),n=e(window).height(),h=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),k=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),n=Math.max(0,k-n),f=Math.max(0,h-f);a.rail.drag.ck=!a.rail.scrollable&&a.railh.scrollable?0<n?"v":!1:a.rail.scrollable&&1254!a.railh.scrollable?0<f?"h":!1:!1;a.rail.drag.ck||(a.rail.drag.dl="f")}a.opt.touchbehavior&&(a.isiframe&&d.isie)&&(f=a.win.position(),a.rail.drag.x+=f.left,a.rail.drag.y+=f.top);a.hasmoving=!1;a.lastmouseup=!1;a.scrollmom.reset(c.clientX,c.clientY);if(!d.cantouch&&!this.istouchcapable&&!d.hasmstouch){if(!b||!/INPUT|SELECT|TEXTAREA/i.test(b.nodeName))return!a.ispage&&d.hasmousecapture&&b.setCapture(),a.opt.touchbehavior?(b.onclick&&!b._onclick&&(b._onclick=b.onclick,b.onclick=function(c){if(a.hasmoving)return!1;1255b._onclick.call(this,c)}),a.cancelEvent(c)):a.stopPropagation(c);/SUBMIT|CANCEL|BUTTON/i.test(e(b).attr("type"))&&(pc={tg:b,click:!1},a.preventclick=pc)}}};a.ontouchend=function(c){if(c.pointerType&&2!=c.pointerType)return!1;if(a.rail.drag&&2==a.rail.drag.pt&&(a.scrollmom.doMomentum(),a.rail.drag=!1,a.hasmoving&&(a.lastmouseup=!0,a.hideCursor(),d.hasmousecapture&&document.releaseCapture(),!d.cantouch)))return a.cancelEvent(c)};var q=a.opt.touchbehavior&&a.isiframe&&!d.hasmousecapture;a.ontouchmove=1256function(c,b){if(c.pointerType&&2!=c.pointerType)return!1;if(a.rail.drag&&2==a.rail.drag.pt){if(d.cantouch&&"undefined"==typeof c.original)return!0;a.hasmoving=!0;a.preventclick&&!a.preventclick.click&&(a.preventclick.click=a.preventclick.tg.onclick||!1,a.preventclick.tg.onclick=a.onpreventclick);c=e.extend({original:c},c);"changedTouches"in c&&(c.clientX=c.changedTouches[0].clientX,c.clientY=c.changedTouches[0].clientY);if(a.forcescreen){var f=c;c={original:c.original?c.original:c};c.clientX=f.screenX;1257c.clientY=f.screenY}f=ofy=0;if(q&&!b){var n=a.win.position(),f=-n.left;ofy=-n.top}var h=c.clientY+ofy,n=h-a.rail.drag.y,k=c.clientX+f,u=k-a.rail.drag.x,g=a.rail.drag.st-n;a.ishwscroll&&a.opt.bouncescroll?0>g?g=Math.round(g/2):g>a.page.maxh&&(g=a.page.maxh+Math.round((g-a.page.maxh)/2)):(0>g&&(h=g=0),g>a.page.maxh&&(g=a.page.maxh,h=0));if(a.railh&&a.railh.scrollable){var l=a.rail.drag.sl-u;a.ishwscroll&&a.opt.bouncescroll?0>l?l=Math.round(l/2):l>a.page.maxw&&(l=a.page.maxw+Math.round((l-a.page.maxw)/12582)):(0>l&&(k=l=0),l>a.page.maxw&&(l=a.page.maxw,k=0))}f=!1;if(a.rail.drag.dl)f=!0,"v"==a.rail.drag.dl?l=a.rail.drag.sl:"h"==a.rail.drag.dl&&(g=a.rail.drag.st);else{var n=Math.abs(n),u=Math.abs(u),m=a.opt.directionlockdeadzone;if("v"==a.rail.drag.ck){if(n>m&&u<=0.3*n)return a.rail.drag=!1,!0;u>m&&(a.rail.drag.dl="f",e("body").scrollTop(e("body").scrollTop()))}else if("h"==a.rail.drag.ck){if(u>m&&n<=0.3*u)return a.rail.drag=!1,!0;n>m&&(a.rail.drag.dl="f",e("body").scrollLeft(e("body").scrollLeft()))}}a.synched("touchmove",1259function(){a.rail.drag&&2==a.rail.drag.pt&&(a.prepareTransition&&a.prepareTransition(0),a.rail.scrollable&&a.setScrollTop(g),a.scrollmom.update(k,h),a.railh&&a.railh.scrollable?(a.setScrollLeft(l),a.showCursor(g,l)):a.showCursor(g),d.isie10&&document.selection.clear())});d.ischrome&&a.istouchcapable&&(f=!1);if(f)return a.cancelEvent(c)}}}a.onmousedown=function(c,b){if(!(a.rail.drag&&1!=a.rail.drag.pt)){if(a.locked)return a.cancelEvent(c);a.cancelScroll();a.rail.drag={x:c.clientX,y:c.clientY,sx:a.scroll.x,1260sy:a.scroll.y,pt:1,hr:!!b};var f=a.getTarget(c);!a.ispage&&d.hasmousecapture&&f.setCapture();a.isiframe&&!d.hasmousecapture&&(a.saved.csspointerevents=a.doc.css("pointer-events"),a.css(a.doc,{"pointer-events":"none"}));a.hasmoving=!1;return a.cancelEvent(c)}};a.onmouseup=function(c){if(a.rail.drag&&(d.hasmousecapture&&document.releaseCapture(),a.isiframe&&!d.hasmousecapture&&a.doc.css("pointer-events",a.saved.csspointerevents),1==a.rail.drag.pt))return a.rail.drag=!1,a.hasmoving&&a.triggerScrollEnd(),1261a.cancelEvent(c)};a.onmousemove=function(c){if(a.rail.drag&&1==a.rail.drag.pt){if(d.ischrome&&0==c.which)return a.onmouseup(c);a.cursorfreezed=!0;a.hasmoving=!0;if(a.rail.drag.hr){a.scroll.x=a.rail.drag.sx+(c.clientX-a.rail.drag.x);0>a.scroll.x&&(a.scroll.x=0);var b=a.scrollvaluemaxw;a.scroll.x>b&&(a.scroll.x=b)}else a.scroll.y=a.rail.drag.sy+(c.clientY-a.rail.drag.y),0>a.scroll.y&&(a.scroll.y=0),b=a.scrollvaluemax,a.scroll.y>b&&(a.scroll.y=b);a.synched("mousemove",function(){a.rail.drag&&1==a.rail.drag.pt&&1262(a.showCursor(),a.rail.drag.hr?a.doScrollLeft(Math.round(a.scroll.x*a.scrollratio.x),a.opt.cursordragspeed):a.doScrollTop(Math.round(a.scroll.y*a.scrollratio.y),a.opt.cursordragspeed))});return a.cancelEvent(c)}};if(d.cantouch||a.opt.touchbehavior)a.onpreventclick=function(c){if(a.preventclick)return a.preventclick.tg.onclick=a.preventclick.click,a.preventclick=!1,a.cancelEvent(c)},a.bind(a.win,"mousedown",a.ontouchstart),a.onclick=d.isios?!1:function(c){return a.lastmouseup?(a.lastmouseup=!1,a.cancelEvent(c)):1263!0},a.opt.grabcursorenabled&&d.cursorgrabvalue&&(a.css(a.ispage?a.doc:a.win,{cursor:d.cursorgrabvalue}),a.css(a.rail,{cursor:d.cursorgrabvalue}));else{var p=function(c){if(a.selectiondrag){if(c){var b=a.win.outerHeight();c=c.pageY-a.selectiondrag.top;0<c&&c<b&&(c=0);c>=b&&(c-=b);a.selectiondrag.df=c}0!=a.selectiondrag.df&&(a.doScrollBy(2*-Math.floor(a.selectiondrag.df/6)),a.debounced("doselectionscroll",function(){p()},50))}};a.hasTextSelected="getSelection"in document?function(){return 0<document.getSelection().rangeCount}:1264"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1};a.onselectionstart=function(c){a.ispage||(a.selectiondrag=a.win.offset())};a.onselectionend=function(c){a.selectiondrag=!1};a.onselectiondrag=function(c){a.selectiondrag&&a.hasTextSelected()&&a.debounced("selectionscroll",function(){p(c)},250)}}d.hasmstouch&&(a.css(a.rail,{"-ms-touch-action":"none"}),a.css(a.cursor,{"-ms-touch-action":"none"}),a.bind(a.win,"MSPointerDown",a.ontouchstart),a.bind(document,1265"MSPointerUp",a.ontouchend),a.bind(document,"MSPointerMove",a.ontouchmove),a.bind(a.cursor,"MSGestureHold",function(a){a.preventDefault()}),a.bind(a.cursor,"contextmenu",function(a){a.preventDefault()}));this.istouchcapable&&(a.bind(a.win,"touchstart",a.ontouchstart),a.bind(document,"touchend",a.ontouchend),a.bind(document,"touchcancel",a.ontouchend),a.bind(document,"touchmove",a.ontouchmove));a.bind(a.cursor,"mousedown",a.onmousedown);a.bind(a.cursor,"mouseup",a.onmouseup);a.railh&&(a.bind(a.cursorh,1266"mousedown",function(c){a.onmousedown(c,!0)}),a.bind(a.cursorh,"mouseup",a.onmouseup));if(a.opt.cursordragontouch||!d.cantouch&&!a.opt.touchbehavior)a.rail.css({cursor:"default"}),a.railh&&a.railh.css({cursor:"default"}),a.jqbind(a.rail,"mouseenter",function(){if(!a.win.is(":visible"))return!1;a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.rail,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.rail,"click",function(c){a.doRailClick(c,1267!1,!1)}),a.bind(a.rail,"dblclick",function(c){a.doRailClick(c,!0,!1)}),a.bind(a.cursor,"click",function(c){a.cancelEvent(c)}),a.bind(a.cursor,"dblclick",function(c){a.cancelEvent(c)})),a.railh&&(a.jqbind(a.railh,"mouseenter",function(){if(!a.win.is(":visible"))return!1;a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.railh,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}),a.opt.sensitiverail&&(a.bind(a.railh,"click",function(c){a.doRailClick(c,!1,!0)}),a.bind(a.railh,1268"dblclick",function(c){a.doRailClick(c,!0,!0)}),a.bind(a.cursorh,"click",function(c){a.cancelEvent(c)}),a.bind(a.cursorh,"dblclick",function(c){a.cancelEvent(c)})));!d.cantouch&&!a.opt.touchbehavior?(a.bind(d.hasmousecapture?a.win:document,"mouseup",a.onmouseup),a.bind(document,"mousemove",a.onmousemove),a.onclick&&a.bind(document,"click",a.onclick),!a.ispage&&a.opt.enablescrollonselection&&(a.bind(a.win[0],"mousedown",a.onselectionstart),a.bind(document,"mouseup",a.onselectionend),a.bind(a.cursor,1269"mouseup",a.onselectionend),a.cursorh&&a.bind(a.cursorh,"mouseup",a.onselectionend),a.bind(document,"mousemove",a.onselectiondrag)),a.zoom&&(a.jqbind(a.zoom,"mouseenter",function(){a.canshowonmouseevent&&a.showCursor();a.rail.active=!0}),a.jqbind(a.zoom,"mouseleave",function(){a.rail.active=!1;a.rail.drag||a.hideCursor()}))):(a.bind(d.hasmousecapture?a.win:document,"mouseup",a.ontouchend),a.bind(document,"mousemove",a.ontouchmove),a.onclick&&a.bind(document,"click",a.onclick),a.opt.cursordragontouch&&1270(a.bind(a.cursor,"mousedown",a.onmousedown),a.bind(a.cursor,"mousemove",a.onmousemove),a.cursorh&&a.bind(a.cursorh,"mousedown",function(c){a.onmousedown(c,!0)}),a.cursorh&&a.bind(a.cursorh,"mousemove",a.onmousemove)));a.opt.enablemousewheel&&(a.isiframe||a.bind(d.isie&&a.ispage?document:a.win,"mousewheel",a.onmousewheel),a.bind(a.rail,"mousewheel",a.onmousewheel),a.railh&&a.bind(a.railh,"mousewheel",a.onmousewheelhr));!a.ispage&&(!d.cantouch&&!/HTML|^BODY/.test(a.win[0].nodeName))&&(a.win.attr("tabindex")||1271a.win.attr({tabindex:J++}),a.jqbind(a.win,"focus",function(c){y=a.getTarget(c).id||!0;a.hasfocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,"blur",function(c){y=!1;a.hasfocus=!1}),a.jqbind(a.win,"mouseenter",function(c){C=a.getTarget(c).id||!0;a.hasmousefocus=!0;a.canshowonmouseevent&&a.noticeCursor()}),a.jqbind(a.win,"mouseleave",function(){C=!1;a.hasmousefocus=!1;a.rail.drag||a.hideCursor()}))}a.onkeypress=function(c){if(a.locked&&0==a.page.maxh)return!0;c=c?c:window.e;var b=a.getTarget(c);1272if(b&&/INPUT|TEXTAREA|SELECT|OPTION/.test(b.nodeName)&&(!b.getAttribute("type")&&!b.type||!/submit|button|cancel/i.tp)||e(b).attr("contenteditable"))return!0;if(a.hasfocus||a.hasmousefocus&&!y||a.ispage&&!y&&!C){b=c.keyCode;if(a.locked&&27!=b)return a.cancelEvent(c);var f=c.ctrlKey||!1,n=c.shiftKey||!1,d=!1;switch(b){case 38:case 63233:a.doScrollBy(72);d=!0;break;case 40:case 63235:a.doScrollBy(-72);d=!0;break;case 37:case 63232:a.railh&&(f?a.doScrollLeft(0):a.doScrollLeftBy(72),d=!0);break;case 39:case 63234:a.railh&&1273(f?a.doScrollLeft(a.page.maxw):a.doScrollLeftBy(-72),d=!0);break;case 33:case 63276:a.doScrollBy(a.view.h);d=!0;break;case 34:case 63277:a.doScrollBy(-a.view.h);d=!0;break;case 36:case 63273:a.railh&&f?a.doScrollPos(0,0):a.doScrollTo(0);d=!0;break;case 35:case 63275:a.railh&&f?a.doScrollPos(a.page.maxw,a.page.maxh):a.doScrollTo(a.page.maxh);d=!0;break;case 32:a.opt.spacebarenabled&&(n?a.doScrollBy(a.view.h):a.doScrollBy(-a.view.h),d=!0);break;case 27:a.zoomactive&&(a.doZoom(),d=!0)}if(d)return a.cancelEvent(c)}};1274a.opt.enablekeyboard&&a.bind(document,d.isopera&&!d.isopera12?"keypress":"keydown",a.onkeypress);a.bind(document,"keydown",function(c){c.ctrlKey&&(a.wheelprevented=!0)});a.bind(document,"keyup",function(c){c.ctrlKey||(a.wheelprevented=!1)});a.bind(window,"resize",a.lazyResize);a.bind(window,"orientationchange",a.lazyResize);a.bind(window,"load",a.lazyResize);if(d.ischrome&&!a.ispage&&!a.haswrapper){var r=a.win.attr("style"),f=parseFloat(a.win.css("width"))+1;a.win.css("width",f);a.synched("chromefix",1275function(){a.win.attr("style",r)})}a.onAttributeChange=function(c){a.lazyResize(250)};!a.ispage&&!a.haswrapper&&(!1!==z?(a.observer=new z(function(c){c.forEach(a.onAttributeChange)}),a.observer.observe(a.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),a.observerremover=new z(function(c){c.forEach(function(c){if(0<c.removedNodes.length)for(var b in c.removedNodes)if(c.removedNodes[b]==a.win[0])return a.remove()})}),a.observerremover.observe(a.win[0].parentNode,{childList:!0,characterData:!1,1276attributes:!1,subtree:!1})):(a.bind(a.win,d.isie&&!d.isie9?"propertychange":"DOMAttrModified",a.onAttributeChange),d.isie9&&a.win[0].attachEvent("onpropertychange",a.onAttributeChange),a.bind(a.win,"DOMNodeRemoved",function(c){c.target==a.win[0]&&a.remove()})));!a.ispage&&a.opt.boxzoom&&a.bind(window,"resize",a.resizeZoom);a.istextarea&&a.bind(a.win,"mouseup",a.lazyResize);a.lazyResize(30)}if("IFRAME"==this.doc[0].nodeName){var I=function(c){a.iframexd=!1;try{var b="contentDocument"in this?this.contentDocument:1277this.contentWindow.document}catch(f){a.iframexd=!0,b=!1}if(a.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;a.forcescreen=!0;a.isiframe&&(a.iframe={doc:e(b),html:a.doc.contents().find("html")[0],body:a.doc.contents().find("body")[0]},a.getContentSize=function(){return{w:Math.max(a.iframe.html.scrollWidth,a.iframe.body.scrollWidth),h:Math.max(a.iframe.html.scrollHeight,a.iframe.body.scrollHeight)}},a.docscroll=e(a.iframe.body));!d.isios&&(a.opt.iframeautoresize&&1278!a.isiframe)&&(a.win.scrollTop(0),a.doc.height(""),c=Math.max(b.getElementsByTagName("html")[0].scrollHeight,b.body.scrollHeight),a.doc.height(c));a.lazyResize(30);d.isie7&&a.css(e(a.iframe.html),{"overflow-y":"hidden"});a.css(e(a.iframe.body),{"overflow-y":"hidden"});d.isios&&a.haswrapper&&a.css(e(b.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?a.bind(this.contentWindow,"scroll",a.onscroll):a.bind(b,"scroll",a.onscroll);a.opt.enablemousewheel&&a.bind(b,"mousewheel",a.onmousewheel);1279a.opt.enablekeyboard&&a.bind(b,d.isopera?"keypress":"keydown",a.onkeypress);if(d.cantouch||a.opt.touchbehavior)a.bind(b,"mousedown",a.ontouchstart),a.bind(b,"mousemove",function(c){a.ontouchmove(c,!0)}),a.opt.grabcursorenabled&&d.cursorgrabvalue&&a.css(e(b.body),{cursor:d.cursorgrabvalue});a.bind(b,"mouseup",a.ontouchend);a.zoom&&(a.opt.dblclickzoom&&a.bind(b,"dblclick",a.doZoom),a.ongesturezoom&&a.bind(b,"gestureend",a.ongesturezoom))};this.doc[0].readyState&&"complete"==this.doc[0].readyState&&1280setTimeout(function(){I.call(a.doc[0],!1)},500);a.bind(this.doc,"load",I)}};this.showCursor=function(c,b){a.cursortimeout&&(clearTimeout(a.cursortimeout),a.cursortimeout=0);if(a.rail){a.autohidedom&&(a.autohidedom.stop().css({opacity:a.opt.cursoropacitymax}),a.cursoractive=!0);if(!a.rail.drag||1!=a.rail.drag.pt)"undefined"!=typeof c&&!1!==c&&(a.scroll.y=Math.round(1*c/a.scrollratio.y)),"undefined"!=typeof b&&(a.scroll.x=Math.round(1*b/a.scrollratio.x));a.cursor.css({height:a.cursorheight,top:a.scroll.y});1281a.cursorh&&(!a.rail.align&&a.rail.visibility?a.cursorh.css({width:a.cursorwidth,left:a.scroll.x+a.rail.width}):a.cursorh.css({width:a.cursorwidth,left:a.scroll.x}),a.cursoractive=!0);a.zoom&&a.zoom.stop().css({opacity:a.opt.cursoropacitymax})}};this.hideCursor=function(c){!a.cursortimeout&&(a.rail&&a.autohidedom&&!(a.hasmousefocus&&"leave"==a.opt.autohidemode))&&(a.cursortimeout=setTimeout(function(){if(!a.rail.active||!a.showonmouseevent)a.autohidedom.stop().animate({opacity:a.opt.cursoropacitymin}),1282a.zoom&&a.zoom.stop().animate({opacity:a.opt.cursoropacitymin}),a.cursoractive=!1;a.cursortimeout=0},c||a.opt.hidecursordelay))};this.noticeCursor=function(c,b,f){a.showCursor(b,f);a.rail.active||a.hideCursor(c)};this.getContentSize=a.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:a.haswrapper?function(){return{w:a.doc.outerWidth()+parseInt(a.win.css("paddingLeft"))+1283parseInt(a.win.css("paddingRight")),h:a.doc.outerHeight()+parseInt(a.win.css("paddingTop"))+parseInt(a.win.css("paddingBottom"))}}:function(){return{w:a.docscroll[0].scrollWidth,h:a.docscroll[0].scrollHeight}};this.onResize=function(c,b){if(!a||!a.win)return!1;if(!a.haswrapper&&!a.ispage){if("none"==a.win.css("display"))return a.visibility&&a.hideRail().hideRailHr(),!1;!a.hidden&&!a.visibility&&a.showRail().showRailHr()}var f=a.page.maxh,d=a.page.maxw,e=a.view.w;a.view={w:a.ispage?a.win.width():parseInt(a.win[0].clientWidth),1284h:a.ispage?a.win.height():parseInt(a.win[0].clientHeight)};a.page=b?b:a.getContentSize();a.page.maxh=Math.max(0,a.page.h-a.view.h);a.page.maxw=Math.max(0,a.page.w-a.view.w);if(a.page.maxh==f&&a.page.maxw==d&&a.view.w==e){if(a.ispage)return a;f=a.win.offset();if(a.lastposition&&(d=a.lastposition,d.top==f.top&&d.left==f.left))return a;a.lastposition=f}0==a.page.maxh?(a.hideRail(),a.scrollvaluemax=0,a.scroll.y=0,a.scrollratio.y=0,a.cursorheight=0,a.setScrollTop(0),a.rail.scrollable=!1):a.rail.scrollable=1285!0;0==a.page.maxw?(a.hideRailHr(),a.scrollvaluemaxw=0,a.scroll.x=0,a.scrollratio.x=0,a.cursorwidth=0,a.setScrollLeft(0),a.railh.scrollable=!1):a.railh.scrollable=!0;a.locked=0==a.page.maxh&&0==a.page.maxw;if(a.locked)return a.ispage||a.updateScrollBar(a.view),!1;!a.hidden&&!a.visibility?a.showRail().showRailHr():!a.hidden&&!a.railh.visibility&&a.showRailHr();a.istextarea&&(a.win.css("resize")&&"none"!=a.win.css("resize"))&&(a.view.h-=20);a.cursorheight=Math.min(a.view.h,Math.round(a.view.h*(a.view.h/1286a.page.h)));a.cursorheight=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,a.cursorheight);a.cursorwidth=Math.min(a.view.w,Math.round(a.view.w*(a.view.w/a.page.w)));a.cursorwidth=a.opt.cursorfixedheight?a.opt.cursorfixedheight:Math.max(a.opt.cursorminheight,a.cursorwidth);a.scrollvaluemax=a.view.h-a.cursorheight-a.cursor.hborder;a.railh&&(a.railh.width=0<a.page.maxh?a.view.w-a.rail.width:a.view.w,a.scrollvaluemaxw=a.railh.width-a.cursorwidth-a.cursorh.wborder);a.ispage||1287a.updateScrollBar(a.view);a.scrollratio={x:a.page.maxw/a.scrollvaluemaxw,y:a.page.maxh/a.scrollvaluemax};a.getScrollTop()>a.page.maxh?a.doScrollTop(a.page.maxh):(a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y)),a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)),a.cursoractive&&a.noticeCursor());a.scroll.y&&0==a.getScrollTop()&&a.doScrollTo(Math.floor(a.scroll.y*a.scrollratio.y));return a};this.resize=a.onResize;this.lazyResize=function(c){c=isNaN(c)?30:c;a.delayed("resize",a.resize,1288c);return a};this._bind=function(c,b,f,d){a.events.push({e:c,n:b,f:f,b:d,q:!1});c.addEventListener?c.addEventListener(b,f,d||!1):c.attachEvent?c.attachEvent("on"+b,f):c["on"+b]=f};this.jqbind=function(c,b,f){a.events.push({e:c,n:b,f:f,q:!0});e(c).bind(b,f)};this.bind=function(c,b,f,e){var h="jquery"in c?c[0]:c;"mousewheel"==b?"onwheel"in a.win?a._bind(h,"wheel",f,e||!1):(c="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",l(h,c,f,e||!1),"DOMMouseScroll"==c&&l(h,"MozMousePixelScroll",1289f,e||!1)):h.addEventListener?(d.cantouch&&/mouseup|mousedown|mousemove/.test(b)&&a._bind(h,"mousedown"==b?"touchstart":"mouseup"==b?"touchend":"touchmove",function(a){if(a.touches){if(2>a.touches.length){var c=a.touches.length?a.touches[0]:a;c.original=a;f.call(this,c)}}else a.changedTouches&&(c=a.changedTouches[0],c.original=a,f.call(this,c))},e||!1),a._bind(h,b,f,e||!1),d.cantouch&&"mouseup"==b&&a._bind(h,"touchcancel",f,e||!1)):a._bind(h,b,function(c){if((c=c||window.event||!1)&&c.srcElement)c.target=1290c.srcElement;"pageY"in c||(c.pageX=c.clientX+document.documentElement.scrollLeft,c.pageY=c.clientY+document.documentElement.scrollTop);return!1===f.call(h,c)||!1===e?a.cancelEvent(c):!0})};this._unbind=function(a,b,f,d){a.removeEventListener?a.removeEventListener(b,f,d):a.detachEvent?a.detachEvent("on"+b,f):a["on"+b]=!1};this.unbindAll=function(){for(var c=0;c<a.events.length;c++){var b=a.events[c];b.q?b.e.unbind(b.n,b.f):a._unbind(b.e,b.n,b.f,b.b)}};this.cancelEvent=function(a){a=a.original?a.original:1291a?a:window.event||!1;if(!a)return!1;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();a.preventManipulation&&a.preventManipulation();a.cancelBubble=!0;a.cancel=!0;return a.returnValue=!1};this.stopPropagation=function(a){a=a.original?a.original:a?a:window.event||!1;if(!a)return!1;if(a.stopPropagation)return a.stopPropagation();a.cancelBubble&&(a.cancelBubble=!0);return!1};this.showRail=function(){if(0!=a.page.maxh&&(a.ispage||"none"!=a.win.css("display")))a.visibility=!0,1292a.rail.visibility=!0,a.rail.css("display","block");return a};this.showRailHr=function(){if(!a.railh)return a;if(0!=a.page.maxw&&(a.ispage||"none"!=a.win.css("display")))a.railh.visibility=!0,a.railh.css("display","block");return a};this.hideRail=function(){a.visibility=!1;a.rail.visibility=!1;a.rail.css("display","none");return a};this.hideRailHr=function(){if(!a.railh)return a;a.railh.visibility=!1;a.railh.css("display","none");return a};this.show=function(){a.hidden=!1;a.locked=!1;return a.showRail().showRailHr()};1293this.hide=function(){a.hidden=!0;a.locked=!0;return a.hideRail().hideRailHr()};this.toggle=function(){return a.hidden?a.show():a.hide()};this.remove=function(){a.stop();a.cursortimeout&&clearTimeout(a.cursortimeout);a.doZoomOut();a.unbindAll();d.isie9&&a.win[0].detachEvent("onpropertychange",a.onAttributeChange);!1!==a.observer&&a.observer.disconnect();!1!==a.observerremover&&a.observerremover.disconnect();a.events=null;a.cursor&&a.cursor.remove();a.cursorh&&a.cursorh.remove();a.rail&&a.rail.remove();1294a.railh&&a.railh.remove();a.zoom&&a.zoom.remove();for(var c=0;c<a.saved.css.length;c++){var b=a.saved.css[c];b[0].css(b[1],"undefined"==typeof b[2]?"":b[2])}a.saved=!1;a.me.data("__nicescroll","");var f=e.nicescroll;f.each(function(c){if(this&&this.id===a.id){delete f[c];for(var b=++c;b<f.length;b++,c++)f[c]=f[b];f.length--;f.length&&delete f[f.length]}});for(var h in a)a[h]=null,delete a[h];a=null};this.scrollstart=function(c){this.onscrollstart=c;return a};this.scrollend=function(c){this.onscrollend=1295c;return a};this.scrollcancel=function(c){this.onscrollcancel=c;return a};this.zoomin=function(c){this.onzoomin=c;return a};this.zoomout=function(c){this.onzoomout=c;return a};this.isScrollable=function(a){a=a.target?a.target:a;if("OPTION"==a.nodeName)return!0;for(;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var b=e(a),b=b.css("overflowY")||b.css("overflowX")||b.css("overflow")||"";if(/scroll|auto/.test(b))return a.clientHeight!=a.scrollHeight;a=a.parentNode?a.parentNode:!1}return!1};this.getViewport=1296function(a){for(a=a&&a.parentNode?a.parentNode:!1;a&&1==a.nodeType&&!/^BODY|HTML/.test(a.nodeName);){var b=e(a);if(/fixed|absolute/.test(b.css("position")))return b;var f=b.css("overflowY")||b.css("overflowX")||b.css("overflow")||"";if(/scroll|auto/.test(f)&&a.clientHeight!=a.scrollHeight||0<b.getNiceScroll().length)return b;a=a.parentNode?a.parentNode:!1}return a?e(a):!1};this.triggerScrollEnd=function(){if(a.onscrollend){var c=a.getScrollLeft(),b=a.getScrollTop();a.onscrollend.call(a,{type:"scrollend",1297current:{x:c,y:b},end:{x:c,y:b}})}};this.onmousewheel=function(c){if(!a.wheelprevented){if(a.locked)return a.debounced("checkunlock",a.resize,250),!0;if(a.rail.drag)return a.cancelEvent(c);"auto"==a.opt.oneaxismousemode&&0!=c.deltaX&&(a.opt.oneaxismousemode=!1);if(a.opt.oneaxismousemode&&0==c.deltaX&&!a.rail.scrollable)return a.railh&&a.railh.scrollable?a.onmousewheelhr(c):!0;var b=+new Date,f=!1;a.opt.preservenativescrolling&&a.checkarea+600<b&&(a.nativescrollingarea=a.isScrollable(c),f=!0);a.checkarea=1298b;if(a.nativescrollingarea)return!0;if(c=q(c,!1,f))a.checkarea=0;return c}};this.onmousewheelhr=function(c){if(!a.wheelprevented){if(a.locked||!a.railh.scrollable)return!0;if(a.rail.drag)return a.cancelEvent(c);var b=+new Date,f=!1;a.opt.preservenativescrolling&&a.checkarea+600<b&&(a.nativescrollingarea=a.isScrollable(c),f=!0);a.checkarea=b;return a.nativescrollingarea?!0:a.locked?a.cancelEvent(c):q(c,!0,f)}};this.stop=function(){a.cancelScroll();a.scrollmon&&a.scrollmon.stop();a.cursorfreezed=!1;1299a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.noticeCursor();return a};this.getTransitionSpeed=function(b){var d=Math.round(10*a.opt.scrollspeed);b=Math.min(d,Math.round(b/20*a.opt.scrollspeed));return 20<b?b:0};a.opt.smoothscroll?a.ishwscroll&&d.hastransition&&a.opt.usetransition?(this.prepareTransition=function(b,e){var f=e?20<b?b:0:a.getTransitionSpeed(b),h=f?d.prefixstyle+"transform "+f+"ms ease-out":"";if(!a.lasttransitionstyle||a.lasttransitionstyle!=h)a.lasttransitionstyle=1300h,a.doc.css(d.transitionstyle,h);return f},this.doScrollLeft=function(b,d){var f=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,f,d)},this.doScrollTop=function(b,d){var f=a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(f,b,d)},this.doScrollPos=function(b,e,f){var h=a.getScrollTop(),g=a.getScrollLeft();(0>(a.newscrolly-h)*(e-h)||0>(a.newscrollx-g)*(b-g))&&a.cancelScroll();!1==a.opt.bouncescroll&&(0>e?e=0:e>a.page.maxh&&(e=a.page.maxh),0>b?b=0:b>a.page.maxw&&(b=a.page.maxw));1301if(a.scrollrunning&&b==a.newscrollx&&e==a.newscrolly)return!1;a.newscrolly=e;a.newscrollx=b;a.newscrollspeed=f||!1;if(a.timer)return!1;a.timer=setTimeout(function(){var f=a.getScrollTop(),h=a.getScrollLeft(),g,k;g=b-h;k=e-f;g=Math.round(Math.sqrt(Math.pow(g,2)+Math.pow(k,2)));g=a.newscrollspeed&&1<a.newscrollspeed?a.newscrollspeed:a.getTransitionSpeed(g);a.newscrollspeed&&1>=a.newscrollspeed&&(g*=a.newscrollspeed);a.prepareTransition(g,!0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);13020<g&&(!a.scrollrunning&&a.onscrollstart&&a.onscrollstart.call(a,{type:"scrollstart",current:{x:h,y:f},request:{x:b,y:e},end:{x:a.newscrollx,y:a.newscrolly},speed:g}),d.transitionend?a.scrollendtrapped||(a.scrollendtrapped=!0,a.bind(a.doc,d.transitionend,a.onScrollTransitionEnd,!1)):(a.scrollendtrapped&&clearTimeout(a.scrollendtrapped),a.scrollendtrapped=setTimeout(a.onScrollTransitionEnd,g)),a.timerscroll={bz:new BezierClass(f,a.newscrolly,g,0,0,0.58,1),bh:new BezierClass(h,a.newscrollx,g,0,0,0.58,13031)},a.cursorfreezed||(a.timerscroll.tm=setInterval(function(){a.showCursor(a.getScrollTop(),a.getScrollLeft())},60)));a.synched("doScroll-set",function(){a.timer=0;a.scrollendtrapped&&(a.scrollrunning=!0);a.setScrollTop(a.newscrolly);a.setScrollLeft(a.newscrollx);if(!a.scrollendtrapped)a.onScrollTransitionEnd()})},50)},this.cancelScroll=function(){if(!a.scrollendtrapped)return!0;var b=a.getScrollTop(),e=a.getScrollLeft();a.scrollrunning=!1;d.transitionend||clearTimeout(d.transitionend);a.scrollendtrapped=1304!1;a._unbind(a.doc,d.transitionend,a.onScrollTransitionEnd);a.prepareTransition(0);a.setScrollTop(b);a.railh&&a.setScrollLeft(e);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;a.cursorfreezed=!1;a.showCursor(b,e);return a},this.onScrollTransitionEnd=function(){a.scrollendtrapped&&a._unbind(a.doc,d.transitionend,a.onScrollTransitionEnd);a.scrollendtrapped=!1;a.prepareTransition(0);a.timerscroll&&a.timerscroll.tm&&clearInterval(a.timerscroll.tm);a.timerscroll=!1;var b=1305a.getScrollTop(),e=a.getScrollLeft();a.setScrollTop(b);a.railh&&a.setScrollLeft(e);a.noticeCursor(!1,b,e);a.cursorfreezed=!1;0>b?b=0:b>a.page.maxh&&(b=a.page.maxh);0>e?e=0:e>a.page.maxw&&(e=a.page.maxw);if(b!=a.newscrolly||e!=a.newscrollx)return a.doScrollPos(e,b,a.opt.snapbackspeed);a.onscrollend&&a.scrollrunning&&a.triggerScrollEnd();a.scrollrunning=!1}):(this.doScrollLeft=function(b,d){var f=a.scrollrunning?a.newscrolly:a.getScrollTop();a.doScrollPos(b,f,d)},this.doScrollTop=function(b,d){var f=1306a.scrollrunning?a.newscrollx:a.getScrollLeft();a.doScrollPos(f,b,d)},this.doScrollPos=function(b,d,f){function e(){if(a.cancelAnimationFrame)return!0;a.scrollrunning=!0;if(p=1-p)return a.timer=s(e)||1;var b=0,c=sy=a.getScrollTop();if(a.dst.ay){var c=a.bzscroll?a.dst.py+a.bzscroll.getNow()*a.dst.ay:a.newscrolly,f=c-sy;if(0>f&&c<a.newscrolly||0<f&&c>a.newscrolly)c=a.newscrolly;a.setScrollTop(c);c==a.newscrolly&&(b=1)}else b=1;var d=sx=a.getScrollLeft();if(a.dst.ax){d=a.bzscroll?a.dst.px+a.bzscroll.getNow()*1307a.dst.ax:a.newscrollx;f=d-sx;if(0>f&&d<a.newscrollx||0<f&&d>a.newscrollx)d=a.newscrollx;a.setScrollLeft(d);d==a.newscrollx&&(b+=1)}else b+=1;2==b?(a.timer=0,a.cursorfreezed=!1,a.bzscroll=!1,a.scrollrunning=!1,0>c?c=0:c>a.page.maxh&&(c=a.page.maxh),0>d?d=0:d>a.page.maxw&&(d=a.page.maxw),d!=a.newscrollx||c!=a.newscrolly?a.doScrollPos(d,c):a.onscrollend&&a.triggerScrollEnd()):a.timer=s(e)||1}d="undefined"==typeof d||!1===d?a.getScrollTop(!0):d;if(a.timer&&a.newscrolly==d&&a.newscrollx==b)return!0;a.timer&&1308v(a.timer);a.timer=0;var h=a.getScrollTop(),g=a.getScrollLeft();(0>(a.newscrolly-h)*(d-h)||0>(a.newscrollx-g)*(b-g))&&a.cancelScroll();a.newscrolly=d;a.newscrollx=b;if(!a.bouncescroll||!a.rail.visibility)0>a.newscrolly?a.newscrolly=0:a.newscrolly>a.page.maxh&&(a.newscrolly=a.page.maxh);if(!a.bouncescroll||!a.railh.visibility)0>a.newscrollx?a.newscrollx=0:a.newscrollx>a.page.maxw&&(a.newscrollx=a.page.maxw);a.dst={};a.dst.x=b-g;a.dst.y=d-h;a.dst.px=g;a.dst.py=h;var k=Math.round(Math.sqrt(Math.pow(a.dst.x,13092)+Math.pow(a.dst.y,2)));a.dst.ax=a.dst.x/k;a.dst.ay=a.dst.y/k;var l=0,q=k;0==a.dst.x?(l=h,q=d,a.dst.ay=1,a.dst.py=0):0==a.dst.y&&(l=g,q=b,a.dst.ax=1,a.dst.px=0);k=a.getTransitionSpeed(k);f&&1>=f&&(k*=f);a.bzscroll=0<k?a.bzscroll?a.bzscroll.update(q,k):new BezierClass(l,q,k,0,1,0,1):!1;if(!a.timer){(h==a.page.maxh&&d>=a.page.maxh||g==a.page.maxw&&b>=a.page.maxw)&&a.checkContentSize();var p=1;a.cancelAnimationFrame=!1;a.timer=1;a.onscrollstart&&!a.scrollrunning&&a.onscrollstart.call(a,{type:"scrollstart",1310current:{x:g,y:h},request:{x:b,y:d},end:{x:a.newscrollx,y:a.newscrolly},speed:k});e();(h==a.page.maxh&&d>=h||g==a.page.maxw&&b>=g)&&a.checkContentSize();a.noticeCursor()}},this.cancelScroll=function(){a.timer&&v(a.timer);a.timer=0;a.bzscroll=!1;a.scrollrunning=!1;return a}):(this.doScrollLeft=function(b,d){var f=a.getScrollTop();a.doScrollPos(b,f,d)},this.doScrollTop=function(b,d){var f=a.getScrollLeft();a.doScrollPos(f,b,d)},this.doScrollPos=function(b,d,f){var e=b>a.page.maxw?a.page.maxw:b;0>e&&1311(e=0);var h=d>a.page.maxh?a.page.maxh:d;0>h&&(h=0);a.synched("scroll",function(){a.setScrollTop(h);a.setScrollLeft(e)})},this.cancelScroll=function(){});this.doScrollBy=function(b,d){var f=0,f=d?Math.floor((a.scroll.y-b)*a.scrollratio.y):(a.timer?a.newscrolly:a.getScrollTop(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.h/2);f<-e?f=-e:f>a.page.maxh+e&&(f=a.page.maxh+e)}a.cursorfreezed=!1;py=a.getScrollTop(!0);if(0>f&&0>=py)return a.noticeCursor();if(f>a.page.maxh&&py>=a.page.maxh)return a.checkContentSize(),1312a.noticeCursor();a.doScrollTop(f)};this.doScrollLeftBy=function(b,d){var f=0,f=d?Math.floor((a.scroll.x-b)*a.scrollratio.x):(a.timer?a.newscrollx:a.getScrollLeft(!0))-b;if(a.bouncescroll){var e=Math.round(a.view.w/2);f<-e?f=-e:f>a.page.maxw+e&&(f=a.page.maxw+e)}a.cursorfreezed=!1;px=a.getScrollLeft(!0);if(0>f&&0>=px||f>a.page.maxw&&px>=a.page.maxw)return a.noticeCursor();a.doScrollLeft(f)};this.doScrollTo=function(b,d){d&&Math.round(b*a.scrollratio.y);a.cursorfreezed=!1;a.doScrollTop(b)};this.checkContentSize=1313function(){var b=a.getContentSize();(b.h!=a.page.h||b.w!=a.page.w)&&a.resize(!1,b)};a.onscroll=function(b){a.rail.drag||a.cursorfreezed||a.synched("scroll",function(){a.scroll.y=Math.round(a.getScrollTop()*(1/a.scrollratio.y));a.railh&&(a.scroll.x=Math.round(a.getScrollLeft()*(1/a.scrollratio.x)));a.noticeCursor()})};a.bind(a.docscroll,"scroll",a.onscroll);this.doZoomIn=function(b){if(!a.zoomactive){a.zoomactive=!0;a.zoomrestore={style:{}};var h="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),1314f=a.win[0].style,g;for(g in h){var k=h[g];a.zoomrestore.style[k]="undefined"!=typeof f[k]?f[k]:""}a.zoomrestore.style.width=a.win.css("width");a.zoomrestore.style.height=a.win.css("height");a.zoomrestore.padding={w:a.win.outerWidth()-a.win.width(),h:a.win.outerHeight()-a.win.height()};d.isios4&&(a.zoomrestore.scrollTop=e(window).scrollTop(),e(window).scrollTop(0));a.win.css({position:d.isios4?"absolute":"fixed",top:0,left:0,"z-index":x+100,margin:"0px"});h=a.win.css("backgroundColor");(""==h||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(h))&&1315a.win.css("backgroundColor","#fff");a.rail.css({"z-index":x+101});a.zoom.css({"z-index":x+102});a.zoom.css("backgroundPosition","0px -18px");a.resizeZoom();a.onzoomin&&a.onzoomin.call(a);return a.cancelEvent(b)}};this.doZoomOut=function(b){if(a.zoomactive)return a.zoomactive=!1,a.win.css("margin",""),a.win.css(a.zoomrestore.style),d.isios4&&e(window).scrollTop(a.zoomrestore.scrollTop),a.rail.css({"z-index":a.zindex}),a.zoom.css({"z-index":a.zindex}),a.zoomrestore=!1,a.zoom.css("backgroundPosition",1316"0px 0px"),a.onResize(),a.onzoomout&&a.onzoomout.call(a),a.cancelEvent(b)};this.doZoom=function(b){return a.zoomactive?a.doZoomOut(b):a.doZoomIn(b)};this.resizeZoom=function(){if(a.zoomactive){var b=a.getScrollTop();a.win.css({width:e(window).width()-a.zoomrestore.padding.w+"px",height:e(window).height()-a.zoomrestore.padding.h+"px"});a.onResize();a.setScrollTop(Math.min(a.page.maxh,b))}};this.init();e.nicescroll.push(this)},H=function(e){var b=this;this.nc=e;this.steptime=this.lasttime=this.speedy=1317this.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,g){b.stop();var l=b.time();b.steptime=0;b.lasttime=l;b.speedx=0;b.speedy=0;b.lastx=e;b.lasty=g;b.lastscrollx=-1;b.lastscrolly=-1};this.update=function(e,g){var l=b.time();b.steptime=l-b.lasttime;b.lasttime=l;var l=g-b.lasty,q=e-b.lastx,a=b.nc.getScrollTop(),p=b.nc.getScrollLeft(),a=a+1318l,p=p+q;b.snapx=0>p||p>b.nc.page.maxw;b.snapy=0>a||a>b.nc.page.maxh;b.speedx=q;b.speedy=l;b.lastx=e;b.lasty=g};this.stop=function(){b.nc.unsynched("domomentum2d");b.timer&&clearTimeout(b.timer);b.timer=0;b.lastscrollx=-1;b.lastscrolly=-1};this.doSnapy=function(e,g){var l=!1;0>g?(g=0,l=!0):g>b.nc.page.maxh&&(g=b.nc.page.maxh,l=!0);0>e?(e=0,l=!0):e>b.nc.page.maxw&&(e=b.nc.page.maxw,l=!0);l?b.nc.doScrollPos(e,g,b.nc.opt.snapbackspeed):b.nc.triggerScrollEnd()};this.doMomentum=function(e){var g=b.time(),1319l=e?g+e:b.lasttime;e=b.nc.getScrollLeft();var q=b.nc.getScrollTop(),a=b.nc.page.maxh,p=b.nc.page.maxw;b.speedx=0<p?Math.min(60,b.speedx):0;b.speedy=0<a?Math.min(60,b.speedy):0;l=l&&60>=g-l;if(0>q||q>a||0>e||e>p)l=!1;e=b.speedx&&l?b.speedx:!1;if(b.speedy&&l&&b.speedy||e){var d=Math.max(16,b.steptime);50<d&&(e=d/50,b.speedx*=e,b.speedy*=e,d=50);b.demulxy=0;b.lastscrollx=b.nc.getScrollLeft();b.chkx=b.lastscrollx;b.lastscrolly=b.nc.getScrollTop();b.chky=b.lastscrolly;var r=b.lastscrollx,t=b.lastscrolly,1320s=function(){var c=600<b.time()-g?0.04:0.02;if(b.speedx&&(r=Math.floor(b.lastscrollx-b.speedx*(1-b.demulxy)),b.lastscrollx=r,0>r||r>p))c=0.1;if(b.speedy&&(t=Math.floor(b.lastscrolly-b.speedy*(1-b.demulxy)),b.lastscrolly=t,0>t||t>a))c=0.1;b.demulxy=Math.min(1,b.demulxy+c);b.nc.synched("domomentum2d",function(){b.speedx&&(b.nc.getScrollLeft()!=b.chkx&&b.stop(),b.chkx=r,b.nc.setScrollLeft(r));b.speedy&&(b.nc.getScrollTop()!=b.chky&&b.stop(),b.chky=t,b.nc.setScrollTop(t));b.timer||(b.nc.hideCursor(),1321b.doSnapy(r,t))});1>b.demulxy?b.timer=setTimeout(s,d):(b.stop(),b.nc.hideCursor(),b.doSnapy(r,t))};s()}else b.doSnapy(b.nc.getScrollLeft(),b.nc.getScrollTop())}},w=e.fn.scrollTop;e.cssHooks.pageYOffset={get:function(g,b,h){return(b=e.data(g,"__nicescroll")||!1)&&b.ishwscroll?b.getScrollTop():w.call(g)},set:function(g,b){var h=e.data(g,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollTop(parseInt(b)):w.call(g,b);return this}};e.fn.scrollTop=function(g){if("undefined"==typeof g){var b=this[0]?e.data(this[0],1322"__nicescroll")||!1:!1;return b&&b.ishwscroll?b.getScrollTop():w.call(this)}return this.each(function(){var b=e.data(this,"__nicescroll")||!1;b&&b.ishwscroll?b.setScrollTop(parseInt(g)):w.call(e(this),g)})};var A=e.fn.scrollLeft;e.cssHooks.pageXOffset={get:function(g,b,h){return(b=e.data(g,"__nicescroll")||!1)&&b.ishwscroll?b.getScrollLeft():A.call(g)},set:function(g,b){var h=e.data(g,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollLeft(parseInt(b)):A.call(g,b);return this}};e.fn.scrollLeft=function(g){if("undefined"==1323typeof g){var b=this[0]?e.data(this[0],"__nicescroll")||!1:!1;return b&&b.ishwscroll?b.getScrollLeft():A.call(this)}return this.each(function(){var b=e.data(this,"__nicescroll")||!1;b&&b.ishwscroll?b.setScrollLeft(parseInt(g)):A.call(e(this),g)})};var B=function(g){var b=this;this.length=0;this.name="nicescrollarray";this.each=function(e){for(var g=0,a=0;g<b.length;g++)e.call(b[g],a++);return b};this.push=function(e){b[b.length]=e;b.length++};this.eq=function(e){return b[e]};if(g)for(var h=0;h<g.length;h++){var k=1324e.data(g[h],"__nicescroll")||!1;k&&(this[this.length]=k,this.length++)}return this};(function(e,b,h){for(var k=0;k<b.length;k++)h(e,b[k])})(B.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(e,b){e[b]=function(){var e=arguments;return this.each(function(){this[b].apply(this,e)})}});e.fn.getNiceScroll=function(g){return"undefined"==typeof g?new B(this):this[g]&&e.data(this[g],"__nicescroll")||!1};e.extend(e.expr[":"],{nicescroll:function(g){return e.data(g,"__nicescroll")?1325!0:!1}});e.fn.niceScroll=function(g,b){"undefined"==typeof b&&("object"==typeof g&&!("jquery"in g))&&(b=g,g=!1);var h=new B;"undefined"==typeof b&&(b={});g&&(b.doc=e(g),b.win=e(this));var k=!("doc"in b);!k&&!("win"in b)&&(b.win=e(this));this.each(function(){var g=e(this).data("__nicescroll")||!1;g||(b.doc=k?e(this):b.doc,g=new N(b,e(this)),e(this).data("__nicescroll",g));h.push(g)});return 1==h.length?h[0]:h};window.NiceScroll={getjQuery:function(){return e}};e.nicescroll||(e.nicescroll=new B,e.nicescroll.options=1326G)});1327132813291330133113321333/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)1334* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)1335* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.1336*1337* Version: 1.3.01338*1339*/1340(function(f){jQuery.fn.extend({slimScroll:function(h){var a=f.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},h);this.each(function(){function r(d){if(s){d=d||1341window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget||d.srcElement).closest("."+a.wrapperClass).is(b.parent())&&m(c,!0);d.preventDefault&&!k&&d.preventDefault();k||(d.returnValue=!1)}}function m(d,f,h){k=!1;var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0<d?Math.ceil(e):Math.floor(e),c.css({top:e+"px"}));l=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());1342e=l*(b[0].scrollHeight-b.outerHeight());h&&(e=d,d=e/b[0].scrollHeight*b.outerHeight(),d=Math.min(Math.max(d,0),g),c.css({top:d+"px"}));b.scrollTop(e);b.trigger("slimscrolling",~~e);v();p()}function C(){window.addEventListener?(this.addEventListener("DOMMouseScroll",r,!1),this.addEventListener("mousewheel",r,!1),this.addEventListener("MozMousePixelScroll",r,!1)):document.attachEvent("onmousewheel",r)}function w(){u=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),D);c.css({height:u+"px"});1343var a=u==b.outerHeight()?"none":"block";c.css({display:a})}function v(){w();clearTimeout(A);l==~~l?(k=a.allowPageScroll,B!=l&&b.trigger("slimscroll",0==~~l?"top":"bottom")):k=!1;B=l;u>=b.outerHeight()?k=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&g.stop(!0,!0).fadeIn("fast"))}function p(){a.alwaysVisible||(A=setTimeout(function(){a.disableFadeOut&&s||(x||y)||(c.fadeOut("slow"),g.fadeOut("slow"))},1E3))}var s,x,y,A,z,u,l,B,D=30,k=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var n=b.scrollTop(),1344c=b.parent().find("."+a.barClass),g=b.parent().find("."+a.railClass);w();if(f.isPlainObject(h)){if("height"in h&&"auto"==h.height){b.parent().css("height","auto");b.css("height","auto");var q=b.parent().parent().height();b.parent().css("height",q);b.css("height",q)}if("scrollTo"in h)n=parseInt(a.scrollTo);else if("scrollBy"in h)n+=parseInt(a.scrollBy);else if("destroy"in h){c.remove();g.remove();b.unwrap();return}m(n,!1,!0)}}else{a.height="auto"==a.height?b.parent().height():a.height;n=f("<div></div>").addClass(a.wrapperClass).css({position:"relative",1345overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var g=f("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.railBorderRadius,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("<div></div>").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?1346"block":"none","border-radius":a.borderRadius,BorderRadius:a.borderRadius,MozBorderRadius:a.borderRadius,WebkitBorderRadius:a.borderRadius,zIndex:99}),q="right"==a.position?{right:a.distance}:{left:a.distance};g.css(q);c.css(q);b.wrap(n);b.parent().append(c);b.parent().append(g);a.railDraggable&&c.bind("mousedown",function(a){var b=f(document);y=!0;t=parseFloat(c.css("top"));pageY=a.pageY;b.bind("mousemove.slimscroll",function(a){currTop=t+a.pageY-pageY;c.css("top",currTop);m(0,c.position().top,!1)});1347b.bind("mouseup.slimscroll",function(a){y=!1;p();b.unbind(".slimscroll")});return!1}).bind("selectstart.slimscroll",function(a){a.stopPropagation();a.preventDefault();return!1});g.hover(function(){v()},function(){p()});c.hover(function(){x=!0},function(){x=!1});b.hover(function(){s=!0;v();p()},function(){s=!1;p()});b.bind("touchstart",function(a,b){a.originalEvent.touches.length&&(z=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){k||b.originalEvent.preventDefault();b.originalEvent.touches.length&&1348(m((z-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0),z=b.originalEvent.touches[0].pageY)});w();"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),m(0,!0)):"top"!==a.start&&(m(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());C()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);134913501351/*!1352* jQuery Transit - CSS3 transitions and transformations1353* (c) 2011-2012 Rico Sta. Cruz <[email protected]>1354* MIT Licensed.1355*1356* http://ricostacruz.com/jquery.transit1357* http://github.com/rstacruz/jquery.transit1358*/1359(function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t<u.length;++t){var s=u[t]+r;if(s in d.style){return s}}}function e(){d.style[q.transform]="";d.style[q.transform]="rotateY(90deg)";return d.style[q.transform]!==""}var a=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery);1360136113621363/*1364* jQuery UI Touch Punch 0.2.21365*1366* Copyright 2011, Dave Furfero1367* Dual licensed under the MIT or GPL Version 2 licenses.1368*1369* Depends:1370* jquery.ui.widget.js1371* jquery.ui.mouse.js1372*/1373(function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return;}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return;}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f);}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return;}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown");};c._touchMove=function(f){if(!a){return;}this._touchMoved=true;d(f,"mousemove");};c._touchEnd=function(f){if(!a){return;}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click");}a=false;};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f);};})(jQuery);1374137513761377})(jQuery, window);1378137913801381138213831384/**1385* @preserve Copyright 2012 Twitter, Inc.1386* @license http://www.apache.org/licenses/LICENSE-2.0.txt1387*/1388var Hogan={};(function(a,b){function i(a){return String(a===null||a===undefined?"":a)}function j(a){return a=i(a),h.test(a)?a.replace(c,"&").replace(d,"<").replace(e,">").replace(f,"'").replace(g,"""):a}a.Template=function(a,c,d,e){this.r=a||this.r,this.c=d,this.options=e,this.text=c||"",this.buf=b?[]:""},a.Template.prototype={r:function(a,b,c){return""},v:j,t:i,render:function(b,c,d){return this.ri([b],c||{},d)},ri:function(a,b,c){return this.r(a,b,c)},rp:function(a,b,c,d){var e=c[a];return e?(this.c&&typeof e=="string"&&(e=this.c.compile(e,this.options)),e.ri(b,c,d)):""},rs:function(a,b,c){var d=a[a.length-1];if(!k(d)){c(a,b,this);return}for(var e=0;e<d.length;e++)a.push(d[e]),c(a,b,this),a.pop()},s:function(a,b,c,d,e,f,g){var h;return k(a)&&a.length===0?!1:(typeof a=="function"&&(a=this.ls(a,b,c,d,e,f,g)),h=a===""||!!a,!d&&h&&b&&b.push(typeof a=="object"?a:b[b.length-1]),h)},d:function(a,b,c,d){var e=a.split("."),f=this.f(e[0],b,c,d),g=null;if(a==="."&&k(b[b.length-2]))return b[b.length-1];for(var h=1;h<e.length;h++)f&&typeof f=="object"&&e[h]in f?(g=f,f=f[e[h]]):f="";return d&&!f?!1:(!d&&typeof f=="function"&&(b.push(g),f=this.lv(f,b,c),b.pop()),f)},f:function(a,b,c,d){var e=!1,f=null,g=!1;for(var h=b.length-1;h>=0;h--){f=b[h];if(f&&typeof f=="object"&&a in f){e=f[a],g=!0;break}}return g?(!d&&typeof e=="function"&&(e=this.lv(e,b,c)),e):d?!1:""},ho:function(a,b,c,d,e){var f=this.c,g=this.options;g.delimiters=e;var d=a.call(b,d);return d=d==null?String(d):d.toString(),this.b(f.compile(d,g).render(b,c)),!1},b:b?function(a){this.buf.push(a)}:function(a){this.buf+=a},fl:b?function(){var a=this.buf.join("");return this.buf=[],a}:function(){var a=this.buf;return this.buf="",a},ls:function(a,b,c,d,e,f,g){var h=b[b.length-1],i=null;if(!d&&this.c&&a.length>0)return this.ho(a,h,c,this.text.substring(e,f),g);i=a.call(h);if(typeof i=="function"){if(d)return!0;if(this.c)return this.ho(i,h,c,this.text.substring(e,f),g)}return i},lv:function(a,b,c){var d=b[b.length-1],e=a.call(d);if(typeof e=="function"){e=i(e.call(d));if(this.c&&~e.indexOf("{{"))return this.c.compile(e,this.options).render(d,c)}return i(e)}};var c=/&/g,d=/</g,e=/>/g,f=/\'/g,g=/\"/g,h=/[&<>\"\']/,k=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}})(typeof exports!="undefined"?exports:Hogan),function(a){function h(a){a.n.substr(a.n.length-1)==="}"&&(a.n=a.n.substring(0,a.n.length-1))}function i(a){return a.trim?a.trim():a.replace(/^\s*|\s*$/g,"")}function j(a,b,c){if(b.charAt(c)!=a.charAt(0))return!1;for(var d=1,e=a.length;d<e;d++)if(b.charAt(c+d)!=a.charAt(d))return!1;return!0}function k(a,b,c,d){var e=[],f=null,g=null;while(a.length>0){g=a.shift();if(g.tag=="#"||g.tag=="^"||l(g,d))c.push(g),g.nodes=k(a,g.tag,c,d),e.push(g);else{if(g.tag=="/"){if(c.length===0)throw new Error("Closing tag without opener: /"+g.n);f=c.pop();if(g.n!=f.n&&!m(g.n,f.n,d))throw new Error("Nesting error: "+f.n+" vs. "+g.n);return f.end=g.i,e}e.push(g)}}if(c.length>0)throw new Error("missing closing tag: "+c.pop().n);return e}function l(a,b){for(var c=0,d=b.length;c<d;c++)if(b[c].o==a.n)return a.tag="#",!0}function m(a,b,c){for(var d=0,e=c.length;d<e;d++)if(c[d].c==a&&c[d].o==b)return!0}function n(a){return a.replace(f,"\\\\").replace(c,'\\"').replace(d,"\\n").replace(e,"\\r")}function o(a){return~a.indexOf(".")?"d":"f"}function p(a){var b="";for(var c=0,d=a.length;c<d;c++){var e=a[c].tag;e=="#"?b+=q(a[c].nodes,a[c].n,o(a[c].n),a[c].i,a[c].end,a[c].otag+" "+a[c].ctag):e=="^"?b+=r(a[c].nodes,a[c].n,o(a[c].n)):e=="<"||e==">"?b+=s(a[c]):e=="{"||e=="&"?b+=t(a[c].n,o(a[c].n)):e=="\n"?b+=v('"\\n"'+(a.length-1==c?"":" + i")):e=="_v"?b+=u(a[c].n,o(a[c].n)):e===undefined&&(b+=v('"'+n(a[c])+'"'))}return b}function q(a,b,c,d,e,f){return"if(_.s(_."+c+'("'+n(b)+'",c,p,1),'+"c,p,0,"+d+","+e+',"'+f+'")){'+"_.rs(c,p,"+"function(c,p,_){"+p(a)+"});c.pop();}"}function r(a,b,c){return"if(!_.s(_."+c+'("'+n(b)+'",c,p,1),c,p,1,0,0,"")){'+p(a)+"};"}function s(a){return'_.b(_.rp("'+n(a.n)+'",c,p,"'+(a.indent||"")+'"));'}function t(a,b){return"_.b(_.t(_."+b+'("'+n(a)+'",c,p,0)));'}function u(a,b){return"_.b(_.v(_."+b+'("'+n(a)+'",c,p,0)));'}function v(a){return"_.b("+a+");"}var b=/\S/,c=/\"/g,d=/\n/g,e=/\r/g,f=/\\/g,g={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};a.scan=function(c,d){function w(){p.length>0&&(q.push(new String(p)),p="")}function x(){var a=!0;for(var c=t;c<q.length;c++){a=q[c].tag&&g[q[c].tag]<g._v||!q[c].tag&&q[c].match(b)===null;if(!a)return!1}return a}function y(a,b){w();if(a&&x())for(var c=t,d;c<q.length;c++)q[c].tag||((d=q[c+1])&&d.tag==">"&&(d.indent=q[c].toString()),q.splice(c,1));else b||q.push({tag:"\n"});r=!1,t=q.length}function z(a,b){var c="="+v,d=a.indexOf(c,b),e=i(a.substring(a.indexOf("=",b)+1,d)).split(" ");return u=e[0],v=e[1],d+c.length-1}var e=c.length,f=0,k=1,l=2,m=f,n=null,o=null,p="",q=[],r=!1,s=0,t=0,u="{{",v="}}";d&&(d=d.split(" "),u=d[0],v=d[1]);for(s=0;s<e;s++)m==f?j(u,c,s)?(--s,w(),m=k):c.charAt(s)=="\n"?y(r):p+=c.charAt(s):m==k?(s+=u.length-1,o=g[c.charAt(s+1)],n=o?c.charAt(s+1):"_v",n=="="?(s=z(c,s),m=f):(o&&s++,m=l),r=s):j(v,c,s)?(q.push({tag:n,n:i(p),otag:u,ctag:v,i:n=="/"?r-v.length:s+u.length}),p="",s+=v.length-1,m=f,n=="{"&&(v=="}}"?s++:h(q[q.length-1]))):p+=c.charAt(s);return y(r,!0),q},a.generate=function(b,c,d){var e='var _=this;_.b(i=i||"");'+p(b)+"return _.fl();";return d.asString?"function(c,p,i){"+e+";}":new a.Template(new Function("c","p","i",e),c,a,d)},a.parse=function(a,b,c){return c=c||{},k(a,"",[],c.sectionTags||[])},a.cache={},a.compile=function(a,b){b=b||{};var c=a+"||"+!!b.asString,d=this.cache[c];return d?d:(d=this.generate(this.parse(this.scan(a,b.delimiters),a,b),a,b),this.cache[c]=d)}}(typeof exports!="undefined"?exports:Hogan);1389139013911392139313941395/* Copyright (c) 2012, 2014 Hyunje Alex Jun and other contributors1396* Licensed under the MIT License1397*/1398(function (factory) {1399'use strict';14001401if (typeof define === 'function' && define.amd) {1402// AMD. Register as an anonymous module.1403define(['jquery'], factory);1404} else if (typeof exports === 'object') {1405// Node/CommonJS1406factory(require('jquery'));1407} else {1408// Browser globals1409factory(jQuery);1410}1411})(function ($) {1412'use strict';14131414function getInt(x) {1415if (typeof x === 'string') {1416return parseInt(x, 10);1417} else {1418return ~~x;1419}1420}14211422var defaultSettings = {1423wheelSpeed: 1,1424wheelPropagation: false,1425swipePropagation: true,1426minScrollbarLength: null,1427maxScrollbarLength: null,1428useBothWheelAxes: false,1429useKeyboard: true,1430suppressScrollX: false,1431suppressScrollY: false,1432scrollXMarginOffset: 0,1433scrollYMarginOffset: 0,1434includePadding: false1435};14361437var incrementingId = 0;1438var eventClassFactory = function () {1439var id = incrementingId++;1440return function (eventName) {1441var className = '.perfect-scrollbar-' + id;1442if (typeof eventName === 'undefined') {1443return className;1444} else {1445return eventName + className;1446}1447};1448};14491450var isWebkit = 'WebkitAppearance' in document.documentElement.style;14511452$.fn.perfectScrollbar = function (suppliedSettings, option) {14531454return this.each(function () {1455var settings = $.extend(true, {}, defaultSettings);1456var $this = $(this);1457var isPluginAlive = function () { return !!$this; };14581459if (typeof suppliedSettings === "object") {1460// Override default settings with any supplied1461$.extend(true, settings, suppliedSettings);1462} else {1463// If no setting was supplied, then the first param must be the option1464option = suppliedSettings;1465}14661467// Catch options1468if (option === 'update') {1469if ($this.data('perfect-scrollbar-update')) {1470$this.data('perfect-scrollbar-update')();1471}1472return $this;1473}1474else if (option === 'destroy') {1475if ($this.data('perfect-scrollbar-destroy')) {1476$this.data('perfect-scrollbar-destroy')();1477}1478return $this;1479}14801481if ($this.data('perfect-scrollbar')) {1482// if there's already perfect-scrollbar1483return $this.data('perfect-scrollbar');1484}148514861487// Or generate new perfectScrollbar14881489$this.addClass('ps-container');14901491var containerWidth;1492var containerHeight;1493var contentWidth;1494var contentHeight;14951496var isRtl = $this.css('direction') === "rtl";1497var eventClass = eventClassFactory();1498var ownerDocument = this.ownerDocument || document;14991500var $scrollbarXRail = $("<div class='ps-scrollbar-x-rail'>").appendTo($this);1501var $scrollbarX = $("<div class='ps-scrollbar-x'>").appendTo($scrollbarXRail);1502var scrollbarXActive;1503var scrollbarXWidth;1504var scrollbarXLeft;1505var scrollbarXBottom = getInt($scrollbarXRail.css('bottom'));1506var isScrollbarXUsingBottom = scrollbarXBottom === scrollbarXBottom; // !isNaN1507var scrollbarXTop = isScrollbarXUsingBottom ? null : getInt($scrollbarXRail.css('top'));1508var railBorderXWidth = getInt($scrollbarXRail.css('borderLeftWidth')) + getInt($scrollbarXRail.css('borderRightWidth'));1509var railXMarginWidth = getInt($scrollbarXRail.css('marginLeft')) + getInt($scrollbarXRail.css('marginRight'));1510var railXWidth;15111512var $scrollbarYRail = $("<div class='ps-scrollbar-y-rail'>").appendTo($this);1513var $scrollbarY = $("<div class='ps-scrollbar-y'>").appendTo($scrollbarYRail);1514var scrollbarYActive;1515var scrollbarYHeight;1516var scrollbarYTop;1517var scrollbarYRight = getInt($scrollbarYRail.css('right'));1518var isScrollbarYUsingRight = scrollbarYRight === scrollbarYRight; // !isNaN1519var scrollbarYLeft = isScrollbarYUsingRight ? null : getInt($scrollbarYRail.css('left'));1520var railBorderYWidth = getInt($scrollbarYRail.css('borderTopWidth')) + getInt($scrollbarYRail.css('borderBottomWidth'));1521var railYMarginHeight = getInt($scrollbarYRail.css('marginTop')) + getInt($scrollbarYRail.css('marginBottom'));1522var railYHeight;15231524function updateScrollTop(currentTop, deltaY) {1525var newTop = currentTop + deltaY;1526var maxTop = containerHeight - scrollbarYHeight;15271528if (newTop < 0) {1529scrollbarYTop = 0;1530} else if (newTop > maxTop) {1531scrollbarYTop = maxTop;1532} else {1533scrollbarYTop = newTop;1534}15351536var scrollTop = getInt(scrollbarYTop * (contentHeight - containerHeight) / (containerHeight - scrollbarYHeight));1537$this.scrollTop(scrollTop);1538}15391540function updateScrollLeft(currentLeft, deltaX) {1541var newLeft = currentLeft + deltaX;1542var maxLeft = containerWidth - scrollbarXWidth;15431544if (newLeft < 0) {1545scrollbarXLeft = 0;1546} else if (newLeft > maxLeft) {1547scrollbarXLeft = maxLeft;1548} else {1549scrollbarXLeft = newLeft;1550}15511552var scrollLeft = getInt(scrollbarXLeft * (contentWidth - containerWidth) / (containerWidth - scrollbarXWidth));1553$this.scrollLeft(scrollLeft);1554}15551556function getThumbSize(thumbSize) {1557if (settings.minScrollbarLength) {1558thumbSize = Math.max(thumbSize, settings.minScrollbarLength);1559}1560if (settings.maxScrollbarLength) {1561thumbSize = Math.min(thumbSize, settings.maxScrollbarLength);1562}1563return thumbSize;1564}15651566function updateCss() {1567var xRailOffset = {width: railXWidth};1568if (isRtl) {1569xRailOffset.left = $this.scrollLeft() + containerWidth - contentWidth;1570} else {1571xRailOffset.left = $this.scrollLeft();1572}1573if (isScrollbarXUsingBottom) {1574xRailOffset.bottom = scrollbarXBottom - $this.scrollTop();1575} else {1576xRailOffset.top = scrollbarXTop + $this.scrollTop();1577}1578$scrollbarXRail.css(xRailOffset);15791580var railYOffset = {top: $this.scrollTop(), height: railYHeight};15811582if (isScrollbarYUsingRight) {1583if (isRtl) {1584railYOffset.right = contentWidth - $this.scrollLeft() - scrollbarYRight - $scrollbarY.outerWidth();1585} else {1586railYOffset.right = scrollbarYRight - $this.scrollLeft();1587}1588} else {1589if (isRtl) {1590railYOffset.left = $this.scrollLeft() + containerWidth * 2 - contentWidth - scrollbarYLeft - $scrollbarY.outerWidth();1591} else {1592railYOffset.left = scrollbarYLeft + $this.scrollLeft();1593}1594}1595$scrollbarYRail.css(railYOffset);15961597$scrollbarX.css({left: scrollbarXLeft, width: scrollbarXWidth - railBorderXWidth});1598$scrollbarY.css({top: scrollbarYTop, height: scrollbarYHeight - railBorderYWidth});1599}16001601function updateGeometry() {1602// Hide scrollbars not to affect scrollWidth and scrollHeight1603$this.removeClass('ps-active-x');1604$this.removeClass('ps-active-y');16051606containerWidth = settings.includePadding ? $this.innerWidth() : $this.width();1607containerHeight = settings.includePadding ? $this.innerHeight() : $this.height();1608contentWidth = $this.prop('scrollWidth');1609contentHeight = $this.prop('scrollHeight');16101611if (!settings.suppressScrollX && containerWidth + settings.scrollXMarginOffset < contentWidth) {1612scrollbarXActive = true;1613railXWidth = containerWidth - railXMarginWidth;1614scrollbarXWidth = getThumbSize(getInt(railXWidth * containerWidth / contentWidth));1615scrollbarXLeft = getInt($this.scrollLeft() * (railXWidth - scrollbarXWidth) / (contentWidth - containerWidth));1616} else {1617scrollbarXActive = false;1618scrollbarXWidth = 0;1619scrollbarXLeft = 0;1620$this.scrollLeft(0);1621}16221623if (!settings.suppressScrollY && containerHeight + settings.scrollYMarginOffset < contentHeight) {1624scrollbarYActive = true;1625railYHeight = containerHeight - railYMarginHeight;1626scrollbarYHeight = getThumbSize(getInt(railYHeight * containerHeight / contentHeight));1627scrollbarYTop = getInt($this.scrollTop() * (railYHeight - scrollbarYHeight) / (contentHeight - containerHeight));1628} else {1629scrollbarYActive = false;1630scrollbarYHeight = 0;1631scrollbarYTop = 0;1632$this.scrollTop(0);1633}16341635if (scrollbarXLeft >= railXWidth - scrollbarXWidth) {1636scrollbarXLeft = railXWidth - scrollbarXWidth;1637}1638if (scrollbarYTop >= railYHeight - scrollbarYHeight) {1639scrollbarYTop = railYHeight - scrollbarYHeight;1640}16411642updateCss();16431644if (scrollbarXActive) {1645$this.addClass('ps-active-x');1646}1647if (scrollbarYActive) {1648$this.addClass('ps-active-y');1649}1650}16511652function bindMouseScrollXHandler() {1653var currentLeft;1654var currentPageX;16551656var mouseMoveHandler = function (e) {1657updateScrollLeft(currentLeft, e.pageX - currentPageX);1658updateGeometry();1659e.stopPropagation();1660e.preventDefault();1661};16621663var mouseUpHandler = function (e) {1664$scrollbarXRail.removeClass('in-scrolling');1665$(ownerDocument).unbind(eventClass('mousemove'), mouseMoveHandler);1666};16671668$scrollbarX.bind(eventClass('mousedown'), function (e) {1669currentPageX = e.pageX;1670currentLeft = $scrollbarX.position().left;1671$scrollbarXRail.addClass('in-scrolling');16721673$(ownerDocument).bind(eventClass('mousemove'), mouseMoveHandler);1674$(ownerDocument).one(eventClass('mouseup'), mouseUpHandler);16751676e.stopPropagation();1677e.preventDefault();1678});16791680currentLeft =1681currentPageX = null;1682}16831684function bindMouseScrollYHandler() {1685var currentTop;1686var currentPageY;16871688var mouseMoveHandler = function (e) {1689updateScrollTop(currentTop, e.pageY - currentPageY);1690updateGeometry();1691e.stopPropagation();1692e.preventDefault();1693};16941695var mouseUpHandler = function (e) {1696$scrollbarYRail.removeClass('in-scrolling');1697$(ownerDocument).unbind(eventClass('mousemove'), mouseMoveHandler);1698};16991700$scrollbarY.bind(eventClass('mousedown'), function (e) {1701currentPageY = e.pageY;1702currentTop = $scrollbarY.position().top;1703$scrollbarYRail.addClass('in-scrolling');17041705$(ownerDocument).bind(eventClass('mousemove'), mouseMoveHandler);1706$(ownerDocument).one(eventClass('mouseup'), mouseUpHandler);17071708e.stopPropagation();1709e.preventDefault();1710});17111712currentTop =1713currentPageY = null;1714}17151716function shouldPreventWheel(deltaX, deltaY) {1717var scrollTop = $this.scrollTop();1718if (deltaX === 0) {1719if (!scrollbarYActive) {1720return false;1721}1722if ((scrollTop === 0 && deltaY > 0) || (scrollTop >= contentHeight - containerHeight && deltaY < 0)) {1723return !settings.wheelPropagation;1724}1725}17261727var scrollLeft = $this.scrollLeft();1728if (deltaY === 0) {1729if (!scrollbarXActive) {1730return false;1731}1732if ((scrollLeft === 0 && deltaX < 0) || (scrollLeft >= contentWidth - containerWidth && deltaX > 0)) {1733return !settings.wheelPropagation;1734}1735}1736return true;1737}17381739function shouldPreventSwipe(deltaX, deltaY) {1740var scrollTop = $this.scrollTop();1741var scrollLeft = $this.scrollLeft();1742var magnitudeX = Math.abs(deltaX);1743var magnitudeY = Math.abs(deltaY);17441745if (magnitudeY > magnitudeX) {1746// user is perhaps trying to swipe up/down the page17471748if (((deltaY < 0) && (scrollTop === contentHeight - containerHeight)) ||1749((deltaY > 0) && (scrollTop === 0))) {1750return !settings.swipePropagation;1751}1752} else if (magnitudeX > magnitudeY) {1753// user is perhaps trying to swipe left/right across the page17541755if (((deltaX < 0) && (scrollLeft === contentWidth - containerWidth)) ||1756((deltaX > 0) && (scrollLeft === 0))) {1757return !settings.swipePropagation;1758}1759}17601761return true;1762}17631764function bindMouseWheelHandler() {1765var shouldPrevent = false;17661767function getDeltaFromEvent(e) {1768var deltaX = e.originalEvent.deltaX;1769var deltaY = -1 * e.originalEvent.deltaY;17701771if (typeof deltaX === "undefined" || typeof deltaY === "undefined") {1772// OS X Safari1773deltaX = -1 * e.originalEvent.wheelDeltaX / 6;1774deltaY = e.originalEvent.wheelDeltaY / 6;1775}17761777if (e.originalEvent.deltaMode && e.originalEvent.deltaMode === 1) {1778// Firefox in deltaMode 1: Line scrolling1779deltaX *= 10;1780deltaY *= 10;1781}17821783if (deltaX !== deltaX && deltaY !== deltaY/* NaN checks */) {1784// IE in some mouse drivers1785deltaX = 0;1786deltaY = e.originalEvent.wheelDelta;1787}17881789return [deltaX, deltaY];1790}17911792function mousewheelHandler(e) {1793// FIXME: this is a quick fix for the select problem in FF and IE.1794// If there comes an effective way to deal with the problem,1795// this lines should be removed.1796if (!isWebkit && $this.find('select:focus').length > 0) {1797return;1798}17991800var delta = getDeltaFromEvent(e);18011802var deltaX = delta[0];1803var deltaY = delta[1];18041805shouldPrevent = false;1806if (!settings.useBothWheelAxes) {1807// deltaX will only be used for horizontal scrolling and deltaY will1808// only be used for vertical scrolling - this is the default1809$this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));1810$this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));1811} else if (scrollbarYActive && !scrollbarXActive) {1812// only vertical scrollbar is active and useBothWheelAxes option is1813// active, so let's scroll vertical bar using both mouse wheel axes1814if (deltaY) {1815$this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed));1816} else {1817$this.scrollTop($this.scrollTop() + (deltaX * settings.wheelSpeed));1818}1819shouldPrevent = true;1820} else if (scrollbarXActive && !scrollbarYActive) {1821// useBothWheelAxes and only horizontal bar is active, so use both1822// wheel axes for horizontal bar1823if (deltaX) {1824$this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed));1825} else {1826$this.scrollLeft($this.scrollLeft() - (deltaY * settings.wheelSpeed));1827}1828shouldPrevent = true;1829}18301831updateGeometry();18321833shouldPrevent = (shouldPrevent || shouldPreventWheel(deltaX, deltaY));1834if (shouldPrevent) {1835e.stopPropagation();1836e.preventDefault();1837}1838}18391840if (typeof window.onwheel !== "undefined") {1841$this.bind(eventClass('wheel'), mousewheelHandler);1842} else if (typeof window.onmousewheel !== "undefined") {1843$this.bind(eventClass('mousewheel'), mousewheelHandler);1844}1845}18461847function bindKeyboardHandler() {1848var hovered = false;1849$this.bind(eventClass('mouseenter'), function (e) {1850hovered = true;1851});1852$this.bind(eventClass('mouseleave'), function (e) {1853hovered = false;1854});18551856var shouldPrevent = false;1857$(ownerDocument).bind(eventClass('keydown'), function (e) {1858if (e.isDefaultPrevented && e.isDefaultPrevented()) {1859return;1860}18611862if (!hovered) {1863return;1864}18651866var activeElement = document.activeElement ? document.activeElement : ownerDocument.activeElement;1867// go deeper if element is a webcomponent1868while (activeElement.shadowRoot) {1869activeElement = activeElement.shadowRoot.activeElement;1870}1871if ($(activeElement).is(":input,[contenteditable]")) {1872return;1873}18741875var deltaX = 0;1876var deltaY = 0;18771878switch (e.which) {1879case 37: // left1880deltaX = -30;1881break;1882case 38: // up1883deltaY = 30;1884break;1885case 39: // right1886deltaX = 30;1887break;1888case 40: // down1889deltaY = -30;1890break;1891case 33: // page up1892deltaY = 90;1893break;1894case 32: // space bar1895case 34: // page down1896deltaY = -90;1897break;1898case 35: // end1899if (e.ctrlKey) {1900deltaY = -contentHeight;1901} else {1902deltaY = -containerHeight;1903}1904break;1905case 36: // home1906if (e.ctrlKey) {1907deltaY = $this.scrollTop();1908} else {1909deltaY = containerHeight;1910}1911break;1912default:1913return;1914}19151916$this.scrollTop($this.scrollTop() - deltaY);1917$this.scrollLeft($this.scrollLeft() + deltaX);19181919shouldPrevent = shouldPreventWheel(deltaX, deltaY);1920if (shouldPrevent) {1921e.preventDefault();1922}1923});1924}19251926function bindRailClickHandler() {1927function stopPropagation(e) { e.stopPropagation(); }19281929$scrollbarY.bind(eventClass('click'), stopPropagation);1930$scrollbarYRail.bind(eventClass('click'), function (e) {1931var halfOfScrollbarLength = getInt(scrollbarYHeight / 2);1932var positionTop = e.pageY - $scrollbarYRail.offset().top - halfOfScrollbarLength;1933var maxPositionTop = containerHeight - scrollbarYHeight;1934var positionRatio = positionTop / maxPositionTop;19351936if (positionRatio < 0) {1937positionRatio = 0;1938} else if (positionRatio > 1) {1939positionRatio = 1;1940}19411942$this.scrollTop((contentHeight - containerHeight) * positionRatio);1943});19441945$scrollbarX.bind(eventClass('click'), stopPropagation);1946$scrollbarXRail.bind(eventClass('click'), function (e) {1947var halfOfScrollbarLength = getInt(scrollbarXWidth / 2);1948var positionLeft = e.pageX - $scrollbarXRail.offset().left - halfOfScrollbarLength;1949var maxPositionLeft = containerWidth - scrollbarXWidth;1950var positionRatio = positionLeft / maxPositionLeft;19511952if (positionRatio < 0) {1953positionRatio = 0;1954} else if (positionRatio > 1) {1955positionRatio = 1;1956}19571958$this.scrollLeft((contentWidth - containerWidth) * positionRatio);1959});1960}19611962function bindSelectionHandler() {1963function getRangeNode() {1964var selection = window.getSelection ? window.getSelection() :1965document.getSlection ? document.getSlection() : {rangeCount: 0};1966if (selection.rangeCount === 0) {1967return null;1968} else {1969return selection.getRangeAt(0).commonAncestorContainer;1970}1971}19721973var scrollingLoop = null;1974var scrollDiff = {top: 0, left: 0};1975function startScrolling() {1976if (!scrollingLoop) {1977scrollingLoop = setInterval(function () {1978if (!isPluginAlive()) {1979clearInterval(scrollingLoop);1980return;1981}19821983$this.scrollTop($this.scrollTop() + scrollDiff.top);1984$this.scrollLeft($this.scrollLeft() + scrollDiff.left);1985updateGeometry();1986}, 50); // every .1 sec1987}1988}1989function stopScrolling() {1990if (scrollingLoop) {1991clearInterval(scrollingLoop);1992scrollingLoop = null;1993}1994$scrollbarXRail.removeClass('in-scrolling');1995$scrollbarYRail.removeClass('in-scrolling');1996}19971998var isSelected = false;1999$(ownerDocument).bind(eventClass('selectionchange'), function (e) {2000if ($.contains($this[0], getRangeNode())) {2001isSelected = true;2002} else {2003isSelected = false;2004stopScrolling();2005}2006});2007$(window).bind(eventClass('mouseup'), function (e) {2008if (isSelected) {2009isSelected = false;2010stopScrolling();2011}2012});20132014$(window).bind(eventClass('mousemove'), function (e) {2015if (isSelected) {2016var mousePosition = {x: e.pageX, y: e.pageY};2017var containerOffset = $this.offset();2018var containerGeometry = {2019left: containerOffset.left,2020right: containerOffset.left + $this.outerWidth(),2021top: containerOffset.top,2022bottom: containerOffset.top + $this.outerHeight()2023};20242025if (mousePosition.x < containerGeometry.left + 3) {2026scrollDiff.left = -5;2027$scrollbarXRail.addClass('in-scrolling');2028} else if (mousePosition.x > containerGeometry.right - 3) {2029scrollDiff.left = 5;2030$scrollbarXRail.addClass('in-scrolling');2031} else {2032scrollDiff.left = 0;2033}20342035if (mousePosition.y < containerGeometry.top + 3) {2036if (containerGeometry.top + 3 - mousePosition.y < 5) {2037scrollDiff.top = -5;2038} else {2039scrollDiff.top = -20;2040}2041$scrollbarYRail.addClass('in-scrolling');2042} else if (mousePosition.y > containerGeometry.bottom - 3) {2043if (mousePosition.y - containerGeometry.bottom + 3 < 5) {2044scrollDiff.top = 5;2045} else {2046scrollDiff.top = 20;2047}2048$scrollbarYRail.addClass('in-scrolling');2049} else {2050scrollDiff.top = 0;2051}20522053if (scrollDiff.top === 0 && scrollDiff.left === 0) {2054stopScrolling();2055} else {2056startScrolling();2057}2058}2059});2060}20612062function bindTouchHandler(supportsTouch, supportsIePointer) {2063function applyTouchMove(differenceX, differenceY) {2064$this.scrollTop($this.scrollTop() - differenceY);2065$this.scrollLeft($this.scrollLeft() - differenceX);20662067updateGeometry();2068}20692070var startOffset = {};2071var startTime = 0;2072var speed = {};2073var easingLoop = null;2074var inGlobalTouch = false;2075var inLocalTouch = false;20762077function globalTouchStart(e) {2078inGlobalTouch = true;2079}2080function globalTouchEnd(e) {2081inGlobalTouch = false;2082}20832084function getTouch(e) {2085if (e.originalEvent.targetTouches) {2086return e.originalEvent.targetTouches[0];2087} else {2088// Maybe IE pointer2089return e.originalEvent;2090}2091}2092function shouldHandle(e) {2093var event = e.originalEvent;2094if (event.targetTouches && event.targetTouches.length === 1) {2095return true;2096}2097if (event.pointerType && event.pointerType !== 'mouse' && event.pointerType !== event.MSPOINTER_TYPE_MOUSE) {2098return true;2099}2100return false;2101}2102function touchStart(e) {2103if (shouldHandle(e)) {2104inLocalTouch = true;21052106var touch = getTouch(e);21072108startOffset.pageX = touch.pageX;2109startOffset.pageY = touch.pageY;21102111startTime = (new Date()).getTime();21122113if (easingLoop !== null) {2114clearInterval(easingLoop);2115}21162117e.stopPropagation();2118}2119}2120function touchMove(e) {2121if (!inGlobalTouch && inLocalTouch && shouldHandle(e)) {2122var touch = getTouch(e);21232124var currentOffset = {pageX: touch.pageX, pageY: touch.pageY};21252126var differenceX = currentOffset.pageX - startOffset.pageX;2127var differenceY = currentOffset.pageY - startOffset.pageY;21282129applyTouchMove(differenceX, differenceY);2130startOffset = currentOffset;21312132var currentTime = (new Date()).getTime();21332134var timeGap = currentTime - startTime;2135if (timeGap > 0) {2136speed.x = differenceX / timeGap;2137speed.y = differenceY / timeGap;2138startTime = currentTime;2139}21402141if (shouldPreventSwipe(differenceX, differenceY)) {2142e.stopPropagation();2143e.preventDefault();2144}2145}2146}2147function touchEnd(e) {2148if (!inGlobalTouch && inLocalTouch) {2149inLocalTouch = false;21502151clearInterval(easingLoop);2152easingLoop = setInterval(function () {2153if (!isPluginAlive()) {2154clearInterval(easingLoop);2155return;2156}21572158if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {2159clearInterval(easingLoop);2160return;2161}21622163applyTouchMove(speed.x * 30, speed.y * 30);21642165speed.x *= 0.8;2166speed.y *= 0.8;2167}, 10);2168}2169}21702171if (supportsTouch) {2172$(window).bind(eventClass("touchstart"), globalTouchStart);2173$(window).bind(eventClass("touchend"), globalTouchEnd);2174$this.bind(eventClass("touchstart"), touchStart);2175$this.bind(eventClass("touchmove"), touchMove);2176$this.bind(eventClass("touchend"), touchEnd);2177}21782179if (supportsIePointer) {2180if (window.PointerEvent) {2181$(window).bind(eventClass("pointerdown"), globalTouchStart);2182$(window).bind(eventClass("pointerup"), globalTouchEnd);2183$this.bind(eventClass("pointerdown"), touchStart);2184$this.bind(eventClass("pointermove"), touchMove);2185$this.bind(eventClass("pointerup"), touchEnd);2186} else if (window.MSPointerEvent) {2187$(window).bind(eventClass("MSPointerDown"), globalTouchStart);2188$(window).bind(eventClass("MSPointerUp"), globalTouchEnd);2189$this.bind(eventClass("MSPointerDown"), touchStart);2190$this.bind(eventClass("MSPointerMove"), touchMove);2191$this.bind(eventClass("MSPointerUp"), touchEnd);2192}2193}2194}21952196function bindScrollHandler() {2197$this.bind(eventClass('scroll'), function (e) {2198updateGeometry();2199});2200}22012202function destroy() {2203$this.unbind(eventClass());2204$(window).unbind(eventClass());2205$(ownerDocument).unbind(eventClass());2206$this.data('perfect-scrollbar', null);2207$this.data('perfect-scrollbar-update', null);2208$this.data('perfect-scrollbar-destroy', null);2209$scrollbarX.remove();2210$scrollbarY.remove();2211$scrollbarXRail.remove();2212$scrollbarYRail.remove();22132214// clean all variables2215$this =2216$scrollbarXRail =2217$scrollbarYRail =2218$scrollbarX =2219$scrollbarY =2220scrollbarXActive =2221scrollbarYActive =2222containerWidth =2223containerHeight =2224contentWidth =2225contentHeight =2226scrollbarXWidth =2227scrollbarXLeft =2228scrollbarXBottom =2229isScrollbarXUsingBottom =2230scrollbarXTop =2231scrollbarYHeight =2232scrollbarYTop =2233scrollbarYRight =2234isScrollbarYUsingRight =2235scrollbarYLeft =2236isRtl =2237eventClass = null;2238}22392240var supportsTouch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch);2241var supportsIePointer = window.navigator.msMaxTouchPoints !== null;22422243function initialize() {2244updateGeometry();2245bindScrollHandler();2246bindMouseScrollXHandler();2247bindMouseScrollYHandler();2248bindRailClickHandler();2249bindSelectionHandler();2250bindMouseWheelHandler();22512252if (supportsTouch || supportsIePointer) {2253bindTouchHandler(supportsTouch, supportsIePointer);2254}2255if (settings.useKeyboard) {2256bindKeyboardHandler();2257}2258$this.data('perfect-scrollbar', $this);2259$this.data('perfect-scrollbar-update', updateGeometry);2260$this.data('perfect-scrollbar-destroy', destroy);2261}22622263initialize();22642265return $this;2266});2267};2268});22692270227122722273// Unique ID2274jQuery.fn.extend({22752276uniqueId: (function() {2277var uuid = 0;22782279return function() {2280return this.each(function() {2281if ( !this.id ) {2282this.id = "ui-id-" + ( ++uuid );2283}2284});2285};2286})(),2287});22882289