// JavaScript Offerte
$(document).ready(function() {
	$("#holiday_options").change(function () {
	  window.location=$(this).val(); return false;
	});	
	$('#accordion').accordion({
			active: '.selected',
			selectedClass: 'active',
			header: 'h3',
			autoheight: false
		});
	$("a[rel^='prettyPhoto']").prettyPhoto();
	$('.arrivo').datepick();
	$('.tabs > span.myrates').click(function() {
			$(this).parent().next('div.rates').slideToggle('fast').siblings('div.rates:visible').slideUp('fast');
		});
	// initialize tooltip
	$(".servizi_camere img[title]").tooltip('#dynatip');
	// dettaglio camera
	$('.dett_camera_off > .plus_blu').click(function() {
		$(this).parent().next('div.des_room').slideToggle('fast').siblings('div.des_room:visible').slideUp('fast');
	});
});	
// scroll
$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 1000);
                return false;
            }
        }
    });
});
