$(document).ready(function(){
	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	//Remove outline from links
	$("#menu ul:eq(0) a").click(function(){
		$(this).blur();
	});
	
	//When mouse rolls over
	$("#menu ul:eq(0) li").mouseover(function(){
		var ile = $(this).find("ul li").length;
		var height = 41 + ile * 30;
		
		$(this).stop().animate({height: height},{queue:false, duration:600, easing: 'easeOutBounce'});
		if(ile>0){
			$(this).addClass('ui-corner-bottom');
		}
		
	});
	
	//When mouse is removed
	$("#menu ul:eq(0) li").mouseout(function(){
		$(this).stop().animate({height:'41px'},{queue:false, duration:600, easing: 'easeOutBounce'});
		$(this).removeClass('ui-corner-bottom');
	});
	
});
