function replace(title) {
	title = title.replace(/%C4/g,"&Auml;");
	title = title.replace(/%D6/g,"&Ouml;");
	title = title.replace(/%DC/g,"&Uuml;");
	title = title.replace(/%DF/g,"&szlig;");
	title = title.replace(/%E4/g,"&auml;");
    title = title.replace(/%E9/g,"&eacute;");
	title = title.replace(/%F6/g,"&ouml;");
	title = title.replace(/%FC/g,"&uuml;");
	title = title.replace(/%C0/g,"&Aacute;");
	title = title.replace(/%26amp%3B/g,"%26");
	title = title.replace(/%3CBR%20%5C%3E/g,"\n");
	title = title.replace(/%3CBR%3E/g,"\n");
	return title;
}

function replaceHeading(htmltag) {
	for(var i = 0; i < document.getElementsByTagName(htmltag).length; i++) {
		var title = document.getElementsByTagName(htmltag)[i].innerHTML;
		if (title != undefined) {
			if (title != "") {
				myObj = document.getElementsByTagName(htmltag)[i];
				myParent = myObj.parentNode;
				
				width = myObj.offsetWidth;
				height = myObj.offsetHeight + 10;
				
				title= replace(escape('<'+htmltag+'>' + title + '</'+htmltag+'>'));						
				var movie = 'fileadmin/swf/heading.swf';
				var htmlOutput = '';
				htmlOutput += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '" align="middle">';
				htmlOutput += '<param name="allowScriptAccess" value="sameDomain" />';
				htmlOutput += '<param name="wmode" value="transparent" />';
				htmlOutput += '<param name="movie" value="' + movie + '" />';
				htmlOutput += '<param name="FlashVars" value="title=' + title + '" />';
				htmlOutput += '<param name="quality" value="high" />';
				htmlOutput += '<param name="scale" value="noscale" />';
				htmlOutput += '<param name="salign" value="lt" />';
				htmlOutput += '<param name="bgcolor" value="#ffffff" />';
				htmlOutput += '<embed src="' + movie + '" FlashVars="title=' + title + '" quality="high" wmode="transparent" scale="noscale" salign="lt" bgcolor="#ffffff" width="' + width + '" height="' + height + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
				htmlOutput += '</object>';

				replaceDiv = document.createElement('div');
				replaceDiv.innerHTML = htmlOutput;
				replaceDiv.className = "heading";			
				myParent.replaceChild(replaceDiv, myObj);	
				i--;
			}
		}	
	}
}

if (MM_FlashCanPlay && document.getElementsByTagName) {
	replaceHeading("h1");
}