/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 3.1.9
 *
 * Requires: jQuery 1.2.2+
 */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function i(b){var c=b||window.event,g=d.call(arguments,1),h=0,i=0,l=0,m=0;if(b=a.event.fix(c),b.type="mousewheel","detail"in c&&(l=-1*c.detail),"wheelDelta"in c&&(l=c.wheelDelta),"wheelDeltaY"in c&&(l=c.wheelDeltaY),"wheelDeltaX"in c&&(i=-1*c.wheelDeltaX),"axis"in c&&c.axis===c.HORIZONTAL_AXIS&&(i=-1*l,l=0),h=0===l?i:l,"deltaY"in c&&(l=-1*c.deltaY,h=l),"deltaX"in c&&(i=c.deltaX,0===l&&(h=-1*i)),0!==l||0!==i){if(1===c.deltaMode){var n=a.data(this,"mousewheel-line-height");h*=n,l*=n,i*=n}else if(2===c.deltaMode){var o=a.data(this,"mousewheel-page-height");h*=o,l*=o,i*=o}return m=Math.max(Math.abs(l),Math.abs(i)),(!f||f>m)&&(f=m,k(c,m)&&(f/=40)),k(c,m)&&(h/=40,i/=40,l/=40),h=Math[h>=1?"floor":"ceil"](h/f),i=Math[i>=1?"floor":"ceil"](i/f),l=Math[l>=1?"floor":"ceil"](l/f),b.deltaX=i,b.deltaY=l,b.deltaFactor=f,b.deltaMode=0,g.unshift(b,h,i,l),e&&clearTimeout(e),e=setTimeout(j,200),(a.event.dispatch||a.event.handle).apply(this,g)}}function j(){f=null}function k(a,b){return h.settings.adjustOldDeltas&&"mousewheel"===a.type&&0===b%120}var e,f,b=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],c="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],d=Array.prototype.slice;if(a.event.fixHooks)for(var g=b.length;g;)a.event.fixHooks[b[--g]]=a.event.mouseHooks;var h=a.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var b=c.length;b;)this.addEventListener(c[--b],i,!1);else this.onmousewheel=i;a.data(this,"mousewheel-line-height",h.getLineHeight(this)),a.data(this,"mousewheel-page-height",h.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],i,!1);else this.onmousewheel=null},getLineHeight:function(b){return parseInt(a(b)["offsetParent"in a.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});