//The time in milliseconds (1sec. x 1000) an ad will stay on.
var timeout = 5000;
var ads = new Array();

ads[0] = "Ad one - next ad in 5 seconds";
ads[1] = "Ad two - next ad in 5 seconds";
ads[2] = "Ad three - next ad in 5 seconds";
	
var numAds = ads.length;

//The index of the ad to be displayed.
var i = 0;

function rotatingAd()
{
	//If we just showed the last add, go back to the first one.
	if(i >= numAds) { i = 0; }
	
	if (document.getElementById('rotating_ad'))
	{
		document.getElementById('rotating_ad').innerHTML = ads[i];
	}
	i++;
	
	setTimeout("rotatingAd()",timeout);
}
	
	
