function loadStaticAds()
{
/*	if (document.getElementById('sad1'))
	{
		document.getElementById('sad1').src = "/images/feature_warrenApt.gif";
		document.getElementById('sad2').src = "/images/feature_faithinaction.gif";
		document.getElementById('sadlink1').href = "/warrenApartments.html";
		document.getElementById('sadlink2').href = "/faithinaction.html";
	}
*/
}
function loadAds()
{
	var rotatingAds = new Array();

	// for elements you want to add, just call rotatingAds.push().
	// Each element is an raay containing the picture and the html link.
	rotatingAds.push(['/images/feature_ALI.gif',	'/adult_learners_institute.html']);
	rotatingAds.push(['/images/feature_cacc.jpg',	'/chamber-of-commerce.html']);
	rotatingAds.push(['/images/feature_cca.gif',	'/cca.html']);
	rotatingAds.push(['/images/feature_cch-children-center.gif',	'/childrensCenter.html']);
	rotatingAds.push(['/images/feature_dancearts.gif',	'/dancearts.html']);
	rotatingAds.push(['/images/feature_faithinaction.gif',	'/faithinaction.html']);
	// rotatingAds.push(['/images/feature_faithful-fitness.gif',	'/faithful-fitness.html']);
 	// rotatingAds.push(['/images/feature_gardenmill.gif',	'/gardenmill.html']);
	rotatingAds.push(['/images/feature_mission.gif',	'/missionmarketplace.html']);
	rotatingAds.push(['/images/feature_moore-pediatrics2.gif',	'/moore_pediatrics.html']);
 	rotatingAds.push(['/images/feature_pierces-pastries.jpg',	'/pierces-pastries.html']);
	rotatingAds.push(['/images/feature_purple-rose-theater.gif',	'/purple-rose-theatre.html']);
 	// rotatingAds.push(['/images/feature_ray-newton-consultant.jpg',	'/ray-newton-consulting.html']);
	rotatingAds.push(['/images/feature_recycle.gif',	'/chelsearecycle.html']);
	rotatingAds.push(['/images/feature_richard-taylor2.gif','/rick-taylor_realtor.html']);
	rotatingAds.push(['/images/feature_roberts.gif',	'/roberts.html']);
	rotatingAds.push(['/images/feature_silver-maples.gif',	'/silver-maples.html']);
	rotatingAds.push(['/images/feature_surelutions.gif',	'/surelutions.html']);
	rotatingAds.push(['/images/feature_timbertown.gif',	'/timbertown.html']);
	rotatingAds.push(['/images/feature_treehouse.gif',	'/treehouse.html']);
	rotatingAds.push(['/images/feature_unitedway.gif',	'/unitedway.html']);	
	rotatingAds.push(['/images/feature_warrenApt.gif',	'/warrenApartments.html']);
 	rotatingAds.push(['/images/feature_vogels-and-fosters.gif',	'/vogelsandfosters.html']);
	

	// get the indices to display
	var adIndex1 = Math.round(Math.random() * ( rotatingAds.length - 1));
	var adIndex2 = Math.round(Math.random() * (  rotatingAds.length - 1));
	while (adIndex2 == adIndex1)
	{
		adIndex2 = Math.round(Math.random() * (  rotatingAds.length - 1));
	}
	var adIndex3 = Math.round(Math.random() * ( rotatingAds.length - 1));
	while (adIndex3 == adIndex1 || adIndex3 == adIndex2)
	{
		adIndex3 = Math.round(Math.random() * ( rotatingAds.length - 1));
	}
	var adIndex4 = Math.round(Math.random() * ( rotatingAds.length - 1));
	while (adIndex4 == adIndex1 || adIndex4 == adIndex2 || adIndex4 == adIndex3)
	{
		adIndex4 = Math.round(Math.random() * ( rotatingAds.length - 1));
	}
	var adIndex5 = Math.round(Math.random() * ( rotatingAds.length - 1));
	while (adIndex5 == adIndex1 || adIndex5 == adIndex2 || adIndex5 == adIndex3 || adIndex5 == adIndex4)
	{
		adIndex5 = Math.round(Math.random() * ( rotatingAds.length - 1));
	}
	var adIndex6 = Math.round(Math.random() * ( rotatingAds.length - 1));
	while (adIndex6 == adIndex1 || adIndex6 == adIndex2 || adIndex6 == adIndex3 || adIndex6 == adIndex4 || adIndex6 == adIndex5)
	{
		adIndex6 = Math.round(Math.random() * ( rotatingAds.length - 1));
	}
	// Then update the elements in the file
	document.getElementById('rad1').src = rotatingAds[adIndex1][0];
	document.getElementById('rad2').src = rotatingAds[adIndex2][0];
	document.getElementById('rad3').src = rotatingAds[adIndex3][0];
	document.getElementById('rad4').src = rotatingAds[adIndex4][0];
	document.getElementById('rad5').src = rotatingAds[adIndex5][0];
//	document.getElementById('rad6').src = rotatingAds[adIndex6][0];
	document.getElementById('radlink1').href = rotatingAds[adIndex1][1];
	document.getElementById('radlink2').href = rotatingAds[adIndex2][1];
	document.getElementById('radlink3').href = rotatingAds[adIndex3][1];
	document.getElementById('radlink4').href = rotatingAds[adIndex4][1];
	document.getElementById('radlink5').href = rotatingAds[adIndex5][1];
//	document.getElementById('radlink6').href = rotatingAds[adIndex6][1];
}
// window.setTimeout(loadStaticAds, 3000);
window.setInterval("loadAds()",8000);// JavaScript Document
