	function sturmnetz_popup(width,height) {
		var arrayPageSize = sturmnetz_popup_getPageSize();
		var popupSizeWidth = width;
		var popupSizeHeight = height;
		var arrayPageScroll = sturmnetz_popup_getScrollOffsets();

        var popupTop = arrayPageScroll[1] + (arrayPageSize[3] / 4);
        var popupLeft = arrayPageScroll[0];

/*
		document.write('<div id="popup_overlay"></div>');
		document.write('<div id="popup">');
		document.write('<div id="popup_header">');
		document.write('<h1>' + ueberschrift + '</h1>');
		document.write('</div>');
		document.write('<div id="popup_content"><div style="padding:10px;">');
		document.write(content);
		document.write('</div></div>');
		document.write('<div id="popup_close">');
		document.write('<a href="javascript:sturmnetz_popup_close();"><img src="/grafiken/popup_close.gif" border="0" alt="Schlie&szlig;en" /></a>');
		document.write('</div>');
		document.write('<div style="clear:both;"></div>');
		document.write('</div>');
*/

		document.getElementById("popup_overlay").style.width = '100%'; // arrayPageSize[0] + 'px';
		document.getElementById("popup_overlay").style.height = arrayPageSize[1] + 'px';

		document.getElementById("popup").style.width = popupSizeWidth + 'px';
		document.getElementById("popup").style.height = popupSizeHeight + 'px';
		document.getElementById("popup").style.left = (arrayPageSize[0] - popupSizeWidth) / 2 + 'px';
		document.getElementById("popup").style.top = popupTop + 'px';

		document.getElementById("popup").style.display = 'block';
		document.getElementById("popup_overlay").style.display = 'block';
	}

	function sturmnetz_popup_close() {
		document.getElementById("popup").style.display = 'none';
		document.getElementById("popup_overlay").style.display = 'none';
	}

	function sturmnetz_popup_getPageSize() {
		var xScroll, yScroll;

		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		
		var windowWidth, windowHeight;
		
		if (self.innerHeight) {	// all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}	
		
		// for small pages with total height less then height of the viewport
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else { 
			pageHeight = yScroll;
		}
	
		// for small pages with total width less then width of the viewport
		if(xScroll < windowWidth){	
			pageWidth = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight,windowWidth,windowHeight];
	}

	function sturmnetz_popup_getScrollOffsets()	{
		var XOffset, YOffset;

		if(window.pageXOffset>0)
			XOffset = window.pageXOffset;
		else if(document.documentElement.scrollLeft>0)
			XOffset = document.documentElement.scrollLeft;
		else if(document.body.scrollLeft>0)
			XOffset = document.body.scrollLeft;

		if(window.window.pageYOffset>0)
			YOffset = window.pageYOffset;
		else if(document.documentElement.scrollTop>0)
			YOffset = document.documentElement.scrollTop;
		else if(document.body.scrollTop>0)
			YOffset = document.body.scrollTop;

		if(isNaN(XOffset))
			XOffset = 0;
		if(isNaN(YOffset))
			YOffset = 0;

		return [XOffset,YOffset];
  }
