
/*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/PeWspirit1.mp3"
sound[1]= "../schemes/PeWspirit2.mp3"
sound[2]= "../schemes/HYFtimestandstill.mp3"
sound[3]= "../schemes/PRESTOpresto.mp3" 
sound[4]= "../schemes/CPstickitout.mp3"
sound[5]= "../schemes/SAworkingangels1.mp3"
sound[6]= "../schemes/SAworkingangels4.mp3"
sound[7]= "../schemes/CPleavethingalone2.mp3"
sound[8]= "../schemes/SAfaithless1.mp3"
sound[9]= "../schemes/SAfaithless2.mp3"
sound[10]= "../schemes/CARAVANbu2b1.mp3"
sound[11]= "../schemes/CARAVANbu2b2.mp3"
sound[12]= "../schemes/PeWfreewill1.mp3"
sound[13]= "../schemes/PeWfreewill2.mp3"
sound[14]= "../schemes/PoWmarathon.mp3"
sound[15]= "../schemes/SIGsubdivisions1.mp3"
sound[16]= "../schemes/SIGsubdivisions2.mp3"
sound[17]= "../schemes/MPtomsawyer1.mp3"
sound[18]= "../schemes/MPtomsawyer3.mp3"
sound[19]= "../schemes/MPredbarchetta.mp3"
sound[20]= "../schemes/MPyyz1.mp3"
sound[21]= "../schemes/MPyyz3.mp3"
sound[22]= "../schemes/MPlimelight.mp3"
sound[23]= "../schemes/MPcameraeye1.mp3"
sound[24]= "../schemes/MPcameraeye2.mp3"
sound[25]= "../schemes/MPwitchhunt.mp3"
sound[26]= "../schemes/MPvitalsigns.mp3"
sound[27]= "../schemes/CARAVANcrvn1.mp3"
sound[28]= "../schemes/CARAVANcrvn2.mp3"
sound[29]= "../schemes/CARAVANcrvn3.mp3"
sound[30]= "../schemes/CARAVANcrvn4.mp3"
sound[31]= "../schemes/AF2Kcloser2heart1.mp3"
sound[32]= "../schemes/AF2Kcloser2heart2.mp3"
sound[33]= "../schemes/2112overture1.mp3"
sound[34]= "../schemes/2112overture2.mp3"
sound[35]= "../schemes/SAfarcry2.mp3"
sound[36]= "../schemes/SAfarcry3.mp3"
sound[37]= "../schemes/HEMstrangiato3.mp3"
sound[38]= "../schemes/HEMstrangiato4.mp3"
sound[39]= "../schemes/DEBUTworkingman2.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>')
}