This game is adapted from code found at The JavaScript Source. I modifed it heavily, but you can see the original version and a lot of other good JavaScript stuff there.