var rotateSpeed = 5000; //miliseconds for rotation
var imgCnt;
var currentImg = 0;
var lastImg = 0;
function rotateBanner() {
	var img;
	if(img = document.getElementById("rotate-banner-"+lastImg)) {
		img.style.display = "none";
		if(txt = document.getElementById("rotate-banner-"+lastImg)) {
			txt.style.display = "none";
		}
	}
	
	if(img = document.getElementById("rotate-banner-"+currentImg)) {
		img.style.display = "";
		lastImg = currentImg;
	}
	currentImg++;
	
	if(currentImg >= imgCnt) {
		currentImg = 0;
	}
	//if only 1 image, dont bother calling repeatedly
	if(imgCnt > 1) {
		setTimeout("rotateBanner()", rotateSpeed);
	}
}

function setBannerCnt(num) {
	imgCnt = num;
}
