function RandomSoundLong(sounds,iparams)
{
/* si: start index 
** i: current index
** ei: end index
** cc: current count
*/
 si = 0; 
 ci=0;
 cc=0;
 soundSet = new Array();
 ei = sounds.length;
  for (i=1;i<ei;i++) {
    if (sounds.charAt(i) == ' ' || sounds.charAt(i) == ',') {
      soundSet[cc] = sounds.substring(si,i);
      cc++;
      si=i+1;
      }
    }
  ind = Math.floor(Math.random() *cc);
  document.writeln("<BGSOUND "+iparams+" src="+soundSet[ind]+" LOOP=ONCE>");;
}

function RandomSound(sounds)
{
  RandomSoundLong(sounds," ");
}
