External js and DOCTYPE

1) Move the script from body to external .js file;
2) Change the DOCTYPE declaration.