// JavaScript Document

var ShowRandomTextBlock = function() 
{ 
  var blocks = new Array()
  function DoIt() 
  { 
    var d = document.getElementById('random').getElementsByTagName('div'); 
    for (var x=0, y=d.length; x < y; x++) { 
      // capture the divs with the right class name 
      if (d[x].className == 'random') { blocks.push(d[x]); } 
    } 
    // find random number 
    var spot = Math.floor(Math.random() * blocks.length); 
    // Set whether each div block should be seen or not 
    for (var x=0, y=blocks.length; x < y; x++) { 
      if (spot == x) { blocks[x].style.display = ''; } 
      else { blocks[x].style.display = 'none'; } 
    } 
  } 
  window.onload = DoIt; 
}();