function Setup() {
  if (!document.getElementById) return;
  // Set up event handlers and embed the sounds
  divs = document.getElementsByTagName("div");
  for (i=0; i<divs.length; i++) {
    // embed the appropriate sound using document.write
    document.write('<embed id="' + 'note_' + divs[i].id + '"');
    document.write(' src="' + divs[i].id + '.au" width="0" height="0"');
    document.write(' autostart="false" enablejavascript="true">');
    // set up the event handler
    divs[i].onclick = PlaySound;
  }
}
function PlaySound(e) {
  if (!e) var e = window.event;
  // which key was clicked?
  thiskey = (e.target) ? e.target: e.srcElement;
  var sound = document.getElementById("note_" + thiskey.id);
  try {
    // RealPlayer
    sound.DoPlay();
  } catch (e) {
    try {
      // Windows Media / Quicktime
      sound.Play();
    } catch (e) {
      alert("No sound support.");
    }
  }
}
// Run the setup routine when this script executes
Setup();
