var sm_avail = false;
var pollcount = 0;
function startDemo() {
  if (!sm_avail && pollcount < 10) {
	//alert("Sound manager not initialised");
	pollcount ++;
	setTimeout(startDemo, 100);
  }
  else if (pollcount > 10) {
	alert("Error initialising sound");
  }
  else {
	window.open("http://www.memoryandlearning.com/tests/sample.html", "tests",
				"toolbar=0, location=0, menubar=0, width=800, height=700, top=10, right=100");
  // rcc removed scrollbars=0  so it can be scrolled if there is a size problem.
  }
}

function startTrial() {
  if (!sm_avail && pollcount < 10) {
	//alert("Sound manager not initialised");
	pollcount ++;
	setTimeout(startTrial, 100);
  }
  else if (pollcount > 10) {
	alert("Error initialising sound");
  }
  else {
	window.open("http://www.memoryandlearning.com/tests/trial.html", "tests",
				"toolbar=0, location=0, menubar=0, width=800, height=700, top=10, right=100");
  // rcc removed scrollbars=0  so it can be scrolled if there is a size problem.
  }
}



function soundManagerAvailable() {
  sm_avail = true;
}