Re-introduce missing layout

I had to re-create it from scratch. Doh...
Tiny fixes suggested by Kirupa

* Put JS open braces on the same line as the statement
* Use 'querySelector' instead of 'getElementByID'
* A few other tiny fixes