var stack = [];

	
	var Max_i= tof.length-1;
 
    // preload images into an array; we will preload beach3.jpg - beach8.jpg 
    for (var i = 2; i < Max_i; i++) { 
        var img = new Image(506,HeightimageAnim); 
        img.src = tof[i];
		img.alt =  alt[i];
		img.name = alt[i];
		img.title = alt[i];
        $(img).bind('load', function() { 
            stack.push(this); 
        }); 
    }  
 
    // start slideshow 
    $('#marketing_images').cycle({ 
        timeout:  2000, 
        before:   onBefore 
    }); 
 
    // add images to slideshow 
    function onBefore(curr, next, opts) { 
        if (opts.addSlide) // <-- important! 
            while(stack.length) 
                opts.addSlide(stack.pop());  
    }; 