var popupfenster;
function open_a_window($url,$titel,$width,$height){
if(popupfenster)popupfenster.close();
popupfenster = window.open($url,$titel,'width='+ $width + ','+'height='+ $height + ',scrollbars=yes,resizable=yes');
popupfenster.focus();
return false;
}

function noxhtml(text){
	text = text.replace('&nbsp;',String.fromCharCode(160));
	text = text.replace('&iexcl;',String.fromCharCode(161));
	text = text.replace('&cent;',String.fromCharCode(162));
	text = text.replace('&pound;',String.fromCharCode(163));
	text = text.replace('&curren;',String.fromCharCode(164));
	text = text.replace('&yen;',String.fromCharCode(165));
	text = text.replace('&brvbar;',String.fromCharCode(166));
	text = text.replace('&sect;',String.fromCharCode(167));
	text = text.replace('&uml;',String.fromCharCode(168));
	text = text.replace('&copy;',String.fromCharCode(169));
	text = text.replace('&ordf;',String.fromCharCode(170));
	text = text.replace('&laquo;',String.fromCharCode(171));
	text = text.replace('&not;',String.fromCharCode(172));
	text = text.replace('&shy;',String.fromCharCode(173));
	text = text.replace('&reg;',String.fromCharCode(174));
	text = text.replace('&macr;',String.fromCharCode(175));
	text = text.replace('&deg;',String.fromCharCode(176));
	text = text.replace('&plusmn;',String.fromCharCode(177));
	text = text.replace('&sup2;',String.fromCharCode(178));
	text = text.replace('&sup3;',String.fromCharCode(179));
	text = text.replace('&acute;',String.fromCharCode(180));
	text = text.replace('&micro;',String.fromCharCode(181));
	text = text.replace('&para;',String.fromCharCode(182));
	text = text.replace('&middot;',String.fromCharCode(183));
	text = text.replace('&cedil;',String.fromCharCode(184));
	text = text.replace('&sup1;',String.fromCharCode(185));
	text = text.replace('&ordm;',String.fromCharCode(186));
	text = text.replace('&raquo;',String.fromCharCode(187));
	text = text.replace('&frac14;',String.fromCharCode(188));
	text = text.replace('&frac12;',String.fromCharCode(189));
	text = text.replace('&frac34;',String.fromCharCode(190));
	text = text.replace('&iquest;',String.fromCharCode(191));
	text = text.replace('&Agrave;',String.fromCharCode(192));
	text = text.replace('&Aacute;',String.fromCharCode(193));
	text = text.replace('&Acirc;',String.fromCharCode(194));
	text = text.replace('&Atilde;',String.fromCharCode(195));
	text = text.replace('&Auml;',String.fromCharCode(196));
	text = text.replace('&Aring;',String.fromCharCode(197));
	text = text.replace('&AElig;',String.fromCharCode(198));
	text = text.replace('&Ccedil;',String.fromCharCode(199));
	text = text.replace('&Egrave;',String.fromCharCode(200));
	text = text.replace('&Eacute;',String.fromCharCode(201));
	text = text.replace('&Ecirc;',String.fromCharCode(202));
	text = text.replace('&Euml;',String.fromCharCode(203));
	text = text.replace('&Igrave;',String.fromCharCode(204));
	text = text.replace('&Iacute;',String.fromCharCode(205));
	text = text.replace('&Icirc;',String.fromCharCode(206));
	text = text.replace('&Iuml;',String.fromCharCode(207));
	text = text.replace('&ETH;',String.fromCharCode(208));
	text = text.replace('&Ntilde;',String.fromCharCode(209));
	text = text.replace('&Ograve;',String.fromCharCode(210));
	text = text.replace('&Oacute;',String.fromCharCode(211));
	text = text.replace('&Ocirc;',String.fromCharCode(212));
	text = text.replace('&Otilde;',String.fromCharCode(213));
	text = text.replace('&Ouml;',String.fromCharCode(214));
	text = text.replace('&times;',String.fromCharCode(215));
	text = text.replace('&Oslash;',String.fromCharCode(216));
	text = text.replace('&Ugrave;',String.fromCharCode(217));
	text = text.replace('&Uacute;',String.fromCharCode(218));
	text = text.replace('&Ucirc;',String.fromCharCode(219));
	text = text.replace('&Uuml;',String.fromCharCode(220));
	text = text.replace('&Yacute;',String.fromCharCode(221));
	text = text.replace('&THORN;',String.fromCharCode(222));
	text = text.replace('&szlig;',String.fromCharCode(223));
	text = text.replace('&agrave;',String.fromCharCode(224));
	text = text.replace('&aacute;',String.fromCharCode(225));
	text = text.replace('&acirc;',String.fromCharCode(226));
	text = text.replace('&atilde;',String.fromCharCode(227));
	text = text.replace('&auml;',String.fromCharCode(228));
	text = text.replace('&aring;',String.fromCharCode(229));
	text = text.replace('&aelig;',String.fromCharCode(230));
	text = text.replace('&ccedil;',String.fromCharCode(231));
	text = text.replace('&egrave;',String.fromCharCode(232));
	text = text.replace('&eacute;',String.fromCharCode(233));
	text = text.replace('&ecirc;',String.fromCharCode(234));
	text = text.replace('&euml;',String.fromCharCode(235));
	text = text.replace('&igrave;',String.fromCharCode(236));
	text = text.replace('&iacute;',String.fromCharCode(237));
	text = text.replace('&icirc;',String.fromCharCode(238));
	text = text.replace('&iuml;',String.fromCharCode(239));
	text = text.replace('&eth;',String.fromCharCode(240));
	text = text.replace('&ntilde;',String.fromCharCode(241));
	text = text.replace('&ograve;',String.fromCharCode(242));
	text = text.replace('&oacute;',String.fromCharCode(243));
	text = text.replace('&ocirc;',String.fromCharCode(244));
	text = text.replace('&otilde;',String.fromCharCode(245));
	text = text.replace('&ouml;',String.fromCharCode(246));
	text = text.replace('&divide;',String.fromCharCode(247));
	text = text.replace('&oslash;',String.fromCharCode(248));
	text = text.replace('&ugrave;',String.fromCharCode(249));
	text = text.replace('&uacute;',String.fromCharCode(250));
	text = text.replace('&ucirc;',String.fromCharCode(251));
	text = text.replace('&uuml;',String.fromCharCode(252));
	text = text.replace('&yacute;',String.fromCharCode(253));
	text = text.replace('&thorn;',String.fromCharCode(254));
	text = text.replace('&yuml;',String.fromCharCode(255));	
	return text;
}


/* momentan nicht verwendet */
function encode_utf8(rohtext) {
   // dient der Normalisierung des Zeilenumbruchs
    rohtext = rohtext.replace(/\r\n/g,"\n");
    var utftext = "";
    for(var n=0; n<rohtext.length; n++)
        {
        // ermitteln des Unicodes des  aktuellen Zeichens
        var c=rohtext.charCodeAt(n);
        // alle Zeichen von 0-127 => 1byte
        if (c<128)
            utftext += String.fromCharCode(c);
        // alle Zeichen von 127 bis 2047 => 2byte
        else if((c>127) && (c<2048)) {
            utftext += String.fromCharCode((c>>6)|192);
            utftext += String.fromCharCode((c&63)|128);}
        // alle Zeichen von 2048 bis 66536 => 3byte
        else {
           utftext += String.fromCharCode((c>>12)|224);
           utftext += String.fromCharCode(((c>>6)&63)|128);
           utftext += String.fromCharCode((c&63)|128);}
        }
   return utftext;
}