var ddsmoothmenu={transition:{overtime:300,outtime:300},shadow:{enable:true,offsetx:5,offsety:5},showhidedelay:{showdelay:100,hidedelay:200},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,css3support:window.msPerformance||!document.all&&document.querySelector,getajaxmenu:function(a,b){var d=a("#"+b.contentsource[0]);d.html("Loading Menu...");a.ajax({url:b.contentsource[1],async:true,error:function(a){d.html("Error fetching content. Server Response: "+
a.responseText)},success:function(e){d.html(e);ddsmoothmenu.buildmenu(a,b)}})},buildmenu:function(a,b){var d=ddsmoothmenu,e=a("#"+b.mainmenuid+">ul");e.parent().get(0).className=b.classname||"ddsmoothmenu";var h=e.find("ul").parent();h.hover(function(){a(this).children("a:eq(0)").addClass("selected")},function(){a(this).children("a:eq(0)").removeClass("selected")});h.each(function(e){var g=a(this).css({zIndex:b.zIndex-e}),f=a(this).find("ul:eq(0)").css({display:"block"});f.data("timers",{});this._dimensions=
{w:this.offsetWidth,h:this.offsetHeight,subulw:f.outerWidth(),subulh:f.outerHeight()};this.istopheader=g.parents("ul").length==1?true:false;f.css({top:this.istopheader&&b.orientation!="v"?this._dimensions.h+"px":0});g.children("a:eq(0)").css(this.istopheader?{paddingRight:b.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader&&b.orientation!="v"?b.arrowimages.down[1]:b.arrowimages.right[1])+'" class="'+(this.istopheader&&b.orientation!="v"?b.arrowimages.down[0]:b.arrowimages.right[0])+'" style="border:0;" />');
if(d.shadow.enable&&!d.css3support)this._shadowoffset={x:this.istopheader?f.offset().left+d.shadow.offsetx:this._dimensions.w,y:this.istopheader?f.offset().top+d.shadow.offsety:g.position().top},$parentshadow=this.istopheader?a(document.body):g.parents("li:eq(0)").get(0).$shadow,this.$shadow=a('<div class="ddshadow'+(this.istopheader?" toplevelshadow":"")+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+"px",top:this._shadowoffset.y+"px"});g.hover(function(){var c=g.get(0);clearTimeout(f.data("timers").hidetimer);
f.data("timers").showtimer=setTimeout(function(){c._offsets={left:g.offset().left,top:g.offset().top};var e=c.istopheader&&b.orientation!="v"?0:c._dimensions.w,e=c._offsets.left+e+c._dimensions.subulw>a(window).width()?c.istopheader&&b.orientation!="v"?-c._dimensions.subulw+c._dimensions.w:-c._dimensions.w:e;if(f.queue().length<=1&&(f.css({left:e+"px",width:c._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime),d.shadow.enable&&!d.css3support)){var e=
c.istopheader?f.offset().left+ddsmoothmenu.shadow.offsetx:e,h=c.istopheader?f.offset().top+d.shadow.offsety:c._shadowoffset.y;!c.istopheader&&ddsmoothmenu.detectwebkit&&c.$shadow.css({opacity:1});c.$shadow.css({overflow:"",width:c._dimensions.subulw+"px",left:e+"px",top:h+"px"}).animate({height:c._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}},ddsmoothmenu.showhidedelay.showdelay)},function(){var a=g.get(0);clearTimeout(f.data("timers").showtimer);f.data("timers").hidetimer=setTimeout(function(){f.animate({height:"hide",
opacity:"hide"},ddsmoothmenu.transition.outtime);d.shadow.enable&&!d.css3support&&(ddsmoothmenu.detectwebkit&&a.$shadow.children("div:eq(0)").css({opacity:0}),a.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime))},ddsmoothmenu.showhidedelay.hidedelay)})});if(d.shadow.enable&&d.css3support)for(var h=a("#"+b.mainmenuid+" ul li ul"),k=parseInt(d.shadow.offsetx)+"px "+parseInt(d.shadow.offsety)+"px 5px #aaa",j=["boxShadow","MozBoxShadow","WebkitBoxShadow","MsBoxShadow"],
i=0;i<j.length;i++)h.css(j[i],k);e.find("ul").css({display:"none",visibility:"visible"})},init:function(a){if(typeof a.customtheme=="object"&&a.customtheme.length==2){var b="#"+a.mainmenuid;document.write('<style type="text/css">\n'+(a.orientation=="v"?b:b+", "+b)+" ul li a {background:"+a.customtheme[0]+";}\n"+b+" ul li a:hover {background:"+a.customtheme[1]+";}\n</style>")}this.shadow.enable=document.all&&!window.XMLHttpRequest?false:this.shadow.enable;jQuery(document).ready(function(b){typeof a.contentsource==
"object"?ddsmoothmenu.getajaxmenu(b,a):ddsmoothmenu.buildmenu(b,a)})}};

