function getWindowHeight() {
    if (document.all) return document.body.offsetHeight; 
    else return window.innerHeight; 
} 

function getWindowWidth() 
{ 
    if (document.all) return document.body.offsetWidth; 
    else return window.innerWidth; 
} 


function myResize(){
	var wHeight = getWindowHeight();
	var wWidth = getWindowWidth();


	var el = document.getElementById("right-arrow");
	if (el) {
		el.style.left = wWidth-30 -(wWidth-900)/2;
	}
	var el = document.getElementById("left-arrow");
	if (el) {
		el.style.left = -(wWidth-900)/2 ;
	}

	var el = document.getElementById("article_index");
	if (el) {
		el.style.width = wWidth;
		el.style.left = -(wWidth-900)/2;
	}

	var el = document.getElementById("middletext");
	if (el) {
		el.style.width = 840;
		el.style.left = wWidth / 2 - 420;
		el.style.top = Math.max(130, Math.min(wHeight-230 + document.body.scrollTop,Math.max(wWidth/2,447) / 0.8 + 15  -80));
	}
	var el = document.getElementById("middleback");
	if (el) {
		el.style.width = wWidth;
		el.style.top = Math.max(130, Math.min(wHeight-230 + document.body.scrollTop,Math.max(wWidth/2,447) / 0.8 + 15  -80));
	}


	document.getElementById("header").style.width = wWidth;
	var el = document.getElementById("footer");
	if (el) {
		el.style.width = wWidth;
		el.style.top = wHeight-47;
	}
	el= document.getElementById("link");
	if (el) {
		el.style.top = Math.min(wHeight-30 + document.body.scrollTop,Math.max(wWidth/2,447) / 0.8 + 15  + 149);
		el.style.left = wWidth/2-450;
	}
	var q = wWidth / wHeight;

	document.getElementById("home_foto").style.width = wWidth;
	document.getElementById("home_foto").style.height = Math.max(wWidth/2,447) / 0.8;

	var left = document.getElementById("left");
	if (left) {
		document.getElementById("left").style.width = Math.max(wWidth/2,447);
		document.getElementById("left").style.height = Math.max(wWidth/2,447) / 0.8;
		document.getElementById("left_foto").style.left = wWidth/2 - Math.max(wWidth/2,447);
		document.getElementById("left_foto").style.width = Math.max(wWidth/2,447);
		document.getElementById("left_foto").style.height = Math.max(wWidth/2,447) / 0.8;
	}

	var right = document.getElementById("right");
	if (right) {
		document.getElementById("right_foto").style.left = wWidth/2;
		document.getElementById("right").style.width = Math.max(wWidth/2,447);
		document.getElementById("right").style.height = Math.max(wWidth/2,447) / 0.8;
		document.getElementById("right_foto").style.width = Math.max(wWidth/2,447);
		document.getElementById("right_foto").style.height = Math.max(wWidth/2,447) / 0.8;
	}

	var middle = document.getElementById("middle");
	if (middle) {
		document.getElementById("middle").style.width = Math.max(wWidth,894);
		document.getElementById("middle").style.height = Math.max(wWidth,894) / 1.6;
		document.getElementById("middle_foto").style.left = wWidth/2 - Math.max(wWidth/2,447);
		document.getElementById("middle_foto").style.width = Math.max(wWidth,894);
		document.getElementById("middle_foto").style.height = Math.max(wWidth,894) / 1.6;
	}



}

function onScroll(){
	var wHeight = getWindowHeight();
	var wWidth = getWindowWidth();

//	document.getElementById("link").style.top = wHeight-50 + document.body.scrollTop;
	document.getElementById("link").style.top = Math.min(wHeight-30 + document.body.scrollTop,Math.max(wWidth/2,447) / 0.8 + 15  + 149+ document.body.scrollTop);
	document.getElementById("footer").style.top = wHeight-47 + document.body.scrollTop;
}

