$(document).ready(function(){

	$('.listing-gallery').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 8000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 600,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Start",             // Start text
		stopText: "Pause"               // Stop text
	});
	
	$(".datepicker").datepicker();
	
	$('#fromDate').datepicker({
		minDate: 0,
		onClose: function(){
			if( $("#fromDate").datepicker('getDate') != null ){
				var day = $("#fromDate").datepicker('getDate');
				day.setDate(day.getDate()+1);
				$("#toDate").datepicker('option', 'minDate', day );
			}
		} 
	});
	$('#toDate').datepicker();
	
	var $tabs = $('#tabs').tabs({ 
		select: function(event, ui){ window.location = ui.tab.href; },
		fx: { height: 'toggle', opacity: 'toggle', duration: 'normal' }
	});

	$('#button-inquire').click(function() {
		$tabs.tabs('select', 3); 
		return false;
	});		
	$('#button-reserve').click(function() {
		$tabs.tabs('select', 4); 
		return false;
	});	
	
	$('#search-options-toggle').click(function(){
		$('#search-options').slideToggle("slow");
		var thisElem = $(this);
		thisElem.text(thisElem.text() === "Show search options" ? "Hide search options" : "Show search options");
		return false;		
	});
	
	$("ul.logos textarea").focus(function(){
		if(this.value == this.defaultValue){
			this.select();
		}
	});
	

});
