
/*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/PoWbigmoney1.mp3"
sound[1]= "schemes/PoWbigmoney2.mp3" 
sound[2]= "schemes/PoWbigmoney3.mp3"
sound[3]= "schemes/PoWgranddesigns.mp3"
sound[4]= "schemes/PoWmanhattan.mp3"
sound[5]= "schemes/PoWmarathon.mp3"
sound[6]= "schemes/PoWterritories1.mp3"
sound[7]= "schemes/PoWterritories2.mp3"
sound[8]= "schemes/PoWterritories3.mp3"
sound[9]= "schemes/PoWmiddletown1.mp3"
sound[10]= "schemes/PoWmiddletown2.mp3"
sound[11]= "schemes/PoWemotiondetector.mp3"
sound[12]= "schemes/PoWmystic1.mp3"
sound[13]= "schemes/PoWmystic2.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>')
}