Placed javascript at bottom of page

Also fixed syntax error