function checkLayout () {
	oben_y = 128;
	
	mitte_y = document.getElementById("mitte").offsetHeight;
	rechts_y = document.getElementById("rechts").offsetHeight;
	if ( mitte_y > rechts_y )
	{
		rechts_y = mitte_y +12;
		document.getElementById("rechts").style.height = mitte_y+12 + "px";
	}
	container_y = document.getElementById("container").offsetHeight;
	if ( (oben_y+rechts_y) > container_y )
	{
		document.getElementById("container").style.height = (oben_y+rechts_y) + "px";
	}
	container_y = document.getElementById("container").offsetHeight;
	
	document.getElementById("links").style.height = container_y-oben_y + "px";
	links_y = document.getElementById("links").offsetHeight;
	
	if ( links_y > rechts_y )
	{
		rechts_y = links_y;
		document.getElementById("rechts").style.height = rechts_y + "px";
	}
}

function init() {
	checkLayout();
	var anchors = document.getElementsByTagName('a');

	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		
		if (anchor.addEventListener) {
			anchor.addEventListener("click", function(evt) { 
				ieFake(evt.originalTarget);
	   		}, false);
			anchor.addEventListener("mouseover", function(evt) { 
			if ( evt.originalTarget.title != "" ) {
			window.defaultStatus = "";
			window.status = evt.originalTarget.title;
			}
			return true;
	   		}, false);
		}
		else if (anchor.attachEvent) {
  			anchor.attachEvent("onclick", function(evt) { 
				ieFake(evt.srcElement);
	   		});
  			anchor.attachEvent("onmouseover", function(evt) {
			if ( evt.srcElement.title != "" ) {
			window.defaultStatus = "";
			window.status = evt.srcElement.title;
			}
			return true;
	   		});
		}
	}
}

function ieFake(fake) {
	if ((document.all) && (fake)) fake.blur();
}

var ew = null;
function zoomFenster(datei,x,y,alt,scbar,id,wo) {
	var tmpX = x+52;
	var tmpY = y+90;
	if (id > 0) tmpY = tmpY+20;
	var tmpSc = "no";
	if (tmpY > 500) {
		tmpY = 500;
		tmpSc = "yes";
		tmpX += 16;
	}
	if (scbar == 1) {
		tmpSc = "yes";
		tmpX += 16;
	}
	if (ew != null) if (!ew.closed) ew.close();
	ew = window.open('zoom.php?id=' + id + '&hoch=' + y + '&breit=' + x + '&bild=' + datei + '&titel=' + alt + '&woher=' + wo,'Bildvergroesserung','left=' + ((screen.availWidth/2)-tmpX/2) + ',top=' + ((screen.availHeight/2)-tmpY/2) + ',marginwidth=0 marginheight=0,leftmargin=0,topmargin=0,scrollbars=' + tmpSc + ',status=no,width=' + tmpX + ',height=' + tmpY + ',resizable=no');
	if (ew.opener==null) ew.opener=self;
	return;
}