window.onload = choosePic;

var myPix = new Array("images/rotation/061110_pers.jpg",
					  "images/rotation/boat1.jpg", 
					  "images/rotation/bobcat.jpg", 
					  "images/rotation/r1.bmp", 
					  "images/rotation/r2.jpg", 
					  "images/rotation/r3.jpg", 
					  "images/rotation/r5.jpg", 
					  "images/rotation/r6.jpg", 
					  "images/rotation/r14.jpg");

<!--function choosePic(){-->
<!--	randomNum = Math.floor((Math.random() * myPix.length));-->
<!--	document.getElementById("mainpic1").src = myPix[randomNum]; }-->

var thisAd = 0;

function rotate (){
	thisAd++;
	if (thisAd == myPix.length) {
	thisAd = 0;
}
document.getElementById("mainpic1").src = myPix[thisAd];
setTimeout("rotate()", 5 * 1000);
}
function choosePic() {
	thisAd = Math.floor((Math.random() * myPix.length));
	document.getElementById("mainpic1").src = myPix[thisAd];
	
	rotate();
}
