function playSound(soundobj) {
  var sound=document.getElementById(soundobj);

  // make an effort to stop and rewind any playback
  // already in progress so that the sound starts over.
  // Otherwise this call has no effect when the sound
  // is already in progress. You can remove these lines
  // if you don't like this behavior.
  try {
    sound.Stop();
    sound.Rewind();
  } catch (e) {
    // A player that doesn't support
    // Stop and Rewind
  }

  try {
    // For RealPlayer-enabled browsers.
    // Some versions of RealPlayer do not
    // offer a Play() function and will
    // fail to play sound if we try to
    // call Play(). 
    sound.DoPlay();
  } catch (e) {
    // If DoPlay doesn't work, call Play.
    // This works for all other audio 
    // plug-ins.
    sound.Play();
  }
}
