// JavaScript Document
function accPopup(theURL,winName,features) {
		var newwindow=window.open(theURL,winName,features);
		if (window.focus) {newwindow.focus()}
		return false;
}

function openPic(thePic,imageWidth,imageHeight,alt) {
	var newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+(Math.floor((screen.availWidth-imageWidth-10)/2))+",top="+(Math.floor((screen.availHeight-imageHeight)/2)));
	newWindow.document.open();
	newWindow.document.write('<html><head><title>'+alt+'</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><link rel="stylesheet" href="css/adv.css" type="text/css" media="screen, tv, projection" /></head><body class="grossbild" onblur="self.close();">'); 
	newWindow.document.write('<a href="javascript:self.close();"><img src=\"'+thePic+'\" width='+imageWidth+' height='+imageHeight+' title=\"'+alt+'\" alt=\"'+alt+'\"></a>');
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	return false;
}

function setupOpenPic() {
	for (var i=0; i<document.links.length; i++) {
	var theFile = document.links[i].href;
	var fileType = theFile.substr((theFile.lastIndexOf('.')+1),3).toLowerCase();
	if (fileType == 'jpg' || fileType == 'gif') {
		document.links[i].onmouseover = function () {
			window.status = 'zum Vergr\u00F6\u00DFern klicken';
			return true;
		}
		document.links[i].onmouseout = function () {
			window.status = '';
			return true;
		}
		document.links[i].onclick = function () {
			thePath = this.toString();
			fileName = thePath.substr(thePath.lastIndexOf('/')+1);
			fileName = fileName.substr(0,fileName.lastIndexOf('.'));
			imgDim = fileName.substr(fileName.lastIndexOf('_')+1);
			imgDim = imgDim.split('x');
			theTitle=this.title;
			return openPic(this,imgDim[0],imgDim[1],theTitle);
			}	
		}
	}
}

function setFooter() { //courtesy Bobby van der Sluis, http://www.alistapart.com/articles/footers
	if (document.getElementById) {
		var windowHeight=getWindowHeight();
		if (windowHeight>0) {
			var contentHeight=document.getElementById('content').offsetHeight;
			var footerElement=document.getElementById('footer');
			var footerHeight=footerElement.offsetHeight;
			if (windowHeight-(contentHeight+footerHeight)>=115) {
				footerElement.style.top=(windowHeight-(contentHeight+footerHeight+115))+'px';
			} else {
				footerElement.style.top='0px';
			}
		}
	}
}

function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	} else {
		if (document.documentElement&&document.documentElement.clientHeight) {
			windowHeight=document.documentElement.clientHeight;
		} else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function submitThis(id) {
	document[id].submit();
}

//window.onresize = function() {setFooter();}
window.onload = function() {
	setupOpenPic();
	}
