$(function(){

	//Nav show
	$('.dropdown').click(function(event) {
		event.preventDefault();

		$(this).parent().next('.hide-nav').toggle();
	});
		   
	//height script for left nav	   
	
	
	if( $('#wrapper').hasClass('blog') )
	{
		var height = $('#content').height() + 250;
		$('#nav-container').height(height);
	}
	
	else
	{
		var height = $('#content').height() + 450;
		$('#nav-container').height(height);
	}
	
	


	/*
    // ========================================== \\
   ||                                              ||
   ||               NAV HOVER SCRIPT               ||
   ||                                              ||
    \\ ========================================== //
	*/
	
	
	$('#nav-container ul li').hover(
	function(){
		$(this).find('a').not('.selected').stop().animate({
			
			marginLeft: "5px"
			
		  }, 300 );

	},
	
	function(){
		$(this).find('a').not('.selected').stop().animate({
			
			marginLeft: "0px"
			
		  }, 300 );
	});
	
	//END NAV SCRIPT
	
	
	/*
    // ========================================== \\
   ||                                              ||
   ||               BOOK SCRIPT		               ||
   ||                                              ||
    \\ ========================================== //
	*/
	
	$('#date').datepicker({ dateFormat: 'yy-mm-dd' });
	
	
	$('#availability').click(function(e)
	{
		e.preventDefault();	
		
		var bookingURL = 'https://www.myfidelio.net/webui/AvailabilitySearch.aspx?chain=IQ&property=UKWHE';
		
		var booking = 
		{
			rooms:	'&rooms=' + $('#rooms').val(),
			nights:	'&nights=' + $('#nights').val(),
			date: 	'&arrival=' + $('#date').val()
		}
				
		var url = bookingURL + booking.rooms + booking.nights + booking.date; 
		

		window.open(url,'Booking'); 
		
	});
	
	//remove search value on click
$('#search-entry').click(function () {
	if ($(this).val() == 'Search...') {$(this).val('');} else {$(this).select();}
});
	
});

