/*
 * utilities.js
 *
 * Acts as a "toolbox" foruseful JavaScript functions.
 *
 * THERE SHOULD BE NO FUNCTION CALLS IN THIS FILE
 *
 * ***************************************************
 * Created 04/24/2008 by Larry Ching
 *
 */
 
 
/* ********************************************
 addLoadEventHandler()
 04/24/08  by Larry Ching
 Used to add an event handler (function) to the window.onload event.
 Used to prevent overwrite of previously defined window.onload event handlers.
 Based on addLoadEvent by Simon Willison.
 ref: http://simonwillison.net/2004/May/26/addLoadEvent/
 
 Usage:
 
 addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
 
 or 
 
 addLoadEvent(function() {
  // more code to run on page load
 });
 
 ********************************************* */
function addLoadEventHandler(func) {
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    var oldonload = window.onload;
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

