Update layout.html

Moving javascript around.