var ddsmoothmenu={arrowimages:{down:["downarrowclass","/images/common/trans.gif",25],right:["rightarrowclass","/images/common/trans.gif"]},transition:{overtime:300,outtime:200},shadow:{enabled:false,offsetx:2,offsety:2},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.hover(function(F){D(this).children("a:eq(0)").addClass("selected")},function(F){D(this).children("a:eq(0)").removeClass("selected")});C.each(function(G){var I=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=I.parents("ul").length==1?true:false;F.css({top:this.istopheader?this._dimensions.h+"px":0});I.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:I.position().top)};if(this.istopheader){$parentshadow=D(document.body)}else{var H=I.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"})}I.hover(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 J=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:J+"px"}).animate({height:this._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},function(K){var J=D(this).children("ul:eq(0)");J.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"});
