/*
file: files/design/main.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=no,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;
}
function popupImg(sImgUrl, iWidth, iHeight) {
	var sProperties = 'width=' + iWidth + ',height=' + iHeight;
	sProperties += ',status=yes,resizable=yes,menubar=no,locationbar=no,scrollbars=yes,dependent=yes';
	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.resizeBy(iWidth-iOldWidth,iHeight-iOldHeight);
	} else {
		oPW = window.open('', 'PopUp', sProperties);
	}
	with (oPW.document) {
		open('text/html','replace');
		write('<html><head><title>'+sImgUrl+'</title>');
		write('<link rel="stylesheet" href="files/design/popup-img.css">');
		write('</head><body><div align="center"><a href="javascript:self.close();" title="Fenster schlie&szlig;en"><img src="'+sImgUrl+'" ></a></div>');
		write('</body></html>');
		close();
	}
	if (window.focus) {
		oPW.focus();
	}
	return false;
}
