$().ready(function() {
	//PNGFIX
	$(document).pngFix();				   
	//CORNER
	$('.menu_extra ul').append('<strong class="p_bl"></strong>'+'<strong class="p_br"></strong>');
	$('.corner').rounded();
	//SLIDESHOW
	slideShow();

});

//funzioni per slideshow
function slideShow() {
	$('.slideshow').append('<div class="caption"><div class="capt_content"></div></div>');
	$('#slideshow li').css({opacity: 0.0});
	$('#slideshow li:first').css({opacity: 1.0});
	$('.slideshow .caption').css({opacity: 0.6});
	$('.slideshow .capt_content').html('<p>'+$('.slideshow li:first').find('img').attr('alt')+'</p>').animate({opacity: 1}, 1000);
	setInterval('gallery()', 5000);
}
function gallery() {
	var current = ($('#slideshow li.show')?  $('#slideshow li.show') : $('#slideshow li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#slideshow li:first') :current.next()) : $('#slideshow li:first'));	
	var caption = next.find('img').attr('alt');
	next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 2000);
	current.animate({opacity: 0.0}, 2000).removeClass('show');
	$('#slideshow .caption').animate({opacity: 0.0}, { queue:false, duration: 0 }).animate({height: '1px'}, { queue:true, duration: 1000 });	
	$('#slideshow .caption').animate({opacity: 0.6}, 0 ).animate({height: '36px'}, 1000 );
	$('#slideshow .capt_content').html('<p>'+caption+'</p>');
}