var droplinemenu={

	animateduration: {over: 200, out: 100}, //duration of slide in/ out animation, in milliseconds
	
	buildmenu:function(menuid){
		jQuery(document).ready(function($){
			var $mainmenu=$("#"+menuid+">.navmere").eq(0);
			var $headers=$mainmenu.find('.navheader');
			var $current;
			$headers.each(function(i){
				var $curobj=$(this);
				var $subul=$('#ulcontent').find('.sous_categorie');
				this._dimensions={h:$curobj.find('a:eq(0)').outerHeight()}
				this.istopheader=$curobj.parents(".navmere").length==1? true : false
				if (!this.istopheader)
					$subul.css({left:0, top:this._dimensions.h})
		
				$curobj.hover(function(e) {
					var $targetul=$(this).find('.sous_categorie');
					if ($('#ulcontent').queue().length<=1) {
						if (this.istopheader)
							//$('#ulcontent').css({left: $mainmenu.offset().left-23, top: $mainmenu.offset().top+this._dimensions.h-22, height:264});
							$('#ulcontent').css({left: $mainmenu.offset().left-23, top: $mainmenu.offset().top+this._dimensions.h-8});
						if (document.all && !window.XMLHttpRequest) //detect IE6 or less, fix issue with overflow
							$mainmenu.find('.sous_categorie').css({overflow: (this.istopheader)? 'hidden' : 'visible'});
						$('#ulcontent').html($targetul.html());
						$('#ulcontent').fadeIn('normal');
						$current = $(this);
					}
				}); //end $curobj.hover
				
				$('#ulcontent').hover(function(e){
					$current.find('a').addClass('current');
				}, function(e){
					$current.find('a').removeClass('current');
				});			
			}); //end $headers.each()
						
			$('#nav_previous').hover( function(e) {
				$('#ulcontent').fadeOut('fast');
			});
			
			$('#nav_next').hover( function(e) {
				$('#ulcontent').fadeOut('fast');
			});
				
			$('#'+menuid).hover(function(e){
			}, function(e){
				$('#ulcontent').fadeOut('fast');				
			});
		}); //end document.ready
	}
}


