Move javascript code from game.jsp to game.js