// JavaScript Document
var image_path = "";
var hotels_dropdown_image="http://www.abadhotels.com/images/navigation/plaza/plaza.jpg";
var hotels_dropdown_description ="Hotels &amp; Resorts";
var finedining_dropdown_image="http://www.abadhotels.com/images/navigation/finedining/dining.jpg";
var finedining_dropdown_description ="Dining";
var ayurveda_dropdown_image="http://www.abadhotels.com/images/navigation/ayurveda/ayur.jpg";
var ayurveda_dropdown_description ="Ayurveda";
var packages_dropdown_image="http://www.abadhotels.com/images/navigation/packages/packages.jpg";
var packages_dropdown_description ="Special Packages";
var contact_dropdown_image="http://www.abadhotels.com/images/navigation/contact/contact.jpg";
var contact_dropdown_description ="Contact Us";
$(document).ready(function() 
{
	$("#hotels_nav").mouseover(function(){
		$("#hotels_dropdown").show();
		$("#hotels_dropdown.first img").attr("src", image_path + hotels_dropdown_image);
		$("#hotels_dropdown.first p").html(hotels_dropdown_description);
	});
	$("#hotels_nav").mouseout(function(){
		$("#hotels_dropdown").hide();
	});
	$("#hotels_dropdown").hover(
		function(){$("#hotels_dropdown").show();}, 
		function(){$("#hotels_dropdown").hide();}
	);
	
	$("#finedining_nav").mouseover(function(){
		$("#finedining_dropdown").show();
		$("#finedining_dropdown.first img").attr("src", image_path + hotels_dropdown_image);
		$("#finedining_dropdown.first p").html(hotels_dropdown_description);
	});
	$("#finedining_nav").mouseout(function(){
		$("#finedining_dropdown").hide();
	});
	$("#finedining_dropdown").hover(
		function(){$("#finedining_dropdown").show();}, 
		function(){$("#finedining_dropdown").hide();}
	);
	
	$("#ayurveda_nav").mouseover(function(){
		$("#ayurveda_dropdown").show();
		$("#ayurveda_dropdown.first img").attr("src", image_path + hotels_dropdown_image);
		$("#ayurveda_dropdown.first p").html(hotels_dropdown_description);
	});
	$("#ayurveda_nav").mouseout(function(){
		$("#ayurveda_dropdown").hide();
	});
	$("#ayurveda_dropdown").hover(
		function(){$("#ayurveda_dropdown").show();}, 
		function(){$("#ayurveda_dropdown").hide();}
	);
	
	
	$("#packages_nav").mouseover(function(){
		$("#packages_dropdown").show();
		$("#packages_dropdown.first img").attr("src", image_path + hotels_dropdown_image);
		$("#packages_dropdown.first p").html(hotels_dropdown_description);
	});
	$("#packages_nav").mouseout(function(){
		$("#packages_dropdown").hide();
	});
	$("#packages_dropdown").hover(
		function(){$("#packages_dropdown").show();}, 
		function(){$("#packages_dropdown").hide();}
	);
	
	$("#contact_nav").mouseover(function(){
		$("#contact_dropdown").show();
		$("#contact_dropdown.first img").attr("src", image_path + hotels_dropdown_image);
		$("#contact_dropdown.first p").html(hotels_dropdown_description);
	});
	$("#contact_nav").mouseout(function(){
		$("#contact_dropdown").hide();
	});
	$("#contact_dropdown").hover(
		function(){$("#contact_dropdown").show();}, 
		function(){$("#contact_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)*673+360);
	});
	
});
