Originally Posted by Redd4
why is - window onload - at the bottom?
If you did
window.onload = preparePage; //this is a valid js statement
then the function preparePage would have to be defined before the window.onload because in this case you are assigning a reference to a function and the function needs to be first defined before you can assign references to it to anything.