function startSlideshow(slides) { 
		
	var totalSlideCount = slides.length;
	if(totalSlideCount != 0) {
	 
		var $slideshow = $('#slideshow'); 
		 
		// markup contains only a single slide; before starting the slideshow we  
		// append one slide and prepend one slide (to account for prev/next behavior) 
		var im1 = slides.pop();
		var im2 = slides.shift();
		$slideshow.prepend('<img src="'+im1+'" />');
		
		$slideshow.prepend('<img src="'+im2+'" />');

 
		// start slideshow 
		$('#slideshow').cycle({ 
			fx: 'scrollHorz', 
			startingSlide: 1,  // start on the slide that was in the markup 
			speed:    500,
			prev:    '#anterior', 
			next:    '#proximo',
			pause:   1,
			before:   onBefore 
		});
	}else{
		$("#slideshow").html("<img src='imagens/topoteste.jpg' />");
	} 
	function onBefore(curr, next, opts, fwd) { 
		// on Before arguments: 
		//  curr == DOM element for the slide that is currently being displayed 
		//  next == DOM element for the slide that is about to be displayed 
		//  opts == slideshow options 
		//  fwd  == true if cycling forward, false if cycling backward 
			 
		// on the first pass, addSlide is undefined (plugin hasn't yet created the fn yet) 
		if (!opts.addSlide) 
			return; 
			 
		// have we added all our slides? 
		if (opts.slideCount == totalSlideCount) 
			return; 
	
		// shift or pop from our slide array  
		var nextSlideSrc = fwd ? slides.shift() : slides.pop(); 
		 
		// add our next slide 
		opts.addSlide('<img src="'+nextSlideSrc+'" />', fwd == false);
		
	};
};