var spunId;
var bAt = 0;
var num = 0;
var ex = new Array(
			"Run into the kitchen and find 10 items of food beginning with 'B' in under a minute",
			"Go upstairs and find a man's sock, a child's T-shirt and a lipstick in 2 mins",
			"Run around everyone in the circle 3 times",
			"Hop on 1 leg for 3 mins",
			"Run up and down the stairs 4 times",
			"Do 10 sit-ups");

function spin() {
  document.getElementById("b").style.visibility = "hidden";
  num = Math.floor(Math.random()*6)+30;
  spun();
}

function spun() {
  if (num>=0) {
    var b = "b"+bAt;
    document.getElementById(b).style.visibility = "hidden";
    bAt++;
    if (bAt==6) bAt = 0;
    b = "b"+bAt;
    document.getElementById(b).style.visibility = "visible";
    num--;
    spunId = window.setTimeout("spun();", (40-num)*5);
  }
  else {
    document.getElementById("ex").firstChild.nodeValue = ex[bAt];
  }
}