//** 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
//** dec 12th, 08" (v1.01): fixed shadow issue when multiple lis within the same ul (level) contain sub menus: http://www.dynamicdrive.com/forums/showthread.php?t=39177&highlight=smooth
//** feb 11th, 09" (v1.02): the currently active main menu item (li a) now gets a css class of ".selected", including sub menu items.
//** may 1st, 09" (v1.3):
//** 1) now supports vertical (side bar) menu mode- set "orientation" to 'v'
//** 2) in ie6, shadows are now always disabled
//** july 27th, 09" (v1.31): fixed bug so shadows can be disabled if desired.
//** feb 2nd, 10" (v1.4): adds ability to specify delay before sub menus appear and disappear, respectively. see showhidedelay variable below
//** dec 17th, 10" (v1.5): updated menu shadow to use css3 box shadows when the browser is ff3.5+, ie9+, opera9.5+, or safari3+/chrome. only .js file changed.
var ddsmoothmenu={
//specify full url to down and right arrow images (23 is padding-right added to top level lis with drop downs):
arrowimages: {down:['downarrowclass', 'down.gif', 0], right:['rightarrowclass', '../internet/images/right.gif']},
transition: {overtime:300, outtime:300}, //duration of slide in/ out animation, in milliseconds
shadow: {enable:true, offsetx:0, offsety:0}, //enable shadow?
showhidedelay: {showdelay: 0, hidedelay: 0}, //set delay in milliseconds before sub menus appear and disappear, respectively
///////stop configuring beyond here///////////////////////////
detectwebkit: navigator.useragent.tolowercase().indexof("applewebkit")!=-1, //detect webkit browsers (safari, chrome etc)
detectie6: document.all && !window.xmlhttprequest,
css3support: window.msperformance || (!document.all && document.queryselector), //detect browsers that support css3 box shadows (ie9+ or ff3.5+, safari3+, chrome etc)
getajaxmenu:function($, setting){ //function to fetch external page containing the panel divs
var $menucontainer=$('#'+setting.contentsource[0]) //reference empty div on page that will hold menu
$menucontainer.html("loading menu...")
$.ajax({
url: setting.contentsource[1], //path to external menu file
async: true,
error:function(ajaxrequest){
$menucontainer.html('error fetching content. server response: '+ajaxrequest.responsetext)
},
success:function(content){
$menucontainer.html(content)
ddsmoothmenu.buildmenu($, setting)
}
})
},
buildmenu:function($, setting){
var smoothmenu=ddsmoothmenu
var $mainmenu=$("#"+setting.mainmenuid+">ul") //reference main menu ul
$mainmenu.parent().get(0).classname=setting.classname || "ddsmoothmenu"
var $headers=$mainmenu.find("ul").parent()
$headers.hover(
function(e){
$(this).children('a:eq(0)').addclass('selected')
},
function(e){
$(this).children('a:eq(0)').removeclass('selected')
}
)
$headers.each(function(i){ //loop through each li header
var $curobj=$(this).css({zindex: 100-i}) //reference current li header
var $subul=$(this).find('ul:eq(0)').css({display:'block'})
$subul.data('timers', {})
this._dimensions={w:this.offsetwidth, h:this.offsetheight, subulw:$subul.outerwidth(), subulh:$subul.outerheight()}
this.istopheader=$curobj.parents("ul").length==1? true : false //is top level header?
$subul.css({top:this.istopheader && setting.orientation!='v'? this._dimensions.h+"px" : 0})
$curobj.children("a:eq(0)").css(this.istopheader? {} : {}).append( //add arrow images
''
)
if (smoothmenu.shadow.enable && !smoothmenu.css3support){ //if shadows enabled and browser doesn't support css3 box shadows
this._shadowoffset={x:(this.istopheader?$subul.offset().left+smoothmenu.shadow.offsetx : this._dimensions.w), y:(this.istopheader? $subul.offset().top+smoothmenu.shadow.offsety : $curobj.position().top)} //store this shadow's offsets
if (this.istopheader)
$parentshadow=$(document.body)
else{
var $parentli=$curobj.parents("li:eq(0)")
$parentshadow=$parentli.get(0).$shadow
}
this.$shadow=$('