/*
	DOMAss: http://www.robertnyman.com/domass
	This module by Robert Nyman, http://www.robertnyman.com
	Inspired and influenced by Dean Edwards, Matthias Miller, and John Resig: http://dean.edwards.name/weblog/2006/06/again/
*/
DOMAss.functionsToCall = [
	function() {
		//checked, ob es auf der Seite eine Reiternavi gibt und f�hrt dann dsa init darauf aus
		if('function' == typeof initReiter) {
			initReiter();
		}
	},
	function(){
		//Gibt es auf der Seite eine JS-Funktion mit diesem Namen, dann f�hre Sie aus - Seitenspezifisch
		if('function' == typeof onLoadEvent) { 
			onLoadEvent();
			initGlossarList();
		}
	},
	function() {
		if('function' == typeof openAttraxWindow) {
			openAttraxWindow();	
		}
	},
	function() {
		//onfocus/ onblur im sucheFeld ansto�en ()
		if('function' == typeof searchInputEvent) { 
			searchInputEvent();
		}
	},
	function() {
		XPLAIN.core.changeTitleAndTarget();
		
	},
	function() {
		resetSmallFaq();
	}
		
];

DOMAss.initLoad = function (){
	this.DOMLoaded = false;
	this.DOMLoadTimer = null;
};

DOMAss.DOMHasLoaded = function (){
	if(DOMAss.DOMLoaded) {return;}
	DOMAss.DOMLoaded = true;
	DOMAss.execFunctions();
};

DOMAss.execFunctions = function (){
	if(this.DOMLoaded){
		clearInterval(this.DOMLoadTimer);
	}
	var functionToCall;
	for(var i=0; i<this.functionsToCall.length; i++){
		try{
			functionToCall = this.functionsToCall[i];
			if(typeof functionToCall == "function"){
				functionToCall();
			}
			else if (typeof functionToCall == "string"){
				eval(this.functionsToCall[i]);
			}
		}
		catch(e){
			// Optional: handle error here
		}
	}
};
// ---
/* Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
	if(document.getElementById){
		document.write("<script id=\"ieScriptLoad\" defer src=\"//:\"><\/script>");
	    document.getElementById("ieScriptLoad").onreadystatechange = function() {
	        if (this.readyState == "complete") {
	            DOMAss.DOMHasLoaded();
	        }
	    };
	}
/*@end @*/
// ---
/* Mozilla/Opera 9 */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", DOMAss.DOMHasLoaded, false);
}
// ---
/* Safari */
if(navigator.userAgent.search(/WebKit/i) != -1){
    DOMAss.DOMLoadTimer = setInterval(function (){
		if(document.readyState.search(/loaded|complete/i) != -1) {
			DOMAss.DOMHasLoaded();
		}
	}, 10);
}
// ---
/* Other web browsers */
window.onload = DOMAss.DOMHasLoaded;
// ---
DOMAss.initLoad();
