function decodeMail(encodedEmail) {
	var args = decodeMail.arguments;
	var email = "";
	for (i=0; i < encodedEmail.length; i+=2) {
		var letter = "";
		letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)
		email += String.fromCharCode(parseInt(letter,16));
	}
	var label = typeof(args[1]) == "undefined" ? email : args[1];
	document.write('<a href="mailto:' + email + '">' + label + '</a>');
}

function decodeForm(encodedForm) {
	var args = decodeForm.arguments;
	var email = "";
	for (i=0; i < encodedForm.length; i+=2) {
		var letter = "";
		letter = encodedForm.charAt(i) + encodedForm.charAt(i+1)
		email += String.fromCharCode(parseInt(letter,16));
	}
	var label = typeof(args[1]) == "undefined" ? email : args[1];
	document.write(label);
}

function heading() {
	var args = heading.arguments;
	var title = escape(args[0]);
	var swf = "heading.swf";
	var nops = false;
	
	if (args[1] == 1) {
		swf = "subheading.swf";
	}else if (args[1] == 2) {
		nops = true;
	}
	
	title = title.replace(/%DC/g,"Ü");
	title = title.replace(/%FC/g,"ü");
	title = title.replace(/%D6/g,"Ö");
	title = title.replace(/%F6/g,"ö");
	title = title.replace(/%C4/g,"Ä");
	title = title.replace(/%E4/g,"ä");
	title = title.replace(/%7C/g,"|");
	title = title.replace(/%DF/g,"ß");
	title = title.replace(/%F3/g,"ó");
	title = title.replace(/%u2019/g,"’");
	title = title.replace(/%u2018/g,"‘");

	if (!nops) document.write('<p>');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="355" height="22">');
	document.write('<param name="movie" value="' + swf + '">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="FlashVars" VALUE="title=' + title + '">');
	document.write('<embed wmode="transparent" src="' + swf + '" FlashVars="title=' + title + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="355" height="22"></embed>');
	document.write('</object>');
	if (!nops) document.write('</p>');
}

function getURL() {
	var args = getURL.arguments;
	var query_name = args[0];
	var query_value = args[1];

	var querystring = '';
	var query = location.search.substring(1,location.search.length);
	var querys = query.split('&');

	for (var i=0; i<querys.length; i++) {
		if (querys[i].substr(0, query_name.length + 1) != query_name + "=") querystring += querys[i] + "&";
	}
	
	if (query_name != '' && query_value != '') querystring = query_name + "=" + query_value + "&" + querystring;
	if (querystring != '') querystring = "?" + querystring.substring(0,querystring.length-1);
	window.location.href = "index.asp" + querystring;
}

function popupopen () {
	var args = popupopen.arguments;
	var name   = typeof(args[0]) == "undefined" ? "images/spacer.gif" : args[0];
	var width  = typeof(args[1]) == "undefined" ? 100 : args[1];
	var height = typeof(args[2]) == "undefined" ? 100 : args[2];
	var title  = typeof(args[3]) == "undefined" || args[3] == ''  ? "Details" : args[3];
	var wname  = typeof(args[4]) == "undefined" || args[4] == '' ? "win" : args[4];
	var leftpos= typeof(args[5]) == "undefined" ? false : args[5];
	var toppos = typeof(args[6]) == "undefined" ? false : args[6];
	var closes = typeof(args[7]) == "undefined" ? true : false;
	var printable = typeof(args[8]) == "undefined" ? false : true;
	
	if (!leftpos || !toppos) {
		var leftpos = (screen.height - height)/2;
		var toppos  = (screen.width - width)/2;
	}
	
	if (!printable) {
		win = window.open("","" + wname + "","width=" + width + ",height=" + height + ",left=" + toppos + ",top=" + leftpos);
	}else{
		win = window.open("","" + wname + "","width=" + width + ",height=" + (height + 24) + ",left=" + toppos + ",top=" + leftpos);
	}
	win.document.open();
	win.document.write('<html><head><title>' + title + '</title><link rel="stylesheet" type="text/css" href="styles.css"><meta http-equiv="imagetoolbar" content="no"></head>');
	if (closes) {
		win.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close();">'); 
	}else{
		win.document.write('<body leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	}
	win.document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center">');

	if (name.substr(name.length - 3, 3) == "swf") {
		win.document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + width + '" height="' + height + '">');
		win.document.write('<param name="movie" value="' + name + '">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="quality" value="high">');
		win.document.write('<param name="menu" value="false">');
		win.document.write('<embed src="' + name + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
		win.document.write('</object>');
	}else{
		var alt = (title != "Details") ? title : "";
		win.document.write('<img src="' + name + '" width="' + width + '" height="' + height + '" alt="' + alt + '">'); 
	}
	
	win.document.write('</td></tr>');
	if (printable) win.document.write('<tr><td align="right" height="20"><a class="printlink" href="javascript:self.print();">Seite drucken / print page</a>&nbsp;&nbsp;&nbsp;</td></tr>');
	win.document.write('</table></body></html>');
	win.document.close();
	win.focus();
}