javascript for BattleshipWeb