added javascript code to player model and player index