$(document).ready(function(){
	
	//$(document).pngFix(); 
	
	if(typeof(idForm)!='undefined' && typeof(init_form)!='undefined') init_form();
	
	$('#bf').css("visibility","visible");
	
	$("#slider").easySlider({
		auto: true,
		continuous: true,
		speed: 2000
	});
	
	$('#slider').css("visibility","visible");
	
	$('#link_exchange_links_container').fadeIn(400);
	
	
	/* BUTTON SHOW ALL in LISTPAGE */
	$('#vertical_articleslist .show_all').click(function(){
		$('#vertical_articleslist li.hidden').fadeIn(500);
		$(this).hide();
		return false;													 
	});
	
	
	if($("#vertical_articleslist").length == 0 && $("#lists").length == 0){
		$(".bodycat").css("width","100%");
	}
	
	
	$(".group").fancybox({
		titlePosition: 'over'
	});
	
	$("a#show_articles_cat1").click(function(){
		$("#list_sx").removeClass("hide");
		$("#list_dx").addClass("hide");
		$(this).addClass("selected");
		$("a#show_articles_cat2").removeClass("selected");
	});
	
	$("a#show_articles_cat2").click(function(){
		$("#list_sx").addClass("hide");
		$("#list_dx").removeClass("hide");
		$(this).addClass("selected");
		$("a#show_articles_cat1").removeClass("selected");
	});
	
	/*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;
	});
	
});

