window.defaultStatus = "www.vdhs.de";

function popupElement(element_id, w, h) {
	zoomed = window.open("popupElement.php?"+element_id ,"popupElement", "width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=no,location=no,menubar=no,toolbar=no,");
	if (window.popupElement) {
		window.popupElement.focus();
	}
}

var bodyHeightDiff = -1;
var bodyHeightEnabled = false;
var bodyHeight_iframe = false;

function setBodyHeight() {
	if(!bodyHeightEnabled) return;
	if(bodyHeightDiff==-1) {
		bodyHeightDiff =
			  parseInt(document.getElementById('i_header').offsetHeight)
			+ parseInt(document.getElementById('i_nav_top').offsetHeight)
			+ parseInt(document.getElementById('i_nav_bottom').offsetHeight)
			+ parseInt(document.getElementById('i_footer').offsetHeight)
			- 3;
	}
	var x,y;
	if(self.innerHeight) { // all except Explorer
		x = self.innerWidth;
		y = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {	// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	setX = y - bodyHeightDiff;
	if(setX<300) setX = 300;
	document.getElementById('i_body_left').style.height = setX + "px";
	//document.getElementById('i_body_right_inner').style.height = (setX-107) + "px";
	document.getElementById('i_body_right_inner').style.height = (setX-19) + "px";
	if(bodyHeight_iframe) {
		document.getElementById('i_body_right_inner_w').style.height = (setX-19) + "px";
	}
	
	// force the ie to repaint (bugfix!!!)
	document.getElementById('i_contents_top').className = "testClass";
	document.getElementById('i_contents_top').className = "";
}

function enableBodySizing() {
	bodyHeightEnabled = true;
	window.onresize = setBodyHeight;
	setBodyHeight();
}

function toggleVis(el) {
	a = document.getElementById(el).style;
	if(a.visibility=="") {
		a.visibility = "hidden";
		a.display = "none";
	} else {
		a.visibility = "";
		a.display = "block";
	}
}

preloaded_images = new Array();
function preloadImg() {
	var image_list = preloadImg.arguments;
	for(var i=0; i < image_list.length; i++) {
		preloaded_images[i] = new Image;
		preloaded_images[i].src = image_list[i];
	}
}
