 

startStack=function() { };
  // A stack of functions to run onload/domready
  registerOnLoad = function(func) {
  var orgOnLoad = startStack;
  
  startStack = function () {
  orgOnLoad();
  func();
  return;   }}
  
  var ranOnload=false;
  
  // Flag to determine if we've ran the starting stack already.
  if (document.addEventListener) {
  // Mozilla actually has a DOM READY event.
  document.addEventListener("DOMContentLoaded", function()
  {if (!ranOnload) {ranOnload=true; startStack();
  }}, false);
  }  else if (document.all && !window.opera)  { 
  // This is the IE style which exploits a property of the (standards defined) defer attribute
  document.write("<scr" + "ipt id='DOMReady' defer=true " + "src=//:><\/scr" + "ipt>");
  document.getElementById("DOMReady").onreadystatechange=function(){
  if (this.readyState=="complete"&&(!ranOnload)){
  ranOnload=true;
  startStack();
  }
  }}
  var orgOnLoad=window.onload;
  window.onload=function() {
  if (typeof(orgOnLoad)=='function')
  {
  orgOnLoad();
  }
  if (!ranOnload) {
  ranOnload=true;
  startStack();
  }}
