text: /*
  ---
  
  name: DomReady
  
  description: Contains the custom event domready.
  
  license: MIT-style license.
  
  requires: Element.Event
  
  provides: DomReady
  
  ...
  */
  
  Element.Events.domready = {
  
  	onAdd: function(fn){
  		if (Browser.loaded) fn.call(this);
  	}
  
  };
  
  (function(){
  
  	var domready = function(){
  		if (Browser.loaded) return;
  		Browser.loaded = true;
  		window.fireEvent('domready');
  		document.fireEvent('domready');
  	};
  	
  	window.addEvent('load', domready);
  
  	if (Browser.Engine.trident){
  		var temp = document.createElement('div');
  		(function(){
  			($try(function(){
  				temp.doScroll(); // Technique by Diego Perini
  				return document.id(temp).inject(document.body).set('html', 'temp').dispose();
  			})) ? domready() : arguments.callee.delay(50);
  		})();
  	} else if (Browser.Engine.webkit && Browser.Engine.version < 525){
  		(function(){
  			(['loaded', 'complete'].contains(document.readyState)) ? domready() : arguments.callee.delay(50);
  		})();
  	} else {
  		document.addEvent('DOMContentLoaded', domready);
  	}
  
  })();
  