(function(e) { e.fn.hoverIntent = function(f, m) { var d = {sensitivity:7, interval:100, timeout:0}; d = e.extend(d, m ? {over:f, out:m} : f); var h, i, j, k, l = function(b) { h = b.pageX; i = b.pageY }, n = function(b, a) { a.hoverIntent_t = clearTimeout(a.hoverIntent_t); if(Math.abs(j - h) + Math.abs(k - i) < d.sensitivity) { e(a).unbind("mousemove", l); a.hoverIntent_s = 1; return d.over.apply(a, [b]) }else { j = h; k = i; a.hoverIntent_t = setTimeout(function() { n(b, a) }, d.interval) } }, o = function(b, a) { a.hoverIntent_t = clearTimeout(a.hoverIntent_t); a.hoverIntent_s = 0; return d.out.apply(a, [b]) }; f = function(b) { for(var a = (b.type == "mouseover" ? b.fromElement : b.toElement) || b.relatedTarget;a && a != this;)try { a = a.parentNode }catch(p) { a = this }if(a == this)return false; var g = jQuery.extend({}, b), c = this; if(c.hoverIntent_t)c.hoverIntent_t = clearTimeout(c.hoverIntent_t); if(b.type == "mouseover") { j = g.pageX; k = g.pageY; e(c).bind("mousemove", l); if(c.hoverIntent_s != 1)c.hoverIntent_t = setTimeout(function() { n(g, c) }, d.interval) }else { e(c).unbind("mousemove", l); if(c.hoverIntent_s == 1)c.hoverIntent_t = setTimeout(function() { o(g, c) }, d.timeout) } }; return this.mouseover(f).mouseout(f) } })(jQuery);
