$(document).ready(function(){
	// dropdown animation
	$("#nav ul li").hover(function(){
		$(this).find('ul:first').css({visibility:"visible",display:"none"})
			.stop(true,true)
			.animate({top:"0"},0)
			.animate({opacity:"show",top:"20"},400,"easeOutQuad");
	},function(){
		$(this).find('ul:first').css({display:"block"}).animate({opacity:"hide"},400);
	});

	// IE fix: "li:hover"
	$("#nav ul li").hover(function(){
		$(this).addClass("hover");
	},function(){
		$(this).removeClass("hover");
	});
	
	// maintain hover
	$("#nav ul ul").hover(function(){
		$(this).parent().find("a:first").addClass("hover");
	},function(){
		$(this).parent().find("a:first").removeClass("hover");
	});

	// add more arrow
	$("#nav ul li ul li:has(ul)").addClass("more");
});