function MainBody_OnLoad() {
    //inserire qui tutte le istruzioni da eseguire nell'OnLoad del Body
    startSlide();
}


function slideSwitch() {
    var $active = $('#marchi IMG.active');

    if ($active.length == 0) $active = $('#slideshow IMG:last');

    // nell'ordine che si inseriscono le immagini
    //var $next =  $active.next().length ? $active.next()
    // : $('#marchi IMG:first');

    // in ordine random
    var $sibs = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length);
    var $next = $($sibs[rndNum]);

    $active.addClass('last-active');

    $next.css({ opacity: 0.0 })
            .addClass('active')
            .animate({ opacity: 1.0 }, 1000, function () {
                $active.removeClass('active last-active');
            });
}

function startSlide() {
    if ((window.location.hostname == 'localhost' || window.location.hostname == '127.0.0.1') && (window.location.port == 80 || window.location.port == '')) {
        //non faccio partire la slide sul server per non rallentare il desktop remoto
    }
    else {
        setInterval("slideSwitch()", 2500);
    }
}

