var Weite = 0, Hoehe = 0;

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

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

function reCalculatePositions() {
	if(Weite != Fensterweite() || Hoehe != Fensterhoehe()) {
		Weite = Fensterweite();
		Hoehe = Fensterhoehe();
		updatePositions();
	}
}

window.onresize = reCalculatePositions;


function px2dez(px) {
	if(px.substr(px.length - 2) == "px") return(px.substr(0, px.length - 2));
	return(px);
}

function updatePositions() {
	x = (Weite / 2) - (732 / 2);
	if(x < 0) x = 0;

	getElement("id", "contentdiv").style.left = x + "px";
	getElement("id", "menudiv").style.left = x - 137 + "px";
}

reCalculatePositions();
updatePositions();
