Functioning javascript for BAM player.html