var iteration = 1;

function changeSlideshowImage(total) {
    if (iteration == total) iteration = 1;
    else iteration++;
    $('.slide:visible').fadeOut(600);
    $('#slide' + iteration).fadeIn(600);
}

$(document).ready(function() {
    var total = $('.slide').length;
    if (total > 1) {
        startSlideshow = setInterval("changeSlideshowImage("+total+")", 8000);
    }
});
