@Typhoon101Apr 24.2007 — #When an html page loads, it reads your code from top to bottom. Therefore any script written in the head is performed before the actual site content is written to the page.
Although you can write functions in the body, it is good practice to include all of your scripts either in an external file or within the head. It makes things neat.
Within the body you should only really use JavaScript to call functions that were previously written in the head.