window.onload = rotation;

var gallery = new Array("1.jpg","2.jpg","3.jpg", "4.jpg", "5.jpg");
var currentPic = 0;

function rotation() {
	currentPic++;
	if (currentPic == gallery.length) {
		currentPic = 0;
	}
	document.getElementById("slideshow").src = gallery[currentPic];
	setTimeout("rotation()", 3000);
}