jQuery.fn.dropmenu = function(){
	var $this = $(this);
	
	$this.children().each(function(){
		var $obj = $(this);
		var timer;
		
		if ($obj.find('.submenus').length > 0){
			$obj.find('a').hover(function(){
				var thisOff = $obj.offset();
				var thisL = thisOff.left;
				var thisT = thisOff.top;
				var thisB = thisT + $obj.outerHeight();
				clearTimeout(timer);
				$obj.find('.submenus').css({position: 'absolute', top: thisB+'px', left: thisL+'px', zIndex: 5000}).fadeIn();				
			}, function(){
				timer = setTimeout(function(){
					$obj.find('.submenus').hide();
				}, 500);
			});
			
			$obj.find('.submenus').hover(function(){
				clearTimeout(timer);			
			}, function(){
				timer = setTimeout(function(){
					$obj.find('.submenus').hide();
				}, 500);
			});
		}
		
		
	});
}
