// JavaScript Document

/*-------------------    1 - Sponsor Tecnici    ------------------*/
function slideSwitch1() {
    var $active = $('#slideshow DIV.active');

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

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow DIV:first');
		
	$active.addClass('last-active');

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

$(function() {
    setInterval( "slideSwitch1()", 5000 );
});




/*-------------------    2 - Media Partners  ------------------*/
function slideSwitch2() {
    var $active = $('#slideshow2 DIV.active');

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

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow2 DIV:first');
		
	$active.addClass('last-active');

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

$(function() {
    setInterval( "slideSwitch2()", 5000 );
});




/*-------------------    3 - Special Partners  ------------------*/
function slideSwitch3() {
    var $active = $('#slideshow3 DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow3 DIV:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow3 DIV:first');
		
	$active.addClass('last-active');

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

$(function() {
    setInterval( "slideSwitch3()", 5000 );
});





/*-------------------    4 - Sponsor  ------------------*/
function slideSwitch4() {
    var $active = $('#slideshow4 DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow4 DIV:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow4 DIV:first');
		
	$active.addClass('last-active');

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

$(function() {
    setInterval( "slideSwitch4()", 5000 );
});





/*-------------------    5 - Sponsor  ------------------*/
function slideSwitch5() {
    var $active = $('#slideshow5 DIV.active');

    if ( $active.length == 0 ) $active = $('#slideshow5 DIV:last');

    var $next =  $active.next().length ? $active.next()
        : $('#slideshow5 DIV:first');
		
	$active.addClass('last-active');

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

$(function() {
    setInterval( "slideSwitch5()", 5000 );
});
