code: function bindOnReady(win, callback, eventUtils) {
        var doc = win.document, event = { type: 'ready' };
  
        if (eventUtils.domLoaded) {
          callback(event);
          return;
        }
  
        function isDocReady() {
          // Check complete or interactive state if there is a body
          // element on some iframes IE 8 will produce a null body
          return doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body);
        }
  
        // Gets called when the DOM is ready
        function readyHandler() {
          if (!eventUtils.domLoaded) {
            eventUtils.domLoaded = true;
            callback(event);
          }
        }
  
        function waitForDomLoaded() {
          if (isDocReady()) {
            removeEvent(doc, "readystatechange", waitForDomLoaded);
            readyHandler();
          }
        }
  
        function tryScroll() {
          try {
            // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author.
            // http://javascript.nwbox.com/IEContentLoaded/
            doc.documentElement.doScroll("left");
          } catch (ex) {
            Delay.setTimeout(tryScroll);
            return;
          }
  
          readyHandler();
        }
  
        // Use W3C method (exclude IE 9,10 - readyState "interactive" became valid only in IE 11)
        if (doc.addEventListener && !(Env.ie && Env.ie < 11)) {
          if (isDocReady()) {
            readyHandler();
          } else {
            addEvent(win, 'DOMContentLoaded', readyHandler);
          }
        } else {
          // Use IE method
          addEvent(doc, "readystatechange", waitForDomLoaded);
  
          // Wait until we can scroll, when we can the DOM is initialized
          if (doc.documentElement.doScroll && win.self === win.top) {
            tryScroll();
          }
        }
  
        // Fallback if any of the above methods should fail for some odd reason
        addEvent(win, 'load', readyHandler);
      }
docs: Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized.
  It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times.