// JavaScript Document
// JavaScript Document
var slideshows = [
 { images : [ 'images/img1.jpg', 'images/img5.jpg' ],
 imgId : 'slideshow1',
 curIndex : 0 },

 { images : [ 'images/img2.jpg', 'images/img6.jpg' ],
 imgId : 'slideshow2',
 curIndex : 0 },

 { images : [ 'images/img3.jpg', 'images/img7.jpg' ],
 imgId : 'slideshow3',
 curIndex : 0 },
 
 { images : [ 'images/img4.jpg', 'images/img8.jpg' ],
 imgId : 'slideshow4',
 curIndex : 0 }
 ];

function init() {
 setInterval( 'goSlides()', 3000 );
}

function goSlides() {
 for (var n=0; n < slideshows.length; n++) {
 slideshows[n].curIndex++;
 if (slideshows[n].curIndex > slideshows[n].images.length -1)
 slideshows[n].curIndex = 0;

 if (slideshows[n].images[slideshows[n].curIndex])
 document.getElementById(slideshows[n].imgId).setAttribute('src', slideshows[n].images[slideshows[n].curIndex]);
 }
}