

/* *******************************************************************************************
 *         Popup                                                                             *
 ******************************************************************************************* */

function popWinOpen(winW,winH,sUrl,sName,iResize,iScroll,iStatus) {
	var winX, winY ;
	if (screen) {
		if ((screen.height - winH) < 150) {
			winX = (screen.width - winW) / 2;
			winY = 0;
		} else {
			winX = (screen.width - winW) / 2;
			winY = (screen.height - winH) / 2;
		}
		var popWindow = window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH + ",top=" + winY + ",left=" + winX + "");
		if (popWindow) popWindow.focus();
	} else {
		window.open(sUrl,sName,"resizable=" + iResize + ",menubar=0,scrollbars=" + iScroll + ",status=" + iStatus + ",width=" + winW + ",height=" + winH);
	}
}


/* *******************************************************************************************
 *         Height fixes                                                                      *
 ******************************************************************************************* */

function setHeights() {
	try {
		var oArticle = document.getElementById("outer_container_article") ;
		if (oArticle) {
			var oLeft  = document.getElementById("flash_left") ;
			var oMid   = document.getElementById("text_content") ;
			var oRight = (document.getElementById("aktuellt")) ? document.getElementById("aktuellt") : document.getElementById("right_col") ;
			var maxH ;
			if (oLeft && oMid && oRight && oLeft.offsetHeight) {
				maxH = Math.max(oLeft.offsetHeight, oMid.offsetHeight, oRight.offsetHeight) ;
				if (!isNaN(maxH)) {
					oLeft.style.height  = maxH + "px" ;
					oMid.style.height   = maxH + "px" ;
					oRight.style.height = maxH + "px" ;
				}
			} else if (oLeft && oMid && oLeft.offsetHeight) {
				maxH = Math.max(oLeft.offsetHeight, oMid.offsetHeight) ;
				if (!isNaN(maxH)) {
					oLeft.style.height  = maxH + "px" ;
					oMid.style.height   = maxH + "px" ;
				}
			}
		}
	} catch (e) {}
	try {
		var oAdmin = document.getElementById("admin_panels_top") ;
		if (oAdmin) {
			var oContStart   = document.getElementById("outer_container_start") ;
			var oContArticle = document.getElementById("outer_container_article") ;
			if (oContStart) {
				oContStart.style.marginTop = "10px" ;
			} else if (oContArticle) {
				oContArticle.style.marginTop = "10px" ;
			}
		}
	} catch (e) {}
}

if (window.attachEvent) {
	window.attachEvent("onload",    function(){ setHeights(); }) ;
} else if (window.addEventListener) {
	window.addEventListener("load", function(){ setHeights(); }, true) ;
}

