
//================================================================
//==== Attach onload handler to kick things off
// See http://www3.telus.net/DougHenderson/test_onload.html
// and for why see: http://www.mapki.com/index.php?title=FAQs#Browser_Problems
// basically. IE doesn't like code that tries to modify document before it's finished rendering.

function addOnloadEvent(fnc){
  if ( typeof window.addEventListener != "undefined" )
    window.addEventListener( "load", fnc, false );
  else if ( typeof window.attachEvent != "undefined" ) {
    window.attachEvent( "onload", fnc );
  }
  else {
    if ( window.onload != null ) {
      var oldOnload = window.onload;
      window.onload = function ( e ) {
        oldOnload( e );
        window[fnc]();
      };
    }
    else
      window.onload = fnc;
  }
}


