$(document).pngie();

$(document).ready(function(){

	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});

	$("#box_images").cycle();

	// Internal Slideshow + Thumbnails control
	var loopEnd 		= $("ul.internal_gallery").children("li").size();
	var myImages 		= new Array();
	var currentChild 	= $("ul.internal_gallery li:first");
	var bc 				= $('ul.thumbs'); 
 	
	for (count=1; count <= loopEnd; count++) {
		myImages[count] = currentChild.children("span").html();
		currentChild = currentChild.next();
	}
	var $container = $('ul.internal_gallery').cycle({ 
		fx:     'scrollHorz', 
		speed:   300
	}); 
	
	$container.children().each(function(i) { 
		$('<li><img src="' + myImages[i+1] +'" alt="" title="" width="100" height="100" /></li>') 
		.appendTo(bc) 
		.click(function() { 
			$container.cycle(i); 
			return false; 
		}); 
	});
	// -- End

	/*Personalizzazione select booking form*/
	$('.my-dropdown').sSelect();
	$('#hotel_list .my-dropdown').sSelect();
	
	// 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;
	});
	
	
	
});
