var ddsmoothmenu={arrowimages:{right:["rightarrowclass","scripts/right.gif"]},transition:{overtime:300,outtime:300},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,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)}})},buildmenu:function(d,b){var e=ddsmoothmenu;var a=d("#"+b.mainmenuid+">ul");a.parent().get(0).className=b.classname||"ddsmoothmenu";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 h=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=h.parents("ul").length==1?true:false;if(!this.istopheader){h.children("a:eq(0)").css(this.istopheader?{}:{}).append('
')}h.hover(function(j){var i=d(this).children("ul:eq(0)");this._offsets={left:d(this).offset().left,top:d(this).offset().top};var k=this.istopheader&&b.orientation!="v"?0:this._dimensions.w;k=(this._offsets.left+k+this._dimensions.subulw>d(window).width())?(this.istopheader&&b.orientation!="v"?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):k;if(i.queue().length<=1){i.css({left:k+"px",width:this._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime)}},function(j){var i=d(this).children("ul:eq(0)");i.animate({height:"hide",opacity:"hide"},ddsmoothmenu.transition.outtime)})});a.find("ul").css({display:"none",visibility:"visible"})},init:function(c){if(typeof c.customtheme=="object"&&c.customtheme.length==2){var b="#"+c.mainmenuid;var a=(c.orientation=="v")?b:b+", "+b;document.write('")}jQuery(document).ready(function(d){if(typeof c.contentsource=="object"){ddsmoothmenu.getajaxmenu(d,c)}else{ddsmoothmenu.buildmenu(d,c)}})}};