Although I couldn\'t find a reference to this easily in google, I\'m familiar with the fact that, in javascript, global function declarations get interpreted before any code
The ECMA standard for this behavior is to throw a SyntaxError when parsing the script. Unfortunately doing that is not compatible with the web as Raynos says.
See Which JS function-declaration syntax is correct according to the standard? for some extended discussion on the issue.