  $(document).ready(function () {
							  
							  $("div a:has(img)").not('div.accordion-holder a').fancybox();
							  
							  $('.dropdown').each(function () {
$(this).parent().eq(0).hoverIntent({
timeout: 300,
over: function () {
var current = $('.dropdown:eq(0)', this);
current.slideDown(500);
},
out: function () {
var current = $('.dropdown:eq(0)', this);
current.slideUp();
}
});
});
							  
								var  clicked = false;

						color = $(".background_box").css('backgroundColor');
						
function hideAll() {
		$('#hometrigger').unbind();
		$('#abouttrigger').unbind();
		$('#producttrigger').unbind();
		$('#gallerytrigger').unbind();
		$('#blogtrigger').unbind();
		$('#contacttrigger').unbind();

}
						
$(".nav").click(function () {
								var  clicked = true;
								  })




$("body:not(.home) #hometrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
									  
	$('#foam_tile').stop(true, true).fadeIn(500);
	$('#foam_tile').css('z-index', 999);
	$(".background_box").stop(true).animate({ backgroundColor: '#617972' }, 500 );
	
}).mouseleave( function(){
			
			if (clicked == false){
						$('#foam_tile').css('z-index', 998);

	$('#foam_tile').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ backgroundColor: color}, 500 );

			}
			else {clicked=false}
   });



$("body:not(.page-id-2) #abouttrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
	$('#red_wine').stop(true, true).fadeIn(500);
	$(".background_box").stop(true).animate({ backgroundColor: '#845046' }, 500 );
	$('#red_wine').css('z-index', 999);
        }).mouseleave( function(){
			if (clicked == false) {
	
	$('#red_wine').css('z-index', 998);
	$('#red_wine').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ backgroundColor: color}, 500 );

			}
   });


$("body:not(.page-id-66)#producttrigger, body:not(.parent-pageid-66) #producttrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
	$('#orange_kitchen').stop(true, true).fadeIn(500);
	$(".background_box").stop(true).animate({ backgroundColor: '#c07739' }, 500 );
	$('#orange_kitchen').css('z-index', 999);
        }).mouseleave( function(){
						if (clicked == false) {
		$('#orange_kitchen').css('z-index', 998);

	$('#orange_kitchen').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ backgroundColor: color}, 500 );

						}
   });



$("#gallerytrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
	$('#tan_tile').stop(true, true).fadeIn(500);
	$(".background_box").stop(true).animate({ backgroundColor: '#897053' }, 500 );
	$('#tan_tile').css('z-index', 999);
        }).mouseleave( function(){
						if (clicked == false) {
	$('#tan_tile').css('z-index', 998);
	$('#tan_tile').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ backgroundColor: color}, 500 );
						}
   });


$("#blogtrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
	$('#glass_tile').stop(true, true).fadeIn(500);
	$(".background_box").stop(true).animate({ backgroundColor: '#7e9daf' }, 500 );
		$('#glass_tile').css('z-index', 999);


        }).mouseleave( function(){
			if (clicked == false) {
						$('#glass_tile').css('z-index', 998);

	$('#glass_tile').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ backgroundColor: color}, 500 );
			}
   });




$("#contacttrigger").click(function () {
								var  clicked = true;
									hideAll();

								  }).mouseenter(function () { 
	$('#blue_tub').stop(true, true).fadeIn(500);
	$(".background_box").stop(true).animate({ backgroundColor: '#3d6c8d' }, 500 );
						$('#blue_tub').css('z-index', 999);

        }).mouseleave( function(){
						if (clicked == false) {
						$('#blue_tub').css('z-index', 998);
	$('#blue_tub').stop(true, true).fadeOut(500)
	$(".background_box").stop(true).animate({ 'backgroundColor': color}, 500 );
						}
   });


});

