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