var ddsmoothmenu={arrowimages:{down:['downarrowclass',baseDir + '/modules/blockcategories/right.gif',23],right:['rightarrowclass',baseDir + '/modules/blockcategories/right.gif']},transition:{overtime:0,outtime:-100},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,getajaxmenu:function($,setting){var $menucontainer=$('#'+setting.contentsource[0])
$menucontainer.html("Loading Menu...")
$.ajax({url:setting.contentsource[1],async:true,error:function(ajaxrequest){$menucontainer.html('Error fetching content. Server Response: '+ajaxrequest.responseText)},success:function(content){$menucontainer.html(content)
ddsmoothmenu.buildmenu($,setting)}})},buildshadow:function($,$subul){},buildmenu:function($,setting){var smoothmenu=ddsmoothmenu
var $mainmenu=$("#"+setting.mainmenuid+">ul")
var $headers=$mainmenu.find("ul").parent();$headers.each(function(i){var $curobj=$(this).css({zIndex:100-i})
var $subul=$(this).find('ul:eq(0)').css({display:'block'})
this._dimensions={w:this.offsetWidth,h:this.offsetHeight,subulw:$subul.outerWidth(),subulh:$subul.outerHeight()}
this.istopheader=$curobj.parents("ul").length==1?true:false
$subul.css({top:this.istopheader?this._dimensions.h+"px":100})
$curobj.children("a:eq(0)").css(this.istopheader?{paddingRight:smoothmenu.arrowimages.down[2]}:{}).append('<img width="8" height="11" src="'+(this.istopheader?smoothmenu.arrowimages.down[1]:smoothmenu.arrowimages.right[1])
+'" class="'+(this.istopheader?smoothmenu.arrowimages.down[0]:smoothmenu.arrowimages.right[0])
+'" style="border:0;" />')
$curobj.hover(function(e){var $targetul=$(this).children("ul:eq(0)")
this._offsets={left:$(this).offset().left,top:$(this).offset().top}
var menuleft=this.istopheader?0:this._dimensions.w
menuleft=(this._offsets.left+menuleft+this._dimensions.subulw>$(window).width())?(this.istopheader?-this._dimensions.subulw+this._dimensions.w:-this._dimensions.w):menuleft
if($targetul.queue().length<=1){$targetul.css({top:-((this._dimensions.subulh)/2-13)+"px",left:(this._dimensions.subulw)+"px"}).animate({width:'show',opacity:'show'},ddsmoothmenu.transition.overtime)}
$(this).css({background:'#fff'})
$(this).css({color:'#548f1e'})},function(e){var $targetul=$(this).children("ul:eq(0)")
$targetul.animate({width:'hide',opacity:'hide'},ddsmoothmenu.transition.outtime)
$(this).css({background:'none'})
$(this).css({color:'#374853'})})})
$mainmenu.find("ul").css({display:'none',visibility:'visible'})},init:function(setting){if(typeof setting.customtheme=="object"&&setting.customtheme.length==2){var mainmenuid='#'+setting.mainmenuid
document.write('<style type="text/css">\n'
+mainmenuid+', '+mainmenuid+' ul li a {background:'+setting.customtheme[0]+';}\n'
+mainmenuid+' ul li a:hover {background:'+setting.customtheme[1]+';}\n'
+'</style>')}
jQuery(document).ready(function($){if(typeof setting.contentsource=="object"){ddsmoothmenu.getajaxmenu($,setting)}
else{ddsmoothmenu.buildmenu($,setting)}});}}
ddsmoothmenu.init({mainmenuid:"smoothmenu1",contentsource:"markup"})
