jQuery(document).ready(function() {
	
	// HOVER NAVIGATION
	$(".nav li").hover(function() {
		$(this).find("div").css("visibility","visible");
		$(this).find(".bg-nav-left").show();
		$(this).find(".bg-nav-right").show();
		$(this).find(".submenu").fadeIn(200);
		$(this).find(".main").css("backgroundColor","#EBEBEB");
		
	}, function() {
		$(this).find(".bg-nav-left").hide();
		$(this).find(".bg-nav-right").hide();
		$(this).find(".submenu").fadeOut(200);
		$(this).find(".main").css("backgroundColor","#FFFFFF");
	});
	
	// HOVER NAVIGATION.ACTIVE
	$(".nav li.active").hover(function() {
		$(this).find("div").css("visibility","visible");
		$(this).find(".bg-nav-left").show();
		$(this).find(".bg-nav-right").show();
		$(this).find(".main").css("backgroundColor","#333");
		$(this).find(".submenu a").css({
			 color: '#666',
			 backgroundColor: '#FFF'
		});
		
	}, function() {
		$(this).find(".bg-nav-left").show();
		$(this).find(".bg-nav-right").show();
		$(this).find(".main").css("backgroundColor","#333");	
	});
	
	$(".submenu a").hover(function() {
		$(this).css({
			 color: '#538b8e',
			 backgroundColor: '#e2edee'
		});
		
	}, function() {
		$(this).css({
			 color: '#666',
			 backgroundColor: '#FFF'
		});
	});	
	
	// FOKUS NAVIGATION ( KEYBOARD )
	$(".nav li a").focus(function() {
		$(this).parent().find("div").css("visibility","visible");
		$(this).parent().find(".bg-nav-left").show();
		$(this).parent().find(".bg-nav-right").show();
		$(this).parent().find(".submenu").fadeIn(200);
		$(this).parent().next().find(".submenu").fadeOut(200);
		$(this).parent().prev().find(".submenu").fadeOut(200);
		$(this).css("backgroundColor","#e2edee");
	});
	
	$(".nav li a").blur(function() {
		$(this).parent().find(".bg-nav-left").hide();
		$(this).parent().find(".bg-nav-right").hide();
		$(this).css("backgroundColor","#FFFFFF");
	});

	// FOKUS NAVIGATION.ACTIVE ( KEYBOARD )
	$(".nav li.active a").focus(function() {
		$(this).parent().find(".bg-nav-left").show();
		$(this).parent().find(".bg-nav-right").show();
		$(this).css("backgroundColor","#333");
		$(this).parent().find(".submenu a").css({
			 color: '#666',
			 backgroundColor: '#FFF'
		});
	});
	
	$(".nav li.active a").blur(function() {
		$(this).parent().find(".bg-nav-left").show();
		$(this).parent().find(".bg-nav-right").show();																				
		$(this).css("backgroundColor","#333");
	});
	
	$(".submenu a").focus(function() {
		$(this).css({
			 color: '#538b8e',
			 backgroundColor: '#e2edee'
		});
	});
	
	$(".submenu a").blur(function() {
		$(this).css({
			 color: '#666',
			 backgroundColor: '#FFF'
		});
	});		
	
});