jQuery.fn.exists = function(){return jQuery(this).length>0;}

$(document).ready(
				  function(){
				  
	$("#photogallery_page a").lightBox();
	$("#minigallery_rooms .roomz_image a").lightBox();
	
	/*Personalizzazione select booking form*/
	/*$('.my-dropdown').sSelect();
	$('#hotel_list .my-dropdown').sSelect();*/
	
	// 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;
	});
	
	
	$(".my-dropdown").uniform(); 
						   
	/*Logo png trasparente*/
	$('div#logo,div#shadow,div#caption,div#shadow_menu').pngFix();	
	
	/*Gallery*/
	$("div.gallery").cycle({
		timeout: 5000
	});
	
/*
	$('h2').ColorPicker({
	color: '#0000ff',
	onShow: function (colpkr) {
		$(colpkr).fadeIn(500);
		return false;
	},
	onHide: function (colpkr) {
		$(colpkr).fadeOut(500);
		return false;
	},
	onChange: function (hsb, hex, rgb) {
		$('h2').css('color', '#' + hex);
	}
}); */

$("ul.list_items li").hover(
  function () {
    $(this).addClass("hover");
		$(this).find('.image_rounder_hover').not('.current').show();
		$(this).find('.image_rounder').not('.current').hide();
  },
  function () {
    $(this).removeClass("hover");
		$(this).find('.image_rounder_hover').not('.current').hide();
		$(this).find('.image_rounder').not('.current').show();
  }
);


	
});
