/**
* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+  <http://cherne.net/brian/resources/jquery.hoverIntent.html>
*/
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);

$(document).ready(function(){var d=$(".nav-main tr");var e=d.find("> td");var f=e.find("> a");var g=$(".mainmenuhover");var h=g.find("> ul");var i=false;var j=false;var k=10;var l=50;var m=false;init();e.hover(enterItem,leaveItem);f.hoverIntent({interval:l,over:enterAnchor,timeout:l,out:leaveAnchor});d.mouseleave(function(){i=false;tryClose()});f.mouseleave(function(){m=true});setTimeout(function(){m=true},1000);function activateItem(a){var b=a.attr("id");var c=h.filter("."+b).fadeIn(k);h.not(c).fadeOut(k);a.addClass("hover");e.not(a).removeClass("hover")}function enterItem(){i=true}function leaveItem(){i=false}function enterAnchor(){if(!m)return;activateItem($(this).parent())}function leaveAnchor(){tryClose()}h.hover(enterPanel,leavePanel);function enterPanel(){j=true}function leavePanel(){j=false;tryClose()}function hidePanel(){if(!j&&!i){h.fadeOut(k);e.removeClass("hover")}}function tryClose(){setTimeout(hidePanel,500)}function init(){var a=d.offset();if(a!=null){var b=a.top+d.height();var c=a.left;g.css({"top":b})}}});

