window.onload = choosePic;

var adImages = new Array("images/home001.jpg","images/home002.jpg","images/home003.jpg","images/home004.jpg","images/home005.jpg","images/home006.jpg","images/home007.jpg","images/home008.jpg","images/home009.jpg","images/home010.jpg","images/home011.jpg");
var thisAd = 0;

function choosePic() {
	thisAd = Math.floor((Math.random() * adImages.length));
	document.getElementById("adBanner").src = adImages[thisAd];
	
	rotate();
}

function rotate() {
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("adBanner").src = adImages[thisAd];

	setTimeout(rotate, 3 * 3000);
}

