$(document).ready(function(){
   /* maxWidth = 240;
    minWidth = 140;	
	lastBlock = $("#a1");
	
    $("ul li a").hover(
		function(){
        	$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
			//$(lastBlock).next(".background").animate({width: minWidth+"px", opacity:0}, { queue:false, duration:400 });
			//$(lastBlock).parent().animate({backgroundColor:"rgba(234,88,34,0)"}, { queue:false, duration:400 });
			
			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400 });
			//$(this).next(".background").animate({width: maxWidth+"px", opacity:1}, { queue:false, duration:400 });
			//$(this).parent().animate({backgroundColor:"rgba(234,88,34,1)"}, { queue:false, duration:400});
			//$(this).next("div").slideDown();
			
			lastBlock = this;
      	},
		function(){
        	$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
			//$(lastBlock).next(".background").animate({width: minWidth+"px", opacity:0}, { queue:false, duration:400 });
			//$(lastBlock).parent().animate({backgroundColor:"rgba(234,88,34,0)"}, { queue:false, duration:400 });
			
		}
    );*/
	
	var $oe_menu		= $('#menu ul');
	var $oe_menu_items	= $oe_menu.children('li');

	$oe_menu_items.bind('mouseenter',function(){
		var $this = $(this);
		$this.addClass('slided selected');
		$this.children('div').css('z-index','9999').stop(true,true).slideDown(600,function(){
			$oe_menu_items.not('.slided').children('div').hide();
			$this.removeClass('slided');
		});
		}).bind('mouseleave',function(){
			var $this = $(this);
			$this.removeClass('selected').children('div').css('z-index','1');
		});
	
	$oe_menu.bind('mouseenter',function(){
		var $this = $(this);
		//$oe_overlay.stop(true,true).fadeTo(200, 0.6);
		$this.addClass('hovered');
		}).bind('mouseleave',function(){
		var $this = $(this);
		$this.removeClass('hovered');
		//$oe_overlay.stop(true,true).fadeTo(200, 0);
		$oe_menu_items.children('div').hide();
		});


	
	
});
