﻿
 function slideSwitch() {
    var $active = $('#pictureContainer img.active');

    if ( $active.length == 0 ) $active = $('#pictureContainer img:last');

    var $next =  $active.next().length ? $active.next()
        : $('#pictureContainer 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 slideShowSetup() {
    for (var i = 0; i < imgpaths.length ; i++) {
        imgs[i] = new Image();
        imgs[i].src = path + imgpaths[i];
        $("#pictureContainer").append(imgs[i]);
        $(imgs[i]).css({opacity: 0.0});
    }
    
    imgs[0].className = "active";
    $(imgs[0]).css({opacity: 1.0});
    
    setInterval("slideSwitch()", 10000);
 }
