
var picNr=0;

document.open();
document.write( '<div class="centered" style="text-align; center; margin-left: auto; margin-right: auto; padding-bottom: 10px;"><p><img name="slide" height=75 width=100 src="' +files[picNr]+ '" onclick="goToPage(this)" style="cursor: pointer;cursor: hand;"></p> </div>' );
document.close();

function changePicture(){
	
	picNr=picNr+1;
	if (picNr >= files.length) picNr=0;	
	document.images['slide'].src=files[picNr];
	
}

function goToPage(i){
	if(i.src){
		address=i.src.replace(/thumb_/, '');
		address=address.replace(/\.jpg$/, '.htm');
		window.location.href=address;
	}
}

function start(){
	var interval_name = setInterval("changePicture()", 3000);
}

window.onload=start;