/* Copyright © iCorp 2009
*
*	these functions belong to the owner of the www.iCorp.be Site
*	and may only used by permission of the owner
*/

function Tekst2HTML(text,output)
	{
		text = text.replace(eval('/&/g'), '&amp;');
		fromTo = new Array('&AElig;','Æ','&Aacute;','Á','&Acirc;','Â',' &Agrave;','À','&Aring;','Å',
		'&Atilde;','Ã','&Auml; ','Ä','&Ccedil;','Ç','&ETH;','Ð','&Eacute;','É','& Ecirc;','Ê','&Egrave;','È',
		'&Euml;','Ë','&Iacute;' ,'Í','&Icirc;','Î','&Igrave;','Ì','&Iuml;','Ï','&N tilde;','Ñ','&Oacute;','Ó',
		'&Ocirc;','Ô','&Ograve; ','Ò','&Oslash;','Ø','&Otilde;','Õ','&Ouml;','Ö',' &THORN;','Þ','&Uacute;',
		'Ú','&Ucirc;','Û','&Ugrave ;','Ù','&Uuml;','Ü','&Yacute;','Ý','&aacute;','á', '&acirc;','â','&aelig;',
		'æ','&agrave;','à','&aring ;','å','&atilde;','ã','&auml;','ä','&brvbar;','¦', '&ccedil;','ç','&cent;',
		'¢','&copy;','©','&deg;',' °','&eacute;','é','&ecirc;','ê','&egrave;','è','&e th;','ð','&euml;','ë',
		'&frac12;','½','&frac14;','¼ ','&frac34;','¾','&gt;','>','&gt','>','&iacute;',' í','&icirc;','î',
		'&iexcl;','¡','&igrave;','ì','&iq uest;','¿','&iuml;','ï','&laquo;','«','&lt;','<',' &lt','<',
		'&mdash;','—','&micro;','µ','&middot;','· ','&ndash;','–','&not;','¬','&ntilde;','ñ','&oacut e;',
		'ó','&ocirc;','ô','&ograve;','ò','&oslash;','ø','&otilde;','õ','&ouml;','ö','&para;', '¶','&plusmn;',
		'±','&pound;','£','&quot;','\"', '&#39;', '\'','&r aquo;','»','&reg;','®','&sect;','§','­','*','&sup1 ;','¹',
		'&sup2;','²','&sup3;','³','&szlig;','ß','&t horn;','þ','&tilde;','˜','&trade;','™','&uacute;',
		'ú','&ucirc;','û','&ugrave;','ù','&uuml;','ü','&ya cute;','ý','&yen;','¥','&yuml;','ÿ','&euro;','€');

		if (output) {
		fromTo[fromTo.length] = '&amp;';
		fromTo[fromTo.length] = '&';
		}
		for (i=0; i < fromTo.length; i+=2)
		{
			sFind=fromTo[i+1];
			intIndexOfMatch = text.indexOf(sFind);
			while(intIndexOfMatch != -1)
			{
				text = text.replace(sFind, fromTo[i]);
				intIndexOfMatch = text.indexOf(sFind);
			}
		}

		return (text);
	}
