DEPARTURE_DATE_FORMAT = "ddd, d MMM yyyy";
DATEPICKER_OPTIONS = {
	showOn: 'both',
	buttonImageOnly: true
};
SHOW_PROPERTY_TYPES = 'hotel';

$(document).ready(function(){

	$("div#navigation LI").hover(
		function() {
			$(this).addClass("hover");
		},
		function() {
			$(this).removeClass("hover");
		}
	);

	if (typeof hero_flash_url != "undefined" && typeof hero_panel_height != "undefined") {
		$("#hero").flashembed({src: hero_flash_url, wmode: 'opaque'});
		$("#hero").height(hero_panel_height + "px");
	}

	if (typeof hero_slideshow != "undefined" && typeof hero_panel_height != "undefined") {
		$("#hero").slideshow({
			assets: hero_slideshow,
			height: hero_panel_height,
			width: 920,
			link_type: "block",
			overlay: false,
			nested_controls: true,
			left: "center"
		});
	};
	
	jQuery(".offers-filter button").hide();
	jQuery(".offers-filter select, .offers-filter input").change(function() {
		jQuery(this).closest("form").submit();
	});
	
	function switchPanelTabs(id)
	{
	    if (!id) id = jQuery("FORM:first").attr('id');
	    jQuery("UL.book-type-tabs LI").each(function() {
	        form_id = jQuery(this).attr('rel');
	        if(form_id) jQuery("FORM#" + form_id).hide();
	        form_id == id ? jQuery(this).addClass('active') : jQuery(this).removeClass('active');
	    })
	    jQuery("FORM#" + id).show();
	}
	
	// Default Tab
	switchPanelTabs('bedroomSearch');

	jQuery("UL.book-type-tabs A").click(function() {
		switchPanelTabs($(this).parent().attr('rel'));
		return false;
	})
	
	jQuery("div#booking-overlay a.toggle")
		.css('display', 'block')
		.toggle(function() {
				jQuery(this).css('background-position', '0 100%');
				jQuery(this).parent().find('div.booking-panel-forms').slideUp();
			}, function() {
				jQuery(this).css('background-position', '0 0');
				jQuery(this).parent().find('div.booking-panel-forms').slideDown();
			});
			
	jQuery('#carousel').find("UL").jcarousel();
	
	//collapsable terms and conditions 
	jQuery(function()
	        {
	        	$(".offer-terms").hide();
	        	$(".offer-tc-heading").click(
	        		function(){$(".offer-terms").toggle();return false;});
	        });	
	
});
