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