$(document).ready(function() {
	$('#nav ul ul.sub_nav').hide();
	$('#nav ul ul.sub_nav').css('visibility','visible');
	var subOpen = false;
	
	$('#nav ul li#custom-drop').mouseover(function() {
		$('#nav ul ul.sub_nav').fadeIn(300);
	});
	$('#nav ul li#custom-drop').mouseleave(function() {
		$('#nav ul ul.sub_nav').fadeOut(300, function(){
			subOpen = false;
			$('#nav ul li#custom-drop ul li').find("img").css('opacity',0);
			$('#nav ul li#custom-drop ul li').find("img").css('margin',0);
		});
	});
	
	$('#nav ul ul li.top-lvl1').mouseover(function() {
		$(this).find("img").stop();
		$(this).find("img").animate(
			{
				opacity: 1,
				marginLeft: "14px"
			},
			200
		);
	});
	$('#nav ul ul li.top-lvl1').mouseout(function() {
		$(this).find("img").stop();
		$(this).find("img").animate(
			{
				opacity: 0,
				marginLeft: "0px"
			},
			200
		);
	});
	
	$("#nav ul li.top-lvl").mouseenter(function() {
		$(this).find("img").stop();
		var temp = $(this).find("img");
		temp.eq(0).animate(
			{
				opacity: 1,
				marginLeft: "14px"
			},
			200
		);
	});
	$("#nav ul li.top-lvl").mouseleave(function() {
		$(this).find("img").stop();
		var temp = $(this).find("img");
		temp.eq(0).animate(
			{
				opacity: 0,
				marginLeft: "0px"
			},
			200
		);
	});
	$("#nav ul li.top-lvl img").css("opacity", 0);
		
		$("#subnav > li").mouseover(function() {
			$(this).find("img").stop();
			$(this).find("img").animate(
				{
					opacity: 1,
					marginLeft: "14px"
				},
				200
			);
		});
		$("#subnav > li").mouseleave(function() {
			$(this).find("img").stop();
			$(this).find("img").animate(
				{
					opacity: 0,
					marginLeft: "0px"
				},
				200
			);
		});
		$("#subnav > li img").css("opacity", 0);
		
	$(".btn1").mouseover(function() {
		$(this).stop();
		$(this).animate(
			{
				backgroundColor: "#161616"
			},
			200
		);
	});
	$(".btn1").mouseleave(function() {
		$(this).stop();
		$(this).animate(
			{
				backgroundColor: "#292929"
			},
			200
		);
	});
	$(".btn2").mouseover(function() {
		$(this).find("img").stop();
		$(this).find("img").animate(
			{
				opacity: 1,
				left: "-12px"
			},
			200
		);
	});
	$(".btn2").mouseleave(function() {
		$(this).find("img").stop();
		$(this).find("img").animate(
			{
				opacity: 0,
				left: "-26px"
			},
			200
		);
	});
	$(".btn2 img").css({opacity:"0"});
});