function slideShow() {
    
    var stack = [];

    // preload images into an array; we will preload beach3.jpg - beach8.jpg 
    for (var i = 3; i <= 20; i++) {
        var img = new Image(280, 150);
        img.src = 'Images/Slides/' + i + '.jpg';
        $(img).bind('load', function () {
            stack.push(this);
        });
    }

    // start slideshow 
    $('#slideshow').cycle({
        timeout: 3000,
        before: onBefore
    });

    // add images to slideshow 
    function onBefore(curr, next, opts) {
        if (opts.addSlide) 
            while (stack.length)
                opts.addSlide(stack.pop());
    };
}
