// JavaScript Document
divs = ['d1','d2','d3','d4','d5','d6','d7','d8'];

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';



}

showDiv();