// assign rotate to onload 
window.onload = rotate ;

// store filepaths to images in an array
var gallery = new Array("jpeg/home1.jpg", "jpeg/home2.jpg", "jpeg/home3.jpg", "jpeg/home4.jpg", "jpeg/home5.jpg", "jpeg/home6.jpg", "jpeg/home7.jpg") ;

// store the current array element to be displayed
var currentImage = 0 ;

// rotate or slideshow image function
function rotate() {
	// increment the currentImage by 1
     currentImage++ ;
     
     // if we get to the end of the slideshow, go back to the start
     if (currentImage == gallery.length) {
        currentImage = 0 ;
     }
     
     // get the img element with an id of 'cyclingImage' and update its src property
     document.getElementById("cyclingImage").src = gallery[currentImage] ;

	// start a timed function call - invoke rotate() every 7 second calls
     setTimeout("rotate()", 7 * 1000) ;
}