	
	
	// You need to specify the size of your background image here (could be done automatically by some PHP code)
	//var FullscreenrOptions = {  width: 1024, height: 768, bgID: '#bgimg' };
	
	// This will activate the full screen background!
	//jQuery.fn.fullscreenr(FullscreenrOptions);
		
	function onAfter() { 
		$('#output');
	}
	$("#bf div.adulteresa select, #bf div.nbdays select, #bf div.enfantresa select, #bf div.HotelList select").sSelect();
	// $("#language_menu select").sSelect();

	$("#language_menu select").change(function(){
			location.href = $(this).val();
			$(this).attr('selected','selected');
	});
	
	
	$("#footer a.cat_16").attr("target","_blank");
	$("li.cat-id-16 a").attr("target","_blank");
	
	
		/*SLIDEsHOW group*/
	
	$('#flash_col_1').cycle({			
		timeout: 4000, // disable automatic transitions 
		fx: 'fade',
		speed: 3000
			});
	
	$('#flash_col_2').cycle({			
		timeout: 4000, // disable automatic transitions 
		fx: 'fade',
		speed: 1500
			});
			
	$('#flash_col_3').cycle({			
		timeout: 4000, // disable automatic transitions 
		fx: 'fade',
		speed: 500
			});
	
	
	
	
	// ITEM IMAGES - GALLERY ITEM
	$('#gallery').cycle({ 
		fx:     'fade', 
		timeout: 6000, 
		next:   '#next-image', 
		prev:   '#prev-image',
		after:   onAfter
	});

	// PHOTOGALLERY
	$("a[rel=photogallery]").fancybox({
		'transitionIn'		: 'elastic',
		'transitionOut'		: 'elastic',
		'titlePosition' 	: 'over'
	});


	// VIEW ALL delle pagine eventi / offerte
	$('#view_all').click(function(){
		$('.featured').css("display","none");
		$('.all_hidden').fadeIn(800);
		$(this).css("display","none");
		return false;
	});


	// NASCONDO TUUTE LE RISPOSTE DELLE FAQ
	$(".faq_body").each(function() {	
		$(this).css("display","none");
	});
	

	// VISUALIZZO LA RISPOSTA DELLA FAQ
	$("#faq .story .full_box .moreinfo a").click(function(){
		
		var hidden_id = parseInt($(this).parent('.moreinfo').attr('id').replace('h_', ''), 10); 
		
		$("#faq .story .full_box .moreinfo").each(function() {
			$('.faq_body').hide(800);
			$('#faq .story .full_box .moreinfo a').removeClass('current');
		});
		
		$(this).addClass('current');
		
		$('#risp_'+hidden_id).show(500);
		return false;
	});
	
	//TODO:
	//$('ul#guestcomments').pager();
	
	// GUESTCOMMENTS BOX
	
	var guestcomments = $('ul#guestcomments');
	var pager = $('.pager');
	var lis = guestcomments.find('li');
	var currentShowing = lis.eq(0).attr('id');
	
	var showComment = function(id) {
		guestcomments.find('#'+currentShowing).hide('fast');
		guestcomments.find('#'+id).show('fast');
		currentShowing = id;
	};
	
	function buildPager(){
		var i=1;
		lis.each(function(){
			pager.append('<a href="javascript:;" onclick="showComment('+$(this).attr('id')+')">'+i+'</a> | ');
			i++;
		});
		pager.show();
	}
	buildPager();
