// JavaScript Document

var image_path = "";

/*var home_dropdown_image = "http://s7d5.scene7.com/is/image/thomasville/144411_101002S_07?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0";
var home_dropdown_description = "Home";*/
var government_dropdown_image = "http://s7d5.scene7.com/is/image/thomasville/Govt?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var government_dropdown_description = "Government";
var hospitality_dropdown_image = "http://s7d5.scene7.com/is/image/thomasville/Hosp?ckill=1&op_sharpen=1&hei=115&wid=123&align=0,0&req=tmb";
var hospitality_dropdown_description = "Hospitality";
var healthcare_dropdown_image = "http://contract.thomasville.com.php5-19.websitetestlink.com/images/global/nav/image_default.jpg";
var healthcare_dropdown_description = "Healthcare";
var diy_dropdown_image = "http://contract.thomasville.com.php5-19.websitetestlink.com/images/global/nav/image_default.jpg";
var diy_dropdown_description = "Do It Yourself";
var ourbrands_dropdown_image = "http://contract.thomasville.com.php5-19.websitetestlink.com/images/global/nav/image_default.jpg";
var ourbrands_dropdown_description = "Contract Partners";
var portfolio_dropdown_image = "http://contract.thomasville.com.php5-19.websitetestlink.com/images/global/nav/image_default.jpg";
var portfolio_dropdown_description = "Portfolio";
var catalogs_dropdown_image = "http://s7d5.scene7.com/is/image/thomasville/Espresso_Blend_rs1?op_sharpen=1&hei=115&wid=123&req=tmb&align=0,0";
var catalogs_dropdown_description = "Catalogs";

$(document).ready(function() 
{
	/*$("#home_nav").mouseover(function(){
		$("#home_dropdown").show();
		$("#home_dropdown .first img").attr("src", image_path + home_dropdown_image);
		$("#home_dropdown .first p").html(home_dropdown_description);
	});
	$("#home_nav").mouseout(function(){
		$("#home_dropdown").hide();
	});
	$("#home_dropdown").hover(
		function(){$("#home_dropdown").show();}, 
		function(){$("#home_dropdown").hide();}
	);*/

	$("#hospitality_nav").mouseover(function(){
		$("#hospitality_dropdown").show();
		$("#hospitality_dropdown .first img").attr("src", image_path + hospitality_dropdown_image);
		$("#hospitality_dropdown .first p").html(hospitality_dropdown_description);							
	});
	$("#hospitality_nav").mouseout(function(){
		$("#hospitality_dropdown").hide();									
	});
	$("#hospitality_dropdown").hover(
		function(){$("#hospitality_dropdown").show();}, 
		function(){$("#hospitality_dropdown").hide();}
	);
	
	$("#government_nav").mouseover(function(){
		$("#government_dropdown").show();
		$("#government_dropdown .first img").attr("src", image_path + government_dropdown_image);
		$("#government_dropdown .first p").html(government_dropdown_description);								
	});
	$("#government_nav").mouseout(function(){
		$("#government_dropdown").hide();									
	});
	$("#government_dropdown").hover(
		function(){$("#government_dropdown").show();}, 
		function(){$("#government_dropdown").hide();}
	);
	
	$("#healthcare_nav").mouseover(function(){
		$("#healthcare_dropdown").show();
		$("#healthcare_dropdown .first img").attr("src", image_path + healthcare_dropdown_image);
		$("#healthcare_dropdown .first p").html(healthcare_dropdown_description);									
	});
	$("#healthcare_nav").mouseout(function(){
		$("#healthcare_dropdown").hide();									
	});
	$("#healthcare_dropdown").hover(
		function(){$("#healthcare_dropdown").show();}, 
		function(){$("#healthcare_dropdown").hide();}
	);
	
	$("#diy_nav").mouseover(function(){
		$("#diy_dropdown").show();
		$("#diy_dropdown .first img").attr("src", image_path + diy_dropdown_image);
		$("#diy_dropdown .first p").html(diy_dropdown_description);								
	});
	$("#diy_nav").mouseout(function(){
		$("#diy_dropdown").hide();									
	});
	$("#diy_dropdown").hover(
		function(){$("#diy_dropdown").show();}, 
		function(){$("#diy_dropdown").hide();}
	);
	
	$("#ourbrands_nav").mouseover(function(){
		$("#ourbrands_dropdown").show();
		$("#ourbrands_dropdown .first img").attr("src", image_path + ourbrands_dropdown_image);
		$("#ourbrands_dropdown .first p").html(ourbrands_dropdown_description);									
	});
	$("#ourbrands_nav").mouseout(function(){
		$("#ourbrands_dropdown").hide();									
	});
	$("#ourbrands_dropdown").hover(
		function(){$("#ourbrands_dropdown").show();}, 
		function(){$("#ourbrands_dropdown").hide();}
	);
	
	$("#portfolio_nav").mouseover(function(){
		$("#portfolio_dropdown").show();
		$("#portfolio_dropdown .first img").attr("src", image_path + portfolio_dropdown_image);
		$("#portfolio_dropdown .first p").html(portfolio_dropdown_description);									
	});
	$("#portfolio_nav").mouseout(function(){
		$("#portfolio_dropdown").hide();									
	});
	$("#portfolio_dropdown").hover(
		function(){$("#portfolio_dropdown").show();}, 
		function(){$("#portfolio_dropdown").hide();}
	);
	
	$("#catalogs_nav").mouseover(function(){
		$("#catalogs_dropdown").show();
		$("#catalogs_dropdown .first img").attr("src", image_path + catalogs_dropdown_image);
		$("#catalogs_dropdown .first p").html(catalogs_dropdown_description);									
	});
	$("#catalogs_nav").mouseout(function(){
		$("#catalogs_dropdown").hide();									
	});
	$("#catalogs_dropdown").hover(
		function(){$("#catalogs_dropdown").show();}, 
		function(){$("#catalogs_dropdown").hide();}
	);
	
	$(".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);
	});
	
});
