/*

onload.js

This file contains a safe way to have multiple onload events throughout the site.


*/

/*
  We'll override the default onload event, this should not be done anywhere else in the site otherwise
   it will break the whole system.
*/
window.onload = function() {

    for (f in onloadFunctions) {
        eval(onloadFunctions[f]+'()');
    }
}

/*
  We'll keep an array of function names here. These are the actual functions to be called when the page finishes
  loading. Other pages will add their own functions to this array.
*/
var onloadFunctions = new Array();
var functionCount = 0;

function addOnloadFunction(functionName) {
    onloadFunctions[functionCount++] = functionName;
}
