JavaScript implementation of the Konami code