addLoadEvent(init);

// 	funktion zum hinzufügen eines onLoad-events
	function addLoadEvent(func) {
	  	var oldonload = window.onload;
	 	if (typeof window.onload != 'function') {
	    	window.onload = func;
	  	} else {
	    	window.onload = function() {
	      		init();
	    	}
	  	}
	}

// 	wird onLoad ausgeführt
	function init() {
		// fügt bei scrollnotwendigkeit den "nach oben" button hinzu	
		if (document.all) {
			inhaltshoehe = document.getElementById("content").offsetHeight + 286;
			fensterhoehe = document.documentElement.clientHeight;
		} else {
			inhaltshoehe = document.getElementById("content").offsetHeight + 286;
			fensterhoehe = window.innerHeight;
		}
		if (inhaltshoehe > fensterhoehe) {
			document.getElementById("additional_nav").innerHTML = "<a href=\"#oben\" class=\"a_top\">nach oben</a> <a href=\"javascript:window.print();\" class=\"a_print\">Seite drucken</a>";
		} else {
			document.getElementById("additional_nav").innerHTML = "<a href=\"javascript:window.print();\" class=\"a_print\">Seite drucken</a>"; 
		}
	
		i = 0;
		while (document.getElementsByTagName("a")[i]) {
			document.getElementsByTagName("a")[i].onfocus = function() { this.blur(); }
			i++;
		}
		
		// vorausladen der bilder
		myImages = new Array();
		myImages = ["fourth/oetker_hover.gif","fourth/stwb_hover.gif","fourth/mccain_hover.gif","fourth/hoermann_hover.gif","fourth/claas_hover.gif","fourth/bakemark_hover.gif","third/mccain_hover.gif","third/oetker_hover.gif","third/bakemark_hover.gif","main/agentur_hover.gif","main/ansprechpartner_hover.gif","main/arbeiten_hover.gif","main/dasneueste_hover.gif","main/newsletter_hover.gif","main/atsintern_hover.gif","main/historie_hover.gif","main/kundenlogin_hover.gif","main/leistungsfelder_hover.gif","main/philosophie_hover.gif","main/referenzen_hover.gif","contact/anfahrt_hover.gif","contact/impressum_hover.gif","contact/kontakt_hover.gif","contact/kontaktformular_hover.gif","contact/steve_hover.gif","contact/wirsuchen_hover.gif","contact/stellenprofile_hover.gif","third/b2b_hover.gif","third/claas_hover.gif","third/gwa_hover.gif","third/hoermann_hover.gif","third/marketing_hover.gif","third/maximen_hover.gif","third/packung_hover.gif","third/positionierung_hover.gif","third/stwb_hover.gif","third/verkauf_hover.gif","third/werbung_hover.gif","third/pr_hover.gif","third/neuemedien_hover.gif"];
		for (i=0;i<myImages.length;i++) {
			eval("bild" + i + " = new Image();");
			eval("bild" + i + ".src = \"images/navigation/" + myImages[i] + "\";");
		}
	}

// öffnet den newsletter in einem popup-fenster
	function popUp(myUrl) {
		x = Math.round((screen.width - 770) / 2);
		y = Math.round((screen.height - 580) / 2);
		newsletter = window.open(myUrl,"nf","width=770,height=580,scrollbars=yes, left=" + x + ",top=" + y);
	}
	
//	zeigt ein bild im popup an
	function show(myimage,mywidth,myheight) {
		x = Math.round((screen.width - mywidth) / 2);
		y = Math.round((screen.height - myheight) / 2);
		showimage = window.open("images/" + myimage,"nf2","width=" + mywidth + ",height=" + myheight + ",left=" + x + ",top=" + y);
		showimage.focus();
	}
	
// 	erstellt einen HTTPRequest
/*	function createHTTPRequest() {
		try { 
			req = new XMLHttpRequest();
			return req;
		} catch (e) {
			try { 
				req = new ActiveXObject("Msxml2.XMLHTTP"); 
				return req;
			} catch (e) {
	        	try { 
					req = new ActiveXObject("Microsoft.XMLHTTP"); 
					return req;
				} catch (failed) { 
					req = null;
					return req;
				}
	    	}  
		}
	}*/
	
//	lädt inhalt ins div
/*	function ladeInhalt() {
		var req = createHTTPRequest();
		req.open("GET", "inhalt.html", true);
		req.onreadystatechange = function() {
		switch (req.readyState) {
	        	case 4:
	        		if (req.status!=200) {
						document.getElementById("inhalt").innerHTML = "Fehler:" + req.status;
	        		} else {
						document.getElementById("inhalt").innerHTML = req.responseText;
	            	}
					break;
	        	default:
	            	return false;
	        		break;     
	    	}
	  	}
		req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	 	req.send(null);
	}*/