$(document).ready(function()   
{	 

	$("#nav_hotel").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 262}, 200);
		}
	);
	$("#nav_hotel_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_hotel").removeClass("on");
		}
	);
	
	$("#nav_rooms").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_rooms_drop").stop().animate({width: 513}, 200);
		}
	);
	$("#nav_rooms_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_rooms").removeClass("on");
		}
	);
	
	$("#nav_self_catering_rooms").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 300}, 200);
		}
	);
	$("#nav_self_catering_rooms_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_self_catering_rooms").removeClass("on");
		}
	);
	
	$("#nav_conference").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 262}, 200);
		}
	);
	$("#nav_conference_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_conference").removeClass("on");
		}
	);
	
	$("#nav_specials").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
						
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
		}
	);
	
	$("#nav_facilities").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 262}, 200);
		}
	);
	$("#nav_facilities_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_facilities").removeClass("on");
		}
	);
	
	$("#nav_media").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
			// set selected link as selected
			$(this).removeClass("off");
			$(this).addClass("on");
			
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 262}, 200);
		}
	);
	$("#nav_media_drop").mouseleave(
		function() {
			$(this).stop().animate({width: 0}, 300);
			$("#nav_media").removeClass("on");
		}
	);
	
	$("#nav_contact").hover(
		function() {
			var navigation = document.getElementById("navigation");
			var links = navigation.getElementsByTagName("a");	
			// set all the links classes to nothing
			for(var i=0; i<links.length; i++)	
			links[i].className = "off";
						
			$("#nav_rooms_drop").stop().animate({width: 0}, 1);
			$("#nav_conference_drop").stop().animate({width: 0}, 1);
			$("#nav_facilities_drop").stop().animate({width: 0}, 1);
			$("#nav_hotel_drop").stop().animate({width: 0}, 1);
			$("#nav_media_drop").stop().animate({width: 0}, 1);
			$("#nav_self_catering_rooms_drop").stop().animate({width: 0}, 1);
		}
	);
	
});
