	var offerte="38";
	var eventi="43";

function show_events(timeout) {
	  $(".box_cat_"+offerte).fadeOut("slow", function() {$(".box_cat_"+eventi).fadeIn("slow", function(){setTimeout("show_offers("+timeout+");", timeout);});});
	  return false;
	}
	
function show_offers(timeout) {
	  $(".box_cat_"+eventi).fadeOut("slow", function() {$(".box_cat_"+offerte).fadeIn("slow", function(){setTimeout("show_events("+timeout+");", timeout);});});
	  return false;
	}
$(document).ready(function(){	

		$("div.gallery").cycle({
		timeout: 3000
	});

	//Fade alternato offerte/eventi
	var timeout="6000";
	var timeout2="7000";
	setTimeout("show_events("+timeout2+");", timeout);
	
	
	/*Fancybox*/
	$(".group").fancybox({
		titlePosition: 'over'
	});
	
	
	/*Personalizzazione select booking form*/
	$('.my-dropdown').sSelect();
	$('#hotel_list .my-dropdown').sSelect();
	
	$(".cat_70").attr('href', 'http://www.fastbooking.net');
	$(".cat_70").attr('target', '_blank');
	
	
	$('.cat_55').attr("href", "javascript:;");
	$('.cat_55').click(function() {hhotelSearch("ITRIVHTLRivarolo", "", "", "", "", "", "&FSTBKNGTrackLink=");});
	
	/*Logo png trasparente*/
	$('div#logo_home,div#logo_article').pngFix();

	// Hide all Lista offerte / eventi	
   $("#hide_all").click(function() {
	  $(this).hide();
	  $(".hidden_offer").fadeOut("slow", function() {$("#show_all").fadeIn();});
	  return false;
	});
	
	// Show all Lista offerte / eventi
	$("#show_all").click(function() {
	  $(this).hide();
	  $("#hide_all").fadeIn();
	  $(".hidden_offer").fadeIn("slow");
	  return false;
	});
    	
	
	if($('#prev2').length != 0){
		$('#prev2').css("display","none");
	}

	// Link_exchange pager
	$('#link_exchange_links .pager').find('a').live('click', function () {
		var that = $(this);
		$('#link_exchange_links_container').height($('#link_exchange_links_container').height()).addClass('loading');
		$('#link_exchange_links').fadeOut(200, function () {
			$(this).load(that.attr('href') + ' #link_exchange_links > *', function  () {
				$(this).fadeIn(200);
				$('#link_exchange_links_container').height('auto').removeClass('loading');
			});
		});
		return false;
	});
	
	// Guest comments pager
	$('#guestcomments .pager').find('a').live('click', function () {
		var that = $(this);
		$('#guestcomments-container').height($('#guestcomments-container').height()).addClass('loading');
		$('#guestcomments').fadeOut(200, function () {
			$(this).load(that.attr('href') + ' #guestcomments > *', function  () {
				$(this).fadeIn(200);
				$('#guestcomments-container').height('auto').removeClass('loading');
			});
		});
		return false;
	});	
});
