function embedsound(core, num, snd) {
   document.write('<object declare classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" name="sbs' + num + '" id="sbs' + num + '" width="0" height="0">') ;
    document.write('<param name="FileName" value="' + core +'/aud/' + snd + '">');
     document.write('<param name="autostart" value="false">');

      document.write('<object declare id="sbz' + num + '" type="audio/x-wav" data="' + core +'/aud/' + snd + '" width="0" height="0" name="sbz' + num + '">');
           document.write('<param name="autostart" value="false">');

    document.write('</object>');
   document.write('</object>');
}

function playSound(soundname) {
 var sound = eval("document.sbs" + soundname);
 var sound2 = eval("document.sbz" + soundname);

 // make an effort to stop and rewind any playback   clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6
 // 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.
  try {
    sound.Play();
  } catch (e) {
    try {
      sound2.DoPlay();
    } catch (e) {
      sound2.Play();
    }
 }
}
}

