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

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


var firstLoad = true;
function centerContent() {
	/*
	if (firstLoad) {	
		var w = windowWidth();
		var h = windowHeight();
		
		var newW = (w - document.getElementById("main").offsetWidth)/2;
		var newH = (h - document.getElementById("main").offsetHeight)/2;
			
		
		document.getElementById("main").style.position = "absolute";
		
		if (newH>0) {
			document.getElementById("main").style.top = newH;
		} else {
			document.getElementById("main").style.position = "relative";
			document.getElementById("main").style.top = 0;
		}
		if (newW>0) {
			document.getElementById("main").style.left = newW;
		} else {
			document.getElementById("main").style.position = "relative";
			document.getElementById("main").style.left = 0;		
		} 
		firstLoad = false;
	}
	*/
}


function swapImage(id,newImage) {
	document.getElementById(id).oldSrc = document.getElementById(id).src;
	document.getElementById(id).src = newImage;
}

function restoreImage(id) {
	document.getElementById(id).src = document.getElementById(id).oldSrc;
}

function openWindow(url) {	
	winname = "foto_detail_fenster";
	winoptions = "width=684,height=285"
	myurl = "./enlarge_foto.php?image=" + url;
	DetailFenster = window.open(myurl, winname, winoptions);   
	DetailFenster.focus();	
}

function resizeToImage() {
	var w = document.getElementById("image").offsetWidth + 20;
	var h = document.getElementById("image").offsetHeight + 100;
	
	this.resizeTo(w,h);
}


