/** Fix for google chrome 4 beta, which for some reason doesn't send the
  * DOMContentLoaded event to jQuery in large applications.
 **/
(function(){
  if ( /chrome\/4/.test(navigator.userAgent.toLowerCase()) ) {
    jQuery.ready = function(){
      // Make sure that the DOM is not already loaded
      if ( !jQuery.isReady ) {
        // Remember that the DOM is ready
        jQuery.isReady = true;
        // If there are functions bound, to execute
        if ( jQuery.readyList ) {
          var readyList = jQuery.readyList;
          // Reset the list of functions NOW to avoid race conditions
          jQuery.readyList = null;
          // Execute all of them
          jQuery.each( readyList, function(){
              this.call( document, jQuery );
          });
        }
        // Trigger any bound ready events
        jQuery(document).triggerHandler("ready");
      }
    };
    document.addEventListener( "DOMContentLoaded", function(){
        jQuery.ready();
    }, false);
  }
})();
