﻿(function(a){function c(b){var c=b||window.event,g=[].slice.call(arguments,1),d=0,f=0,e=0;b=a.event.fix(c);b.type="mousewheel";if(b.wheelDelta)d=b.wheelDelta/120;if(b.detail)d=-b.detail/3;e=d;if(c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS){e=0;f=-1*d}if(c.wheelDeltaY!==undefined)e=c.wheelDeltaY/120;if(c.wheelDeltaX!==undefined)f=-1*c.wheelDeltaX/120;g.unshift(b,d,f,e);return a.event.handle.apply(this,g)}var b=["DOMMouseScroll","mousewheel"];a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],c,false);else this.onmousewheel=c},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],c,false);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
