/*********************
//* jQuery Multi Level CSS Menu #2- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last update: Nov 7th, 08': Limit # of queued animations to minmize animation stuttering
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

//Specify full URL to down and right arrow images (23 is padding-right to add to top level LIs with drop downs):
var arrowimagesvert={down:['downarrowclassvert', 'http://nwk07/css/rightvert.gif', 23], right:['rightarrowclassvert', 'http://nwk07/css/rightvert.gif']}

var jqueryslidemenuvert={

animatedurationvert: {over: 400, out: 400}, //duration of slide in/ out animation, in milliseconds

buildmenuvert:function(menuid, arrowsvar){
	jQuery(document).ready(function($){
		var $mainmenuvert=$("#"+menuid+">ul")
		var $headersvert=$mainmenuvert.find("ul").parent()
		$headersvert.each(function(i){
			var $curobjvert=$(this)
			var $subulvert=$(this).find('ul:eq(0)')
			this._dimensions={w:this.offsetWidth, h:this.offsetHeight, subulwvert:$subulvert.outerWidth(), subulhvert:$subulvert.outerHeight()}
			this.istopheader=$curobjvert.parents("ul").length==1? true : false
			$subulvert.css({top:this.istopheader? this._dimensions.h+"px" : 0})
			$curobjvert.children("a:eq(0)").append(
				'<img src="'+ (this.istopheader? arrowsvar.down[1] : arrowsvar.right[1])
				+'" class="' + (this.istopheader? arrowsvar.down[0] : arrowsvar.right[0])
				+ '" style="border:0;" />'
			)
			$curobjvert.hover(
				function(e){
					var $targetulvert=$(this).children("ul:eq(0)")
					this._offsets={left:$(this).offset().left, top:$(this).offset().top}
					var menuleftvert=this.istopheader? 191 : this._dimensions.w
					menuleftvert=(this._offsets.left+menuleftvert+this._dimensions.subulwvert>$(window).width())? (this.istopheader? -this._dimensions.subulwvert+this._dimensions.w : -this._dimensions.w) : menuleftvert
					if ($targetulvert.queue().length<=1) //if 1 or less queued animations
						$targetulvert.css({left:menuleftvert+"px", top:0, width:this._dimensions.subulwvert+'px'}).slideDown(jqueryslidemenuvert.animatedurationvert.over)
				},
				function(e){
					var $targetulvert=$(this).children("ul:eq(0)")
					$targetulvert.slideUp(jqueryslidemenuvert.animatedurationvert.out)
				}
			) //end hover
		}) //end $headers.each()
		$mainmenuvert.find("ul").css({display:'none', visibility:'visible'})
	}) //end document.ready
}
}

//build menu with ID="myslidemenu" on page:
jqueryslidemenuvert.buildmenuvert("myslidemenuvert", arrowimagesvert)