Beautified and linted.

http://jsbeautifier.org/
http://www.jslint.com/
Added a max-width so centered alert doesn't touch the "chrome" on mobile.
Added a max-width so centered alert doesn't touch the "chrome" on mobile.

40 pixels instead of 20 pixels.
Hard refactoring...