
/*Generate a random number between 0 and max.*/

var rNum=NaN;
function randomNum(max) {
  while (isNaN(rNum)) {
    rNum=Math.floor(Math.random()*(max))
  }
  return rNum;
}

var sound = new Array
sound[0]= "../schemes/DEBUTworkingman1.mp3"
sound[1]= "../schemes/DEBUTworkingman2.mp3"
sound[2]= "../schemes/FBNflybynight.mp3"
sound[3]= "../schemes/2112overture1.mp3"
sound[4]= "../schemes/2112overture2.mp3"
sound[5]= "../schemes/2112overture3.mp3"
sound[6]= "../schemes/AF2Kcloser2heart1.mp3"
sound[7]= "../schemes/AF2Kcloser2heart2.mp3"
sound[8]= "../schemes/HEMtrees1.mp3"
sound[9]= "../schemes/HEMtrees2.mp3"
sound[10]= "../schemes/HEMtrees3.mp3"
sound[11]= "../schemes/HEMtrees4.mp3"
sound[12]= "../schemes/PeWspirit1.mp3"
sound[13]= "../schemes/PeWspirit2.mp3"
sound[14]= "../schemes/PeWfreewill1.mp3"
sound[15]= "../schemes/PeWfreewill2.mp3"
sound[16]= "../schemes/PeWfreewill3.mp3"
sound[17]= "../schemes/MPlimelight.mp3"
sound[18]= "../schemes/MPtomsawyer1.mp3"
sound[19]= "../schemes/MPtomsawyer2.mp3"
sound[20]= "../schemes/MPtomsawyer3.mp3"
sound[21]= "../schemes/MPredbarchetta.mp3"
sound[22]= "../schemes/SIGnwman.mp3"
sound[23]= "../schemes/SIGsubdivisions1.mp3"
sound[24]= "../schemes/SIGsubdivisions2.mp3"
sound[25]= "../schemes/GUPdew.mp3"
sound[26]= "../schemes/PoWbigmoney1.mp3"
sound[27]= "../schemes/PoWbigmoney2.mp3"
sound[28]= "../schemes/PoWbigmoney3.mp3"
sound[29]= "../schemes/HYFforceten1.mp3"
sound[30]= "../schemes/HYFforceten2.mp3"
sound[31]= "../schemes/HYFtimestandstill.mp3"


/*Begin Sound Player Script*/
   soundFile=sound[randomNum(sound.length)]
/*Decide whether to use embed or bgsound.*/
   if (navigator.appName.indexOf('Microsoft')>=0) {
      document.writeln ('<bgsound src="'+soundFile+' " loop="0">')
   }else{
      document.writeln ('<embed src="'+soundFile+'" hidden=true autostart=true loop=false >')
}
