var ddsmoothmenu={arrowimages:{down:["downarrowclass","",0],right:["rightarrowclass",""]},transition:{overtime:300,outtime:300},shadow:{enabled:false,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(b){a.html("Error fetching content. Server Response: "+b.responseText)},success:function(d){a.html(d);ddsmoothmenu.buildmenu(c,b)}})},buildshadow:function(){},buildmenu:function(b,e){var a=ddsmoothmenu,c=b("#"+e.mainmenuid+">ul"),d=c.find("ul").parent();d.each(function(f){var c=b(this).css({zIndex:100-f}),d=b(this).find("ul:eq(0)").css({display:"block"});this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:d.outerWidth(),subulh:d.outerHeight()};this.istopheader=c.parents("ul").length==1?true:false;d.css({top:this.istopheader?this._dimensions.h+"px":0});c.children("a:eq(0)").css(this.istopheader?{paddingRight:a.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader?a.arrowimages.down[1]:a.arrowimages.right[1])+'" class="'+(this.istopheader?a.arrowimages.down[0]:a.arrowimages.right[0])+'" style="border:0;" />');if(a.shadow.enabled){this._shadowoffset={x:this.istopheader?d.offset().left+a.shadow.offsetx:this._dimensions.w,y:this.istopheader?d.offset().top+a.shadow.offsety:c.position().top};if(this.istopheader)$parentshadow=b(document.body);else{var e=c.parents("li:eq(0)");$parentshadow=e.get(0).$shadow}this.$shadow=b('<div class="ddshadow'+(this.istopheader?" toplevelshadow":"")+'"></div>').prependTo($parentshadow).css({left:this._shadowoffset.x+"px",top:this._shadowoffset.y+"px"})}c.hover(function(){var d=b(this).children("ul:eq(0)");this._offsets={left:b(this).offset().left,top:b(this).offset().top};var c=this.istopheader?0:this._dimensions.w;c=this._offsets.left+c+this._dimensions.subulw>b(window).width()?this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w:c;if(d.queue().length<=1){d.css({left:c+"px",width:this._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime);if(a.shadow.enabled){var e=this.istopheader?d.offset().left+ddsmoothmenu.shadow.offsetx:c,f=this.istopheader?d.offset().top+a.shadow.offsety:this._shadowoffset.y;!this.istopheader&&ddsmoothmenu.detectwebkit&&this.$shadow.css({opacity:1});this.$shadow.css({overflow:"",width:this._dimensions.subulw+"px",left:e+"px",top:f+"px"}).animate({height:this._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},function(){var c=b(this).children("ul:eq(0)");c.animate({height:"hide",opacity:"hide"},ddsmoothmenu.transition.outtime);if(a.shadow.enabled){ddsmoothmenu.detectwebkit&&this.$shadow.children("div:eq(0)").css({opacity:0});this.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime)}})});c.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'+b+", "+b+" ul li a {background:"+a.customtheme[0]+";}\n"+b+" ul li a:hover {background:"+a.customtheme[1]+";}\n</style>")}jQuery(document).ready(function(b){if(typeof a.contentsource=="object")ddsmoothmenu.getajaxmenu(b,a);else ddsmoothmenu.buildmenu(b,a)})}};ddsmoothmenu.init({mainmenuid:"smoothmenu1",customtheme:[],contentsource:"markup"});
