moved all the javascript in Player.init();