(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);$(function(){var d=$("div.nav").innerWidth()-parseInt($("div.ssm").css("padding-left"))*2;$.each($("ul.navf a"),function(e){if(this.rel==menuId){a(this,e)}$(this).hoverIntent(function(){var g=$(this).attr("id").replace("menu-","");var f=$("div[id=sub-"+g+"]").is(":hidden");if(f){a(this,e)}},function(){})});var c={interval:200,over:function(){},timeout:1000,out:b};function b(){if(isHome){$("ul.navf a").removeClass("on");$("div[id^=sub-]:visible").hide()}else{var e=$("ul.navf a[rel="+menuId+"]");if(e.length==1){var g=e.attr("id").replace("menu-","");var f=$("div[id=sub-"+g+"]").is(":hidden");if(f){a(e,g)}}}}$("div.nav").hoverIntent(c);function a(g,h){var j=3;$("ul.navf a").removeClass("on");$("div[id^=sub-]:visible").hide();var l=$("#sub-"+h);var f=$("table",l);$(g).addClass("on");l.show();if(h==$("ul.navf a").length-1){e=Math.floor(d-f.width())-j;f.css("margin-left",e+"px")}else{if(h>0){var m=0;$("ul.navf a:lt("+h+")").each(function(n){m+=$(this).width()});m+=Math.floor($("ul.navf a:eq("+h+")").width()/2);sw=Math.floor(f.width()/2);var i=m-sw-parseInt($("div.ssm").css("padding-left"));var k=parseInt($("ul.navf").css("padding-left"));i+=k;if(i>0){var e=Math.floor(d-f.width())-j;if(i+f.width()>=d){f.css("margin-left",e+"px")}else{f.css("margin-left",i+"px")}}}}}});
