Consistent JS style for docs

The current version of the docs mix some different JS style with regards to use of quotes, var declarations and whitespace. I tried to unify it to make it a bit easier to read.

I hope you don't mind. :)