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

