
function closeImagePopup() {

	if( wndImage && wndImage.close ) {
		wndImage.close();
	}

}

function imagePopup( img, w, h, cssUrl ) {

	var sUrl = '';
	var iTipHeight = (h>600) ? 600 : h+30;
	var iTipWidth = (w>750) ? 750 : w+40;
	var iTipLeft = 0;
	var iTipTop = 0;
	var sTipScrollbars = "yes";

	//closeImagePopup();

	//window.sTipText = sTipText;

	var sParams = "width=" + iTipWidth + ",height=" + iTipHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + sTipScrollbars + ",resizable=yes,left=" + iTipLeft + ",top=" + iTipTop;

	wndImage = window.open( '', 'GFX', sParams );
	wndImage.document.write( '<html>' );
	wndImage.document.write( '<head>' );
	wndImage.document.write( '<link rel="stylesheet" type="text/css" href="'+cssUrl+'" />' );
	wndImage.document.write( '</head>' );
	wndImage.document.write( '<body>' );
	wndImage.document.write( '<img src="'+img+'" width="'+w+'" height"'+h+'" border="0">' );
	wndImage.document.write( '<table width="100%"><tr><td>' );
	wndImage.document.write( '<!-- PageNavigator -->' );
	wndImage.document.write( '<table width="100%" id="pageNavigator" cellspacing="0" cellpadding="0" border="0"><tr><td><a href="javascript:window.close();">Fenster schließen</a></td><td>&nbsp;</td><td class="right"><a href="javascript:window.print();">Drucken</a></td></tr></table>' );
	wndImage.document.write( '<!-- PageNavigator -->' );
	wndImage.document.write( '</td></tr></table>' );
	wndImage.document.write( '</body></html>' );
	wndImage.document.bgColor = "white";
	wndImage.document.close();
	wndImage.focus();

	return false;

}


function textPopup( fileurl ) {

	var windowWidth	= 400;
	var windowHeight = 400;
	var windowLeft = 0;
	var windowTop = 0;
	var windowScrollbars = "yes";
	var windowResize = "yes";

	var sParams = "width=" + windowWidth + ",height=" + windowHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + windowScrollbars + ",resizable=" + windowResize + ",left=" + windowLeft + ",top=" + windowTop;
	winText = window.open( fileurl, 'Popup', sParams );
	winText.focus();

	return false;

}


var wndInfoTip;

/**
 * closeInfoTip()
 *
 * Closes info tip popup window
 */
function closeInfoTip() {

	if( wndInfoTip && wndInfoTip.close ) {
		wndInfoTip.close();
	}

}

/**
 * openInfoTip( string sUrl, string sTipText )
 *
 * Opens info tip popup window
 * and shows sTipText in it. sUrl is InfoTip URL
 */
function openInfoTip( sUrl, sTipText ) {

	var iTipHeight = 400;
	var iTipWidth = 450;
	var iTipLeft = eval( ( screen.availWidth - iTipWidth ) / 2 );
	var iTipTop = 100; //eval( screen.availHeight - 230 );
	var sTipScrollbars = "yes";

	closeInfoTip();

	window.sTipText = sTipText;

	var sParams = "width=" + iTipWidth + ",height=" + iTipHeight + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + sTipScrollbars + ",resizable=no,left=" + iTipLeft + ",top=" + iTipTop;

	wndInfoTip = window.open( sUrl, 'wndInfoTip', sParams );

}