
sArray = ['s01','s02','s03','s04','s05','s06'];
//holds div shortcuts
dArray = []; 
//counter to track the quotes
var x = getRandomNum(); 

function getRandomNum() {
	var rand = Math.floor(Math.random() * sArray.length);
	return rand;
}
function firstSlide() {
	document.getElementById(sArray[x]).style.display = 'block';
	timer = setInterval('loopSides()', 8000);
}

//increment the counter each time through this function. 
//test to see if the div number matches the counter, and turn it on
function loopSides(){
	//set up the div shortcuts
	for (i=0; i < sArray.length; i++) {
		dArray[i] = document.getElementById(sArray[i]);
	}
	//increment the counter.
	(x >= sArray.length-1) ? x=0 : x++;
	
	//now test each one
	for (i=0; i < sArray.length; i++) {
		if (i == x ) {
			dArray[i].style.display = 'block';
		}else {
			dArray[i].style.display = 'none';
		}
	}
}

  