$(document).ready(function(){
	$(document).pngFix();
/*
	var totWidth=0;
	var positions = new Array();
	$('#roll .immagine').each(function(i){
		positions[i]= totWidth;
		totWidth += $(this).width();
		if(!$(this).width()){
			alert("Please, fill in width & height for all your images!");
			return false;
		}
	});
	$('#roll').width(totWidth);
	$('#step ul li a').click(function(e,keepScroll){
		$('li.menuItem').removeClass('act').addClass('inact');
		$(this).parent().addClass('act');
		var pos = $(this).parent().prevAll('.menuItem').length;
		$('#roll').stop().animate({marginLeft:-positions[pos]+'px'},475);
		e.preventDefault();
		if(!keepScroll) clearInterval(itvl);
	});
	$('#step ul li.menuItem:first').addClass('act').siblings().addClass('inact');
	var current=1;
	function autoAdvance(){
		if(current==-1) return false;
		$('#step ul li a').eq(current%$('#step ul li a').length).trigger('click',[true]);
		current++;
	}
	var changeEvery = 4;
	var itvl = setInterval(function(){autoAdvance()},changeEvery*1000);
	
*/

});
function slideSwitch() {
    var $active = $('#slideshow img.active');

    if ( $active.length == 0 ) $active = $('#slideshow img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
function slideSwitch2() {
    var $active = $('#slideshow2 img.active');

    if ( $active.length == 0 ) $active = $('#slideshow2 img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow2 img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 4000 );
    setInterval( "slideSwitch2()", 4000 );
});

