(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);var ddsmoothmenu={arrowimages:{down:["downarrowclass","js/smoothmenu/down.gif",23],right:["rightarrowclass","js/smoothmenu/right.gif"]},transition:{overtime:300,outtime:400},shadow:{enabled:true,offsetx:5,offsety:5},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,getajaxmenu:function(c,b){var a=c("#"+b.contentsource[0]);a.html("Loading Menu...");c.ajax({url:b.contentsource[1],async:true,error:function(d){a.html("Error fetching content. Server Response: "+d.responseText)},success:function(d){a.html(d);ddsmoothmenu.buildmenu(c,b)}})},buildshadow:function(b,a){},buildmenu:function(d,b){var e=ddsmoothmenu;var a=d("#"+b.mainmenuid+">ul");var c=a.find("ul").parent();c.each(function(g){var j=d(this).css({zIndex:100-g});var f=d(this).find("ul:eq(0)").css({display:"block"});this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:f.outerWidth(),subulh:f.outerHeight()};this.istopheader=j.parents("ul").length==1?true:false;f.css({top:this.istopheader?this._dimensions.h+"px":0});j.children("a:eq(0)").css(this.istopheader?{paddingRight:e.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader?e.arrowimages.down[1]:e.arrowimages.right[1])+'" class="'+(this.istopheader?e.arrowimages.down[0]:e.arrowimages.right[0])+'" style="border:0;" />');if(e.shadow.enabled){this._shadowoffset={x:(this.istopheader?f.offset().left+e.shadow.offsetx:this._dimensions.w),y:(this.istopheader?f.offset().top+e.shadow.offsety:j.position().top)};if(this.istopheader){$parentshadow=d(document.body)}else{var h=j.parents("li:eq(0)");$parentshadow=h.get(0).$shadow}this.$shadow=d('<div class="ddshadow'+(this.istopheader?" toplevelshadow":"")+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+"px",top:this._shadowoffset.y+"px"})}j.hoverIntent({interval:200,sensitivity:6,timeout:700,over:function(m){var l=d(this).children("ul:eq(0)");this._offsets={left:d(this).offset().left,top:d(this).offset().top};var n=this.istopheader?0:this._dimensions.w;n=(this._offsets.left+n+this._dimensions.subulw>d(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):n;if(l.queue().length<=1){l.css({left:n+"px",width:this._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime);if(e.shadow.enabled){var k=this.istopheader?l.offset().left+ddsmoothmenu.shadow.offsetx:n;var i=this.istopheader?l.offset().top+e.shadow.offsety:this._shadowoffset.y;if(!this.istopheader&&ddsmoothmenu.detectwebkit){this.$shadow.css({opacity:1})}this.$shadow.css({overflow:"",width:this._dimensions.subulw+"px",left:k+"px",top:i+"px"}).animate({height:this._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},out:function(k){var i=d(this).children("ul:eq(0)");i.animate({height:"hide",opacity:"hide"},ddsmoothmenu.transition.outtime);if(e.shadow.enabled){if(ddsmoothmenu.detectwebkit){this.$shadow.children("div:eq(0)").css({opacity:0})}this.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime)}}})});a.find("ul").css({display:"none",visibility:"visible"})},init:function(b){if(typeof b.customtheme=="object"&&b.customtheme.length==2){var a="#"+b.mainmenuid;document.write('<style type="text/css">\n'+a+", "+a+" ul li a {background:"+b.customtheme[0]+";}\n"+a+" ul li a:hover {background:"+b.customtheme[1]+";}\n</style>")}jQuery(document).ready(function(c){if(typeof b.contentsource=="object"){ddsmoothmenu.getajaxmenu(c,b)}else{ddsmoothmenu.buildmenu(c,b)}})}};ddsmoothmenu.init({mainmenuid:"smoothmenu1",contentsource:"markup"});