$.fn.coolMenu = function (callerSettings){
	var defaultSettings = {
		hideSpeed : 100,
		showSpeed : 100,
		hideDelay : 200,
		showDelay : 100,
		toggleDelay : 200	
		};
		
	//var overChild = false;
	var showItemMenuTimer;
	var hideItemMenuTimer;
	
	function isAnyVisible(){
		result = false;
		$(this).children('li').each(function(){
				if($(this).children('div.mainContent').css('display') == 'block')
					result = true;																				 
				});
		return result;
	}
	
	var settings = $.extend(defaultSettings, callerSettings||{});
		
	
	$.fn.showMenuItem = function(){
		
			var e = this;
			$('.topMenu').removeClass('hoverTopMenu');
			$(e).find('.topMenu').addClass('hoverTopMenu');
			clearTimeout(showItemMenuTimer);
			clearTimeout(hideItemMenuTimer);
			showItemMenuTimer =	setTimeout(function(){
													$(e).siblings().children('.mainMenuContent').not($(e).find('.mainMenuContent')).hide();
													return $(e).find('.mainMenuContent').slideDown({
																							duration: defaultSettings.showSpeed, 
																							easing: 'easeOutExpo'});
													}, defaultSettings.showDelay);
	}	
	
	$.fn.hideMenuItem = function(){
	    
		
			var e = this;
			
			clearTimeout(showItemMenuTimer);
			clearTimeout(hideItemMenuTimer);
			hideItemMenuTimer =	setTimeout(function(){
													var ok = $(e).find('.mainMenuContent').slideUp({
																							duration: defaultSettings.hideSpeed, 
																							easing: 'easeOutExpo'});
													if (ok == false)
														return ok;
													return $(e).find('.topMenu').removeClass('hoverTopMenu');
													}, defaultSettings.hideDelay);
	}	
	
	
$(this).children('li')
		.children('div.mainMenuContent').hover(
																				function(){																					
																					clearTimeout(showItemMenuTimer);
																					clearTimeout(hideItemMenuTimer);
																				},
																				function(){
																					clearTimeout(showItemMenuTimer);
																					clearTimeout(hideItemMenuTimer);
																						/*	$('div.mainMenuContent:visible').each(function(){
																											hideMenu(this);																		 
																																													 });
																						hideMenu();*/
																					}
																				 );
	
	
	$.fn.hideAll = function(){
			$(this).children('li').children('.mainMenuContent:visible').hide();
			return this;
	}
	
	$(this).children('li')
			.hover(function(){	
			$(this).showMenuItem();
			}
			,function(){											
			$(this).hideMenuItem();																					
			});
}