Moved all script tags from the bottom of the file to the top inside of a...

... document.ready call