function fCenterWindow(intWidth,intHeight)
{
   var strOutput = "";

	// Middle Point Of Screen
   intWidth  = (screen.availWidth / 2) - (intWidth / 2) ;
   intHeight = ((screen.availHeight-20) / 2) - (intHeight / 2) ;
   
   // Netscape 4.7
   strOutput += ",screenx=" + intWidth;
   strOutput += ",screeny=" + intHeight;
   
   // Internet Explorer 4.0
   strOutput += ",left=" 	+ intWidth ;
   strOutput += ",top=" 	+ intHeight;
 
   return strOutput;

}

function fLeftWindow(intHeight)
{
   var strOutput = "";

   intHeight = screen.availHeight - (20 + intHeight) ;
   
   // Netscape 4.7
   strOutput += ",screenx=0" ;
   strOutput += ",screeny=" + intHeight;
   
   // Internet Explorer 4.0
   strOutput += ",left=0";
   strOutput += ",top=" 	+ intHeight;
 
   return strOutput;

}

//var win = null;


function fPopUpHtml (strHtmlCode, strHtmlTitle, intWidth, intHeight, strSelect) 
{
	
	var strOutput   = "";
	var strFileName = "";
	
	switch  (strSelect)
	{
		case "flash":
			
			strOutput  =	'<table border="0" cellspacing="0" cellpadding="0">'+"\n";
			strOutput +=	'<tr>'+"\n";
			strOutput +=	'	<td><OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"  ';
			strOutput +=	'		WIDTH="'+ intWidth +'" ';
			strOutput +=	'		HEIGHT="'+ intHeight +'" VIEWASTEXT><PARAM ';
			strOutput +=	'		NAME="movie" VALUE="'+ strHtmlCode +'"><PARAM  ';
			strOutput +=	'		NAME="quality"  VALUE="high"><PARAM  ';
			strOutput +=	'		NAME="menu"  VALUE="true"><EMBED  ';
			strOutput +=	'		SRC="'+ strHtmlCode +'" ';
			strOutput +=	'		WIDTH="'+ intWidth +'" ';
			strOutput +=	'		HEIGHT="'+ intHeight +'" ';
			strOutput +=	'		MENU="false" ';
			strOutput +=	'		QUALITY="high" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT></td>'+"\n";
			strOutput +=	'</tr>'+"\n";
			strOutput +=	'</table>'+"\n";
		
			break;
				
		case "image":
			
			strOutput  =	'<table border="0" cellspacing="0" cellpadding="0">'+"\n";
			strOutput +=	'<tr>'+"\n";
			strOutput +=	'	<td><img';
			strOutput +=	' src="' 	+ strHtmlCode + '" ';
			strOutput +=	' alt="'	+ strHtmlTitle + '" ';
			strOutput +=	' width="'	+ intWidth + '" ';
			strOutput +=	' height="' + intHeight + '" ';
			strOutput +=  	' border="0"></td>'+"\n";
			strOutput +=	'</tr>'+"\n";
			strOutput +=	'</table>'+"\n";
			intWidth = intWidth-4; 
			intHeight = intHeight-4; 
			break;
		
		case "file":
			
			strFileName  =	strHtmlCode;

			break;
			
	}

	strHtmlCode = strOutput;
	
	//if ( win != null )
		//win.close();
	
	var win = window.open(strFileName,  strHtmlTitle,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+intWidth+",height=" + intHeight + fCenterWindow(intWidth,intHeight));
	
	
	
	
	
	if (strSelect != "file"){
	
		// Format HTML
		strOutput ='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'+"\n";
		strOutput +='<HTML>'+"\n";
		strOutput +='<HEAD>'+"\n";
	
		// Title
		strOutput +='	<TITLE>'+strHtmlTitle+'</TITLE>'+"\n";
		strOutput +='	<META http-equiv="content-type" content="text/html;charset=windows-1251">'+"\n";
		strOutput +='	</HEAD>'+"\n";
		strOutput +='<BODY bgcolor="#ffffff" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" style=" border: 0">'+"\n";
	
		// Html Code
		strOutput += strHtmlCode;
		strOutput +='</BODY></HTML>'+"\n";
	
	
	
		// Edit Window (Put HTML
		win.document.open("text/html");	
		win.document.write(strOutput);
		win.document.close();
		
	}
	win.focus();
	
}



function fOpenHtmlWindow(strURL, strName, nWidth, nHeight, nScreenX, nScreenY)
{
	//SecondFenster();
   	var win = window.open(strURL, strName,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes,width="+nWidth+",height="+nHeight+", screenx=" + nScreenX + ", screeny=" + nScreenY + " ");
	win.focus();
}


function fIDBOpenImage(intId, strLanguageEntryUrl)
{
	if(intId != 0)
	{
		strURL = "/" + strLanguageEntryUrl + "/galerie/rtp/" + intId + "/details.htm";
		strName = "Gallery";
		nWidth = 634;
		nHeight = 569;
		nScreenX = 200;
		nScreenY = 200;
		
		fOpenHtmlWindow(strURL, strName, nWidth, nHeight, nScreenX, nScreenY);
	}
}