if(typeof(this.domReadyIsDone) == 'function' && typeof(this.domReadyListener) == 'function' && typeof(this.document) != 'undefined') {
	(function() {
		var D = this.document, fn, html = D.documentElement || D.getElementsByTagName('html')[0], W = this;
		
		if(html && typeof(html.innerHTML) != 'string') {html = null;}
		
		this.parsingDone = function() {
			if(html && html.innerHTML.toLowerCase().indexOf('</body>') == -1) {
				W.setTimeout(fn, 10);
			} else {
				this.domReadyListener();
			}
		};
		
		/*@cc_on
		fn = function() {this.parsingDone();};
		fn.toString = function() {return 'this.parsingDone();';};
		this.setTimeout(fn, 10);
		return;
		@*/
		var interval, reReady;
		if(typeof(D.readyState) == 'string') {
			reReady = new RegExp('(loaded|complete)', 'i');
			interval = this.setInterval(function() {
				if(this.domReadyIsDone()) {
					this.clearInterval(interval);
				} else {
					if(reReady.test(D.readyState)) {
						this.clearInterval(interval);
						this.domReadyListener();
					}
				}
			}, 10);
		}
	})();
}