	// DATE PICKER FOR BOOKING FORM
	/*Gestione calendario nella booking*/
	$(function() {
	jQuery(function(){	
		// initialise the "Select date" link
		jQuery('.date-pick')
			.datePicker(
	
				//associate the link with a date picker
				{
					createButton:false,
					startDate:'<?php echo date("d/m/Y"); ?>',
					endDate:'<?php echo date("d/m/Y",time() + 63000000); ?>'
				}
			).bind(
				// when the link is clicked display the date picker
				'click',
				function()
				{
					updateSelects(jQuery(this).dpGetSelected()[0]);
					jQuery(this).dpDisplay();
					return false;
				}
			).bind(
				// when a date is selected update the SELECTs
				'dateSelected',
				function(e, selectedDate, $td, state)
				{
					updateSelects(selectedDate);
				}
			).bind(
				'dpClosed',
				function(e, selected)
				{
					updateSelects(selected[0]);
				}
			);
			
		var updateSelects = function (selectedDate)
		{
			var selectedDate = new Date(selectedDate);
			jQuery('#d option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
			jQuery('#m option[value=' + (selectedDate.getMonth()+1) + ']').attr('selected', 'selected');
			jQuery('#y option[value=' + (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
		}
		// listen for when the selects are changed and update the picker
		jQuery('#d, #m, #y')
			.bind(
				'change',
				function()
				{
					var d = new Date(
								jQuery('#y').val(),
								jQuery('#m').val()-1,
								jQuery('#d').val()
							);
					jQuery('#date-pick').dpSetSelected(d.asString());
				}
			);
		
		// default the position of the selects to today
		var today = new Date();
		updateSelects(today.getTime());
		$("#date-pick").val(today.getDate()+"/"+((today.getMonth()+1)<10?"0"+(today.getMonth()+1):(today.getMonth()+1))+"/"+today.getFullYear());
		document.idForm.fromday.value = today.getDate();
		document.idForm.frommonth.value = today.getMonth()+1;
		document.idForm.fromyear.value = today.getFullYear();	
		// and update the datePicker to reflect it...
		jQuery('#d').trigger('change');
		});
	});
	
	
	function check_date() {	
		//var date_input = document.input_date.value;
		var date_input = document.idForm.input_date.value
		var dd = date_input.substring(0,2);
		var mm = date_input.substring(3,5);
		var yy = date_input.substring(6,10);
		document.idForm.fromday.value = dd;
		document.idForm.frommonth.value = mm;
		document.idForm.fromyear.value = yy;	
		//alert(dd + "/" + mm + "/" + yy);
	}
	
	
	/*Personalizzazione select booking form*/
	$('.my-dropdown').sSelect();
	$('#hotel_list .my-dropdown').sSelect();
		
	// EFFETTO FADE MEETINGS / ROOMS	
	/*Link sull'immagine*/
	$('#meeting_room_col_dx .meeting_room_box .image_box a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #meeting_detail';			
			$('#meeting_detail').fadeOut(300, function() {
				$('#meeting_detail').load(linked_listpage, function() {
					$('#meeting_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});
	
	/*Link sul titolo*/
	$('#meeting_room_col_dx .meeting_room_box h1 a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #meeting_detail';			
			$('#meeting_detail').fadeOut(300, function() {
				$('#meeting_detail').load(linked_listpage, function() {
					$('#meeting_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});
	
	// EFFETTO FADE OFFERS / EVENTS
	/*OFFERTE*/
	/*Link sulla scritta MORE*/
	$('#list_offevent .offer_box .info a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #offevent_detail';			
			$('#offevent_detail').fadeOut(300, function() {
				$('#offevent_detail').load(linked_listpage, function() {
					$('#offevent_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});	
	/*Link sul titolo*/
	$('#list_offevent .offer_box h2 a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #offevent_detail';			
			$('#offevent_detail').fadeOut(300, function() {
				$('#offevent_detail').load(linked_listpage, function() {
					$('#offevent_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});
	/*EVENTI*/
	/*Link sulla scritta MORE*/
	$('#list_offevent .event_box .info a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #offevent_detail';			
			$('#offevent_detail').fadeOut(300, function() {
				$('#offevent_detail').load(linked_listpage, function() {
					$('#offevent_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});	
	/*Link sul titolo*/
	$('#list_offevent .event_box h2 a').each(function() {
		var linked_listpage;
		 $(this).click(function() {			
			linked_listpage = $(this).attr('href') + ' #offevent_detail';			
			$('#offevent_detail').fadeOut(300, function() {
				$('#offevent_detail').load(linked_listpage, function() {
					$('#offevent_detail').fadeIn(300);
				});
			});			
			return false;
		});
	});
	
	
	
	// VIEW ALL delle pagine eventi / offerte
	$('#list_offevent #view_all').click(function(){
		$('#list_offevent .featured').fadeOut(500);
		$('#list_offevent .all_hidden').fadeIn(500);
		$(this).css("display","none");
		return false;
	});
	
