function getWindowHeight() {

	if (window.innerHeight) {
		return window.innerHeight;
	}
	if (window.document.documentElement	&& window.document.documentElement.clientHeight) {
		return window.document.documentElement.clientHeight;
	}
	if (window.document.body.offsetHeight) {
		return window.document.body.offsetHeight;
	}

	return 0;
}
function getWindowWidth() {

	if (window.innerWidth) {
		return window.innerWidth;
	}
	if (window.document.documentElement	&& window.document.documentElement.clientWidth) {
		return window.document.documentElement.clientWidth;
	}
	if (window.document.body.offsetWidth) {
		return window.document.body.offsetWidth;
	}

	return 0;
}

function setPositionen() {
    //setPositionGrosskreis();
	setPositionY("Grosskreis",374);
	setPositionAeskulap();
	setPositionX("Spektrograph",497);
	//setPositionX("DJA",855);
	//setPositionY("DJA",345);
	setPositionX("Emc2",735);
	setPositionY("Emc2",250);
	setPositionX("Qi",302);
	setPositionY("Qi",85);
	setPositionX("Aspirin",528);
	setPositionY("Aspirin",242);
}

function setPositionAeskulap() {
	var x=870;
	if(getWindowWidth() > 1000)
		x=getWindowWidth()-1000+870;
	document.getElementById("Aeskulap").style.left = x + "px";
}

function setPositionX(id,links) {
	var x = links*(1+0.95*(getWindowWidth()/1000-1));
	if(x<links)
		x=links;
	document.getElementById(id).style.left = x + "px";
}

function setPositionY(id,unten) {
	if(getWindowHeight()<740) return;
	
	var abstand = getWindowHeight()-740;
	var y = unten + 0.95*abstand*unten/400

	document.getElementById(id).style.bottom = y + "px";
}

function resizeImg() {
	var breite = getWindowWidth();
	var hoehe = getWindowHeight();
	
	if (breite < 800) {
		//document.getElementById("container").style.bottom = 200 + "px";
	}
	
	if(hoehe<600) {
		document.getElementById("container").style.height= hoehe-12 + "px";
		document.getElementById("Titelbild").style.height=hoehe-12 + "px";
		document.getElementById("Titelbild").style.width=hoehe*4/3-16 + "px";
		var abstand=(breite-hoehe*4/3)/2-7;
		document.getElementById("container").style.margin= "2px "+abstand+"px 2px";
	}
		
	
}

/* Firefox */
if (getWindowHeight() && getWindowWidth()) {
	window.onresize = resizeImg;
}

