function Fensterweite() {
	var x;
	if (self.innerHeight) // all except Explorer
	{ x = self.innerWidth; } else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{ x = document.documentElement.clientWidth; } else if (document.body) // other Explorers
	{ x = document.body.clientWidth; }
	return x;
}
function Fensterhoehe() {
	var y;
	if (self.innerHeight) // all except Explorer
	{ y = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{ y = document.documentElement.clientHeight; } else if (document.body) // other Explorers
	{ y = document.body.clientHeight; }
	return y;
}

function neuAufbau() {
	var Html = document.getElementsByTagName("html")[0].style;
	var Body = document.getElementsByTagName("body")[0].style;
	var Haupt = document.getElementById("Haupt");
	var Links = document.getElementById("Links");
	var Oben = document.getElementById("Oben");
	var Logo = document.getElementById("Logo");
	var Mitte = document.getElementById("Mitte");
	var Rechts = document.getElementById("Rechts");
	var Fuss_Haupt = document.getElementById("Fuss_Haupt");
	
	if ( document.getElementById("europakarte") ) {
		var Europakarte = document.getElementById("europakarte").style;
	} else {
		var Europakarte = false;
	}
	
	var Weite = Fensterweite();
	var Hoehe = Fensterhoehe();
	
	// var BreiteMin = 990;
	var BreiteMin = 1024;
	var Breite17Zoll = 1024;
	var Breite19Zoll = 1280;
	var HoeheMin = 250;
	var Hoehe17Zoll = 768;
	var Hoehe19Zoll = 1024;
	
	Links.style.height = "auto";
	
	// Wenn Bildschirm > 19"
	if ( Weite > Breite19Zoll ) {
		Html.overflow = "hidden";
		Body.overflow = "hidden";
		Haupt.style.left = (Weite - 1280) / 2 + "px";
		Haupt.style.width = "1280px";
		Haupt.style.height = Hoehe + "px";
		if ( Hoehe > Hoehe17Zoll && Links.offsetHeight <= Hoehe ) {
			Haupt.style.overflow = "hidden";
			Oben.style.width = "1080px";
			Links.style.height = Haupt.style.height;
			Mitte.style.overflow = "auto";
			Mitte.style.width = "900px";
			Mitte.style.height = Hoehe - 159 + "px";
			Rechts.style.left = "1100px";
			Rechts.style.height = Hoehe - 135 + "px";
			Fuss_Haupt.style.display = "block";
		} else {
			Haupt.style.overflow = "auto";
			Oben.style.width = "1060px";
			Links.style.height = "auto";
			Mitte.style.overflow = "visible";
			Mitte.style.width = "880px";
			Mitte.style.height = "auto";
			Rechts.style.left = "1080px";
			Fuss_Haupt.style.display = "none";
		}
	} else {
		// Wenn Bildschirm > 17"
		Haupt.style.left = "0";
		if ( Weite > Breite17Zoll ) {
			Html.overflow = "hidden";
			Body.overflow = "hidden";
			Haupt.style.width = Weite + "px";
			if ( Hoehe > Hoehe17Zoll && Links.offsetHeight <= Hoehe ) {
				Haupt.style.overflow = "hidden";
				Haupt.style.height = Hoehe + "px";
				Oben.style.width = Weite - 200 + "px";
				Links.style.height = Haupt.style.height;
				Mitte.style.overflow = "auto";
				Mitte.style.width = Weite - 380 + "px";
				Mitte.style.height = Hoehe - 159 + "px";
				Rechts.style.height = Hoehe - 135 + "px";
				Rechts.style.left = Weite - 180 + "px";
				Fuss_Haupt.style.display = "block";
			} else {
				Haupt.style.overflow = "auto";
				Oben.style.width = Weite - 220 + "px";
				Links.style.height = "auto";
				Mitte.style.width = Weite - 400 + "px";
				Mitte.style.overflow = "visible";
				Mitte.style.height = "auto";
				Rechts.style.left = Weite - 200 + "px";
				Fuss_Haupt.style.display = "none";
				if ( Hoehe > 320 ) {
					Html.overflow = "hidden";
					Body.overflow = "hidden";
					Haupt.style.overflow = "auto";
					Haupt.style.width = Weite + "px";
					Haupt.style.height = Hoehe + "px";
				} else {
					Html.overflow = "auto";
					Body.overflow = "auto";
					Haupt.style.overflow = "visible";
					Haupt.style.width = (Weite - 20) + "px";
					Haupt.style.height = "auto";
				}
			}
		} else {
			Links.style.height = "auto";
			Mitte.style.height = "auto";
			Mitte.style.overflow = "visible";
			Fuss_Haupt.style.display = "none";
			// Wenn Bildschirm < 17"
			if ( Weite > BreiteMin ) {
				Html.overflow = "hidden";
				Body.overflow = "hidden";
				Haupt.style.overflow = "auto";
				Haupt.style.width = Weite + "px";
				Haupt.style.height = Hoehe + "px";
				Oben.style.width = Weite - 220 + "px";
				Mitte.style.width = Weite - 400 + "px";
				Rechts.style.left = Weite - 200 + "px";
			} else {
				Html.overflow = "auto";
				Body.overflow = "auto";
				Haupt.style.overflow = "visible";
				Haupt.style.width = BreiteMin + "px";
				Haupt.style.height = "auto";
				Oben.style.width = BreiteMin - 200 + "px";
				Mitte.style.width = BreiteMin - 380 + "px";
				Rechts.style.left = BreiteMin - 180 + "px";
			}
		}
	}
	
	Logo.style.left = Mitte.style.width;
	Fuss_Haupt.style.width = Mitte.style.width;
	
	if ( Europakarte ) {
		var WeiteMitte = Mitte.style.width.replace( "px", "" );
		if ( WeiteMitte > 573 ) {
			Europakarte.left = (( WeiteMitte - 561 ) / 2) - 15 + "px";
		} else {
			Europakarte.left = "0px";
		}
	}
	
	if ( Mitte.style.overflow != "auto" ) {
		if ( Fuss_Haupt.style.display == "none" ) {
			var differ = 0;
		} else {
			var differ = 25;
		}
		var Links_Unterkante = Links.offsetHeight;
		var Mitte_Unterkante = Mitte.offsetHeight + 135 + differ;
		var Rechts_Unterkante = Rechts.offsetHeight + 135;
		
		if ( Hoehe > Links_Unterkante && Hoehe > Mitte_Unterkante && Hoehe > Rechts_Unterkante ) {
			var Unterkante = Hoehe;
		} else {
			if ( Links_Unterkante > Rechts_Unterkante ) {
				if ( Links_Unterkante > Mitte_Unterkante ) {
					var Unterkante = Links_Unterkante;
				} else {
					var Unterkante = Mitte_Unterkante;
				}
			} else {
				if ( Rechts_Unterkante > Mitte_Unterkante ) {
					var Unterkante = Rechts_Unterkante;
				} else {
					var Unterkante = Mitte_Unterkante;
				}
			}
		}
		Links.style.height = Unterkante + "px";
		Mitte.style.height = Unterkante - 135 - differ + "px";
		Rechts.style.height = Unterkante - 135 + "px";
	}
}

function neuLaden() {
	
	neuAufbau();
	
}

/*Überwachung von Netscape initialisieren*/
if ( !window.Weite && window.innerWidth ) {
	window.onresize = neuAufbau;
}

/*Überwachung von MS Internet Explorer initialisieren*/
if ( !window.Weite && document.body && document.body.offsetWidth ) {
	window.onresize = neuAufbau;
}
function Versenden(Prozess){document.forms["Datensatz"].submit();}
function Speichern(Adresse){location.href=Adresse;}

function Land ( int_TextPos, arr_Landnr, str_Schalter ) {
	
	var Infofeld = document.getElementById("Land" + int_TextPos);
	
	if ( str_Schalter == "ein" ) {
		if ( typeof arr_Landnr == "object" ) {
			for ( x=0; x < arr_Landnr.length; x++ ) {
				document.getElementById("Land" + arr_Landnr[x] + "_img").style.display = "block";
			}
		} else {
			document.getElementById("Land" + arr_Landnr + "_img").style.display = "block";
		}
		Infofeld.style.display = "block";
	} else {
		if ( typeof arr_Landnr == "object" ) {
			for ( x=0; x < arr_Landnr.length; x++ ) {
				document.getElementById("Land" + arr_Landnr[x] + "_img").style.display = "none";
			}
		} else {
			document.getElementById("Land" + arr_Landnr + "_img").style.display = "none";
		}
		Infofeld.style.display = "none";
	}
}
function fnAbmelden() {
	document.cookie = "Kunde=" + "0" + "; expires=Thu, 02-Aug-2001 00:00:01 GMT; path=/";
	location.href = location.href;
}
function fnAbmelden2() {
	document.cookie = "Kunde=" + "0" + "; expires=Thu, 02-Aug-2001 00:00:01 GMT; path=/";
}
