
divs = ['d1','d2','d3'];

function hideDivs() {
	for (var i=0; i<divs.length; i++)
	document.getElementById(divs[i]).style.display = 'none';
}

function showDiv() {
	hideDivs(); //hide them all before we show the next one.
	var randomDiv = divs[Math.floor(Math.random()*divs.length)];
	var div = document.getElementById(randomDiv).style.display ='block';
	//setTimeout(showDiv,500); //set a delay before showing the next div
}
//NOTE: in order to work, showDiv; must be called in the body onload statement of the page.
//showDiv();

