// JavaScript Document

var image_path = "";

var kitchen_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/VillaMHbLinMDv_Kn?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var kitchen_dropdown_description = "Kitchen Cabinets";
var bathroom_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/BlakelMPe_Ba?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var bathroom_dropdown_description = "Bathroom Cabinets";
var other_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/AshtonCherryLight?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var other_dropdown_description = "Other Rooms";
var organization_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/Tho.PYopn.A?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var organization_dropdown_description = "Organization Cabinets";
var accents_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/Tho.PlateRkMDv.A ?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var accents_dropdown_description = "Custom Accents";
var offers_dropdown_image = "http://www.thomasvillecabinetry.com.php5-14.websitetestlink.com/css/global/nav/image_1.jpg";
var offers_dropdown_description = "Offers";

//Begin Nouveau Variables
var Nouveau_kitchen_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/AnsonCRh.K2?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var Nouveau_kitchen_dropdown_description = "Kitchen Cabinets";
var Nouveau_bathroom_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/CrosseFRo.B?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var Nouveau_bathroom_dropdown_description = "Bathroom Cabinets";
var Nouveau_other_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/JulesCMuCrosseFly.O2?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var Nouveau_other_dropdown_description = "Other Rooms";
var Nouveau_organization_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/TCA.TallUnitFLys.S?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var Nouveau_organization_dropdown_description = "Organization Cabinets";
var Nouveau_accents_dropdown_image = "http://s7d5.scene7.com/is/image/brandlicensing/TCA.AlumDoorBOWa.A?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var Nouveau_accents_dropdown_description = "Custom Accents";
var Nouveau_offers_dropdown_image = "http://www.thomasvillecabinetry.com.php5-14.websitetestlink.com/css/global/nav/image_1.jpg";
var Nouveau_offers_dropdown_description = "Offers";
//End Nouveau Variables


$(document).ready(function() 
{
	$("#kitchen_nav").mouseover(function(){
		$("#kitchen_dropdown").show();
		$("#kitchen_dropdown .first img").attr("src", image_path + kitchen_dropdown_image);
		$("#kitchen_dropdown .first p").html(kitchen_dropdown_description);
	});
	$("#kitchen_nav").mouseout(function(){
		$("#kitchen_dropdown").hide();
	});
	$("#kitchen_dropdown").hover(
		function(){$("#kitchen_dropdown").show();}, 
		function(){$("#kitchen_dropdown").hide();}
	);

	$("#other_nav").mouseover(function(){
		$("#other_dropdown").show();
		$("#other_dropdown .first img").attr("src", image_path + other_dropdown_image);
		$("#other_dropdown .first p").html(other_dropdown_description);							
	});
	$("#other_nav").mouseout(function(){
		$("#other_dropdown").hide();									
	});
	$("#other_dropdown").hover(
		function(){$("#other_dropdown").show();}, 
		function(){$("#other_dropdown").hide();}
	);
	
	$("#bathroom_nav").mouseover(function(){
		$("#bathroom_dropdown").show();
		$("#bathroom_dropdown .first img").attr("src", image_path + bathroom_dropdown_image);
		$("#bathroom_dropdown .first p").html(bathroom_dropdown_description);								
	});
	$("#bathroom_nav").mouseout(function(){
		$("#bathroom_dropdown").hide();									
	});
	$("#bathroom_dropdown").hover(
		function(){$("#bathroom_dropdown").show();}, 
		function(){$("#bathroom_dropdown").hide();}
	);
	
	$("#organization_nav").mouseover(function(){
		$("#organization_dropdown").show();
		$("#organization_dropdown .first img").attr("src", image_path + organization_dropdown_image);
		$("#organization_dropdown .first p").html(organization_dropdown_description);								
	});
	$("#organization_nav").mouseout(function(){
		$("#organization_dropdown").hide();									
	});
	$("#organization_dropdown").hover(
		function(){$("#organization_dropdown").show();}, 
		function(){$("#organization_dropdown").hide();}
	);
	
	$("#accents_nav").mouseover(function(){
	    $("#accents_dropdown").show();
	    $("#accents_dropdown .first img").attr("src", image_path + accents_dropdown_image);
	    $("#accents_dropdown .first p").html(accents_dropdown_description);									
	});
	$("#accents_nav").mouseout(function() {
	    $("#accents_dropdown").hide();									
	});
	$("#accents_dropdown").hover(
		function() { $("#accents_dropdown").show(); },
		function() { $("#accents_dropdown").hide(); }
	);
	
	$("#offers_nav").mouseover(function(){
		$("#offers_dropdown").show();
		$("#offers_dropdown .first img").attr("src", image_path + offers_dropdown_image);
		$("#offers_dropdown .first p").html(offers_dropdown_description);									
	});
	$("#offers_nav").mouseout(function(){
		$("#offers_dropdown").hide();									
	});
	$("#offers_dropdown").hover(
		function(){$("#offers_dropdown").show();}, 
		function(){$("#offers_dropdown").hide();}
	);
	//Start Nouveau Functions
	$("#Nouveau_kitchen_nav").mouseover(function() {
	$("#Nouveau_kitchen_dropdown").show();
	$("#Nouveau_kitchen_dropdown .first img").attr("src", image_path + Nouveau_kitchen_dropdown_image);
	$("#Nouveau_kitchen_dropdown .first p").html(Nouveau_kitchen_dropdown_description);
	});
	$("#Nouveau_kitchen_nav").mouseout(function() {
	$("#Nouveau_kitchen_dropdown").hide();
	});
	$("#Nouveau_kitchen_dropdown").hover(
		function() { $("#Nouveau_kitchen_dropdown").show(); },
		function() { $("#Nouveau_kitchen_dropdown").hide(); }
	);

	$("#Nouveau_other_nav").mouseover(function() {
	$("#Nouveau_other_dropdown").show();
	$("#Nouveau_other_dropdown .first img").attr("src", image_path + Nouveau_other_dropdown_image);
	$("#Nouveau_other_dropdown .first p").html(Nouveau_other_dropdown_description);
	});
	$("#Nouveau_other_nav").mouseout(function() {
	$("#Nouveau_other_dropdown").hide();
	});
	$("#Nouveau_other_dropdown").hover(
		function() { $("#Nouveau_other_dropdown").show(); },
		function() { $("#Nouveau_other_dropdown").hide(); }
	);

	$("#Nouveau_bathroom_nav").mouseover(function() {
	$("#Nouveau_bathroom_dropdown").show();
	$("#Nouveau_bathroom_dropdown .first img").attr("src", image_path + Nouveau_bathroom_dropdown_image);
	$("#Nouveau_bathroom_dropdown .first p").html(Nouveau_bathroom_dropdown_description);
	});
	$("#Nouveau_bathroom_nav").mouseout(function() {
	$("#Nouveau_bathroom_dropdown").hide();
	});
	$("#Nouveau_bathroom_dropdown").hover(
		function() { $("#Nouveau_bathroom_dropdown").show(); },
		function() { $("#Nouveau_bathroom_dropdown").hide(); }
	);

	$("#Nouveau_organization_nav").mouseover(function() {
	$("#Nouveau_organization_dropdown").show();
	$("#Nouveau_organization_dropdown .first img").attr("src", image_path + Nouveau_organization_dropdown_image);
	$("#Nouveau_organization_dropdown .first p").html(Nouveau_organization_dropdown_description);
	});
	$("#Nouveau_organization_nav").mouseout(function() {
	$("#Nouveau_organization_dropdown").hide();
	});
	$("#Nouveau_organization_dropdown").hover(
		function() { $("#Nouveau_organization_dropdown").show(); },
		function() { $("#Nouveau_organization_dropdown").hide(); }
	);

	$("#Nouveau_accents_nav").mouseover(function() {
	$("#Nouveau_accents_dropdown").show();
	$("#Nouveau_accents_dropdown .first img").attr("src", image_path + Nouveau_accents_dropdown_image);
	$("#Nouveau_accents_dropdown .first p").html(Nouveau_accents_dropdown_description);
	});
	$("#Nouveau_accents_nav").mouseout(function() {
	$("#Nouveau_accents_dropdown").hide();
	});
	$("#Nouveau_accents_dropdown").hover(
		function() { $("#Nouveau_accents_dropdown").show(); },
		function() { $("#Nouveau_accents_dropdown").hide(); }
	);

	$("#Nouveau_offers_nav").mouseover(function() {
	$("#Nouveau_offers_dropdown").show();
	$("#Nouveau_offers_dropdown .first img").attr("src", image_path + Nouveau_offers_dropdown_image);
	$("#Nouveau_offers_dropdown .first p").html(Nouveau_offers_dropdown_description);
	});
	$("#Nouveau_offers_nav").mouseout(function() {
	$("#Nouveau_offers_dropdown").hide();
	});
	$("#Nouveau_offers_dropdown").hover(
		function() { $("#Nouveau_offers_dropdown").show(); },
		function() { $("#Nouveau_offers_dropdown").hide(); }
	);
	//End Nouveau Functions
	
	$(".dropdown li ul li a").each(function(){
		$(this).hover(
			function(){
				$(".dropdown:block .first p").html($(this).attr("title"));
				$(".dropdown:block .first img").attr("src", image_path + $(this).attr("rel"));
			},
			function(event){
				if(!$(event.relatedTarget).is("a")){
					var dropdown = $(this).closest(".dropdown");
					$(dropdown).find(".first img").attr("src", image_path + eval($(dropdown).attr("id") + "_image"));
					$(dropdown).find(".first p").html(eval($(dropdown).attr("id") + "_description"));
				}
			}
		);
	});
	
	$(".dropdown").each(function(){
		$(this).width(($(this).children().size()-2)*200+360);
	});
	
});