//** Smooth Navigational Menu- By Dynamic Drive DHTML code library: http://www.dynamicdrive.com
//** Script Download/ instructions page: http://www.dynamicdrive.com/dynamicindex1/ddlevelsmenu/
//** Menu created: Nov 12, 2008
var ddsmoothmenu={arrowimages:{down:["downarrowclass","images/down.gif",17],right:["rightarrowclass","images/right.gif"]},transition:{overtime:250,outtime:500},shadow:{enable:false,offsetx:1,offsety:1},showhidedelay:{showdelay:100,hidedelay:200},detectwebkit:navigator.userAgent.toLowerCase().indexOf("applewebkit")!=-1,detectie6:document.all&&!window.XMLHttpRequest,getajaxmenu:function(a,d){var c=a("#"+d.contentsource[0]);c.html("Loading Menu...");a.ajax({url:d.contentsource[1],async:true,error:function(g){c.html("Error fetching content. Server Response: "+ g.responseText)},success:function(g){c.html(g);ddsmoothmenu.buildmenu(a,d)}})},buildmenu:function(a,d){var c=ddsmoothmenu,g=a("#"+d.mainmenuid+">ul");g.parent().get(0).className=d.classname||"ddsmoothmenu";var i=g.find("ul").parent();i.hover(function(){a(this).children("a:eq(0)").addClass("selected")},function(){a(this).children("a:eq(0)").removeClass("selected")});i.each(function(j){var f=a(this).css({zIndex:100-j}),e=a(this).find("ul:eq(0)").css({display:"block"});e.data("timers",{});this._dimensions= {w:this.offsetWidth,h:this.offsetHeight,subulw:e.outerWidth(),subulh:e.outerHeight()};this.istopheader=f.parents("ul").length==1?true:false;e.css({top:this.istopheader&&d.orientation!="v"?this._dimensions.h+"px":0});f.children("a:eq(0)").css(this.istopheader?{paddingRight:c.arrowimages.down[2]}:{}).append('<img src="'+(this.istopheader&&d.orientation!="v"?c.arrowimages.down[1]:c.arrowimages.right[1])+'" class="'+(this.istopheader&&d.orientation!="v"?c.arrowimages.down[0]:c.arrowimages.right[0])+'" style="border:0;" />'); if(c.shadow.enable){this._shadowoffset={x:this.istopheader?e.offset().left+c.shadow.offsetx:this._dimensions.w,y:this.istopheader?e.offset().top+c.shadow.offsety:f.position().top};$parentshadow=this.istopheader?a(document.body):f.parents("li:eq(0)").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"})}f.hover(function(){var b=f.get(0);clearTimeout(e.data("timers").hidetimer); e.data("timers").showtimer=setTimeout(function(){b._offsets={left:f.offset().left,top:f.offset().top};var h=b.istopheader&&d.orientation!="v"?0:b._dimensions.w;h=b._offsets.left+h+b._dimensions.subulw>a(window).width()?b.istopheader&&d.orientation!="v"?-b._dimensions.subulw+b._dimensions.w:-b._dimensions.w:h;if(e.queue().length<=1){e.css({left:h+"px",width:b._dimensions.subulw+"px"}).animate({height:"show",opacity:"show"},ddsmoothmenu.transition.overtime);if(c.shadow.enable){h=b.istopheader?e.offset().left+ ddsmoothmenu.shadow.offsetx:h;var k=b.istopheader?e.offset().top+c.shadow.offsety:b._shadowoffset.y;!b.istopheader&&ddsmoothmenu.detectwebkit&&b.$shadow.css({opacity:1});b.$shadow.css({overflow:"",width:b._dimensions.subulw+"px",left:h+"px",top:k+"px"}).animate({height:b._dimensions.subulh+"px"},ddsmoothmenu.transition.overtime)}}},ddsmoothmenu.showhidedelay.showdelay)},function(){var b=f.get(0);clearTimeout(e.data("timers").showtimer);e.data("timers").hidetimer=setTimeout(function(){e.animate({height:"hide", opacity:"hide"},ddsmoothmenu.transition.outtime);if(c.shadow.enable){ddsmoothmenu.detectwebkit&&b.$shadow.children("div:eq(0)").css({opacity:0});b.$shadow.css({overflow:"hidden"}).animate({height:0},ddsmoothmenu.transition.outtime)}},ddsmoothmenu.showhidedelay.hidedelay)})});g.find("ul").css({display:"none",visibility:"visible"})},init:function(a){if(typeof a.customtheme=="object"&&a.customtheme.length==2){var d="#"+a.mainmenuid;document.write('<style type="text/css">\n'+(a.orientation=="v"?d:d+", "+ d)+" ul li a {background:"+a.customtheme[0]+";}\n"+d+" 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(c){typeof a.contentsource=="object"?ddsmoothmenu.getajaxmenu(c,a):ddsmoothmenu.buildmenu(c,a)})}};
