 slidepath= 'fotos/slideshow';
 numSlides = 5;
 timeBetween = 5000;
 loop = true;
 counter = 1;
 stopped = false;
 var timeoutID;
 
 if (document.images) {
 nextSlide = new Image(500,500);
 nextSlide.src = slidepath + '2.jpg';
 }
 
 function SwapSlide() {
 if ((document.images) && (stopped == false)) {
 document['fiant'].src = nextSlide.src;
 counter++;
 if (counter == numSlides) {
 counter = 1;
 if (loop == false) {
 stopped = true;
 }
 }
 nextSlide.src = slidepath + counter + '.jpg';
 timeoutID = setTimeout('SwapSlide()', timeBetween);
 }
 }
 
 function StopSlide() {
 stopped = true;
 clearTimeout(timeoutID);
 }
 
 function StartSlide() {
 if (stopped == true) {
 stopped = false;
 SwapSlide();
 }
 }
 
 function SelectSlide(slide) {
 clearTimeout(timeoutID);
 stopped = false;
 counter = slide;
 nextSlide.src = slidepath + counter + '.jpg';
 SwapSlide();
 StopSlide();
 }
