//Strting durchsuchen und Ersetzen
function SuchenUndErsetzen(QuellText, SuchText, ErsatzText){   
	if ((QuellText == null) || (SuchText == null))           { return null; }
	if ((QuellText.length == 0) || (SuchText.length == 0))   { return QuellText; }
	
	// Kein ErsatzText ?
	if ((ErsatzText == null) || (ErsatzText.length == 0))    { ErsatzText = ""; }
	
	var LaengeSuchText = SuchText.length;
	var LaengeErsatzText = ErsatzText.length;
	var Pos = QuellText.indexOf(SuchText, 0);
	
	while (Pos >= 0)
	{
	    QuellText = QuellText.substring(0, Pos) + ErsatzText + QuellText.substring(Pos + LaengeSuchText);
	    Pos = QuellText.indexOf(SuchText, Pos + LaengeErsatzText);
	}
	return QuellText;
}


//Neues Fenster öffnen
function Neufenster_Aufbau(imgname1, imgname2,  imgtitle1, Breite, Hoehe, FarbeHintergrund, FarbeText) {
	imgtitle1=unescape(imgtitle1);
	
	var titellaenge=imgtitle1.length;
	ZusatzHoehe=0;
	ZusatzHoehe=40 * parseInt(imgtitle1.length/39)	;
	if (ZusatzHoehe <100) {ZusatzHoehe=100;}
	
	var winwid =Breite +40;
   	var winhgt =Hoehe + ZusatzHoehe;
   	
	var winfeatures = "scrollbars=0,width=" + winwid + ",height=" + winhgt + ",status=0,menu=0,resizable=1,top=0,left=0";
	n_win = window.open("","ShowImage",winfeatures);
	n_win.document.write('<head>');
	n_win.document.write('<title>',imgtitle1,'</title>');
	n_win.document.write('<style type="text/css">');
	n_win.document.write('body {background-color: ',FarbeHintergrund,'; color: ',FarbeText,'; text-align: center; font-family:arial,helvetica,sans-serif;font-weight:bold;font-size:11px;');
	n_win.document.write('</style>');
	n_win.document.write('</head>');
	n_win.document.write('<body>');
	
	n_win.document.write('<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td width="100%" style="text-align:center;font-size:11px;">');
	n_win.document.write('<b>',imgtitle1,'</b><br/><br/>');
	n_win.document.write('</td></tr></table>');
	
	n_win.document.write('<A HREF="#" OnClick="JavaScript:self.close(); return false;"  STYLE="text-decoration:none; border=0; cursor:pointer;">');
	if (imgname2 !='0') {
		n_win.document.write('<img src="',imgname2,'" ALT="zum Schließen Bild anklicken" BORDER=0/></br>');
	}
	if (imgname1 !='0') {
		n_win.document.write('<img src="',imgname1,'" ALT="zum Schließen Bild anklicken" BORDER=0/>');
	}
	n_win.document.write('</A>'); 
	//n_win.document.write('<br/><br/><font size="1"><b>- - zum Schließen Bild anklicken - -</b></font><br/>');
	n_win.document.write('<br/><br/><b>- - zum Schließen Bild anklicken - -</b><br/>');
	n_win.document.write('</body>');
	n_win.document.close();
	
	if (n_win.outerHeight) n_win.moveTo((screen.availWidth-n_win.outerWidth)/2, (screen.availHeight-n_win.outerHeight)/2);
  	else n_win.moveTo((screen.availWidth-winwid)/2, (screen.availHeight-winhgt)/2);
   	n_win.focus();
}