/* 
A huge thanks to Simon Willison, the original author of this script.  I found it
in the following article:
http://www.webreference.com/programming/javascript/onloads/

An excerpt from that article gives some insight into the script.

"[this script] has several advantages. For one, 
it's really unobtrusive. It can be placed in a file with your other scripts or 
in a separate file. (If it's in a separate file, just be sure to call it after 
the other files, so the functions will be available.)
Also, it works even if the onload event handler has been previously assigned. 

Simon explains it like this:

    "The way this works is relatively simple: if window.onload has not already 
    been assigned a function, the function passed to addLoadEvent is simply 
    assigned to window.onload. If window.onload has already been set, a brand 
    new function is created which first calls the original onload handler, then 
    calls the new handler afterwards."
"

NOTE: Simon Willison himself presented this solution in the following article
(the comments that follow it are interesting as well):
http://simonwillison.net/2004/May/26/addLoadEvent/
*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(centerSite);
window.onresize = centerSite;