 first = 1;
     last = 4;
     current = 1;
           
     function nextPicture() {
// Hide current picture
object = document.getElementById('slide' + current);
object.style.display = 'none';

// Show next picture, if last, loop back to front
if (current == last) { current = 1; }
else { current++ }
object = document.getElementById('slide' + current);
object.style.display = 'block';
setTimeout(nextPicture, 4000); //NEW LINE in the end of nextPicture function
} //a self repeating call at a delay of 2.5 secs
//adjust the seconds to your liking

      function previousPicture() {
         // Hide current picture
         object = document.getElementById('slide' + current);
         object.style.display = 'none';
               
         if (current == first) { current = last; }
         else { current--; }
         object = document.getElementById('slide' + current);
         object.style.display = 'block';
     }
