
function Fensterweite() {
	if (window.innerWidth) {
		return window.innerWidth;
	} else {
		if (document.documentElement.clientWidth) {
			return document.documentElement.clientWidth-5;
		} else {
			if (document.body && document.body.offsetWidth) {
				return document.body.offsetWidth-5;
			} else {
				return 0;
			}
		}
	}
}

function Fensterhoehe() {
	if (window.innerHeight) return window.innerHeight;
	else if (document.documentElement.clientHeight) return document.documentElement.clientHeight;
	else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
	else return 0;
}

function neuAufbau() {
	var Dokument = document.getElementById("Haupt").style;
	var Content = document.getElementById("content").style;
	
	if ( document.getElementById("text-left") ) {
		var TextLeft = document.getElementById("text-left").style;
		var exist = 1;
	} else {
		var exist = 0;
	}
	
	Weite = Fensterweite();
	Hoehe = Fensterhoehe();
	
	B = Weite - 250;
	if ( B < 1 ) {
		B = 1;
	}
	
	B2 = B - 290;
	if ( B2 < 1 ) {
		B2 = 1;
	}
	
	if ( Hoehe >= 218 ) {
		H = Hoehe - 217;
		HoeheDok = Hoehe - 50;
	} else {
		H = 1;
		HoeheDok = H;
	}
	
	Dokument.top = "25px";
	Dokument.height = HoeheDok + "px";
	
	Content.height = H + "px";
	
	if (Fensterweite() > 1000) {
		Content.width = 800 + "px";
		if (exist == 1) {
			TextLeft.width = 780 + "px";
		}
		Dokument.width = "1000px";
		Dokument.left = ((Weite - 1000) / 2) + "px";;
	} else {
		Content.width = B + "px";
		if (exist == 1) {
			if ( B >= 21 ) {
				TextLeft.width = B - 20 + "px";
			} else {
				TextLeft.width = 1 + "px";
			}
		}
		if ( Weite >= 51 ) {
			Dokument.width = Weite - 50 + "px";
		} else {
			Dokument.width = 1 + "px";
		}
		Dokument.left = "25px";
	}
}

function neuLaden() {
	neuAufbau();
	var Weite = Fensterweite();
	var Hoehe = Fensterhoehe();
	
	/*
	var Anker = document.location.hash;
	if(Anker!="") {
		location.hash=Anker;
	}
	*/
	
}

/*Überwachung von Netscape initialisieren*/
if(!window.Weite && window.innerWidth){
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
  }
/*Überwachung von MS Internet Explorer initialisieren*/
 if(!window.Weite && document.body && document.body.offsetWidth){
   window.onresize = neuAufbau;
   Weite = Fensterweite();
   Hoehe = Fensterhoehe();
  }