/*
file: /scripts/popup.js
dsc: Variablen und Funktionen (z.B. fuer Popups, ...)
*/

/* Variablen initialisieren */
var bDOM = (document.getElementById && document.createTextNode);
var oPW = '';


/* groesseres Bild in neuem Fenster (Popup) laden */
function popup(sUrl, iWidth, iHeight) {
	var sProperties = 'width=' + iWidth + ',height=' + iHeight;
	sProperties += ',status=no,resizable=yes,menubar=no,locationbar=no,scrollbars=auto,dependent=yes';
	var sPopupHref = sUrl;
	if (!oPW.closed && oPW.location) {
		var iOldWidth=0, iOldHeight=0;
		if (oPW.innerWidth && oPW.innerHeight) {
			// alle ausser MSIE
			iOldWidth = oPW.innerWidth;
			iOldHeight = oPW.innerHeight;
		} else if (oPW.document.documentElement && oPW.document.documentElement.clientHeight) {
			// MSIE 6 im Strict Mode
			iOldWidth = oPW.document.documentElement.clientWidth;
			iOldHeight = oPW.document.documentElement.clientHeight;
		} else if (oPW.document.body) {
			// sonstige MSIE
			iOldWidth = oPW.document.body.clientWidth;
			iOldHeight = oPW.document.body.clientHeight;
		}
		oPW.location.href = sPopupHref;
		oPW.resizeBy(iWidth-iOldWidth,iHeight-iOldHeight);
	} else {
		oPW = window.open(sPopupHref, 'PopUp', sProperties);
	}
	if (window.focus) {
		oPW.focus();
	}
	return false;
}

