betting game with javascript