var ddsmoothmenu={arrowimages:{down:["downarrowclass","down.gif",0],right:["rightarrowclass","right.gif",0]},transition:{overtime:200,outtime:200},shadow:{enable:false,offsetx:5,offsety:5},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,getajaxmenu:function(a,b){var c=a("#"+b.contentsource[0]);c.html("Loading Menu...");a.ajax({url:b.contentsource[1],async:true,error:function(a){c.html("Error fetching content. Server Response: "+a.responseText)},success:function(d){c.html(d);ddsmoothmenu.buildmenu(a,b)}})},buildmenu:function(a,b){var c=ddsmoothmenu;var d=a("#"+b.mainmenuid+">ul");d.parent().get(0).className=b.classname||"ddsmoothmenu";var e=d.find("ul").parent();e.hover(function(b){a(this).children("a:eq(0)").addClass("selected")},function(b){a(this).children("a:eq(0)").removeClass("selected")});e.each(function(d){var e=a(this).css({zIndex:100-d});var f=a(this).find("ul:eq(0)").css({display:"block"});this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:f.outerWidth(),subulh:f.outerHeight()};this.istopheader=e.parents("ul").length==1?true:false;f.css({top:this.istopheader&&b.orientation!="v"?this._dimensions.h+"px":0});if(c.shadow.enable){this._shadowoffset={x:this.istopheader?f.offset().left+c.shadow.offsetx:this._dimensions.w,y:this.istopheader?f.offset().top+c.shadow.offsety:e.position().top};if(this.istopheader)$parentshadow=a(document.body);else{var g=e.parents("li:eq(0)");$parentshadow=g.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"})}e.hover(function(d){var e=a(this).children("ul:eq(0)");this._offsets={left:a(this).offset().left,top:a(this).offset().top};var f=this.istopheader&&b.orientation!="v"?0:this._dimensions.w;f=this._offsets.left+f+this._dimensions.subulw>a(window).width()?this.istopheader&&b.orientation!="v"?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w:f;if(e.queue().length<=1){e.css({left:f+"px",width:this._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime);if(c.shadow.enable){var g=this.istopheader?e.offset().left+ddsmoothmenu.shadow.offsetx:f;var h=this.istopheader?e.offset().top+c.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:g+"px",top:h+"px"}).animate({height:this._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},function(b){var d=a(this).children("ul:eq(0)");d.animate({height:"hide",opacity:"hide"},ddsmoothmenu.transition.outtime);if(c.shadow.enable){if(ddsmoothmenu.detectwebkit){this.$shadow.children("div:eq(0)").css({opacity:0})}this.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime)}})});d.find("ul").css({display:"none",visibility:"visible"})},init:function(a){if(typeof a.customtheme=="object"&&a.customtheme.length==2){var b="#"+a.mainmenuid;var c=a.orientation=="v"?b:b+", "+b;document.write('<style type="text/css">\n'+c+" 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){if(typeof a.contentsource=="object"){ddsmoothmenu.getajaxmenu(b,a)}else{ddsmoothmenu.buildmenu(b,a)}})}}
