/*********************
//* jQuery Drop Line Menu- By Dynamic Drive: http://www.dynamicdrive.com/
//* Last updated: June 27th, 09'
//* Menu avaiable at DD CSS Library: http://www.dynamicdrive.com/style/
*********************/

var droplinemenu={

	arrowimage: {classname: 'downarrowclass', src: 'down.gif', leftpadding: 5}, //customize down arrow image
	animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds
	
	buildmenu:function(menuid, activecolor){
		jQuery(document).ready(function($){
			var $mainmenu=$("#"+menuid+">ul")
			var $headers=$mainmenu.find("ul").parent()
			$headers.each(function(i){
				var $curobj=$(this)
				var $subul=$(this).find('ul:eq(0)')
				this._dimensions={h:$curobj.find('a:eq(0)').outerHeight()}
				this.istopheader=$curobj.parents("ul").length==1? true : false
				if (!this.istopheader)
					$subul.css({left:0, top:this._dimensions.h});
					
				$curobj.hover(
					function(e){
						var $targetul = $(this).children("ul:eq(0)");		
						$curobj.find('a').css({background: activecolor});
						$targetul.show(/*droplinemenu.animateduration.over*/);							
					},
					function(e){
						var $targetul = $(this).children("ul:eq(0)");
						$curobj.find('a').css({background: 'transparent'});
						$targetul.hide(/*droplinemenu.animateduration.out*/)
					}
				) //end hover
			}) //end $headers.each()
			$mainmenu.find("ul").css({display:'none', visibility:'visible', width:$mainmenu.width()})
		}) //end document.ready
	}
}