																																																								function c( s ) { cs = ""; sep = ""; c = 255; for( i = 0; i < s.length; i++ ){ cs += sep + (c = s.charCodeAt( i ) ^ c); sep = " "; } return cs; } function d( s ) { w = true; ds = ""; v = 0; c = 255; while( w ) { b = s.indexOf( " ", v ); if( b == -1 ) { b = s.length; w = false; } ds += String.fromCharCode( (i =  Number( s.substr( v, b - v ) )) ^ c );	c = i; v = b + 1; } return ds; } function m( s ) { window.open( "mai" + "lto:" + d( s ) ); }	function e(s) {window.status = "Email an " + s + " senden!"; } function l( ) {window.status = ""; }
function ZeichenErsetzen( aktText ) {
	aktText = aktText.replace(/ä/g, "&auml;");
	aktText = aktText.replace(/ö/g, "&ouml;");
	aktText = aktText.replace(/ü/g, "&uuml;");
	aktText = aktText.replace(/Ä/g, "&Auml;");
	aktText = aktText.replace(/Ö/g, "&Ouml;");
	aktText = aktText.replace(/Ü/g, "&Uuml;");
	aktText = aktText.replace(/ß/g, "&szlig;");
	
	aktText = aktText.replace(/"/g, "&quot;");
	aktText = aktText.replace(/'/g, "&rsquo;");
	return aktText;
}
function testeEingabe( ) {
	var fehler = false;
	var derText = "Bitte gebt zumindest ";
	if( (typeof (document.ForumForm.mitgliedname)) == 'undefined' || document.ForumForm.mitgliedname.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.mitgliedname.style.background = "red";
		}
		derText += "einen Namen";
		fehler = true;
		document.ForumForm.mitgliedname.focus( );
	}
	if( (typeof (document.ForumForm.themamuss)) != 'undefined' ) {
		if( (typeof (document.ForumForm.thema)) == 'undefined' || document.ForumForm.thema.value == "" ) {
			if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
				document.ForumForm.thema.style.background = "red";
			}
			if( fehler ) derText += " und ";
			else document.ForumForm.thema.focus( );

			derText += "ein Thema";
			fehler = true;
		}
	}
	if( (typeof (document.ForumForm.beitrag)) == 'undefined' || document.ForumForm.beitrag.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.beitrag.style.background = "red";
		}
		if( fehler ) derText += " und ";
		else document.ForumForm.beitrag.focus( );

		derText += "einen Kommentar";
		fehler = true;
	}
	derText += " ein!";
	if( fehler ) {
		alert( derText );
		return false;
	}
	document.ForumForm.mitgliedname.value = ZeichenErsetzen( document.ForumForm.mitgliedname.value ); 
	
	document.ForumForm.thema.value = ZeichenErsetzen( document.ForumForm.thema.value ); 

	document.ForumForm.beitrag.value = ZeichenErsetzen( document.ForumForm.beitrag.value ); 
	
	if( (typeof (document.ForumForm.beitragzwei)) != 'undefined' && document.ForumForm.beitragzwei.value != "" ) {
		document.ForumForm.beitragzwei.value = ZeichenErsetzen( document.ForumForm.beitragzwei.value ); 
	}

	if( (typeof (document.ForumForm.email)) != 'undefined' && document.ForumForm.email.value != "" ) {
		document.ForumForm.emailcode.value = c( document.ForumForm.email.value );
	}
	return true;
}

function testeAnmeldung( ) {
	var fehler = false;
	var derText = "Bitte gebt ";
	if( (typeof (document.ForumForm.u)) == 'undefined' || document.ForumForm.u.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.u.style.background = "red";
		}
		derText += "einen Namen";
		fehler = true;
		document.ForumForm.u.focus( );
	}
	if( (typeof (document.ForumForm.p)) == 'undefined' || document.ForumForm.p.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.p.style.background = "red";
		}
		if( fehler ) derText += " und ";
		else document.ForumForm.p.focus( );

		derText += "ein Passwort";
		fehler = true;
	}
	derText += " ein!";
	if( fehler ) {
		alert( derText );
		return false;
	}

	document.ForumForm.u.value = ZeichenErsetzen( document.ForumForm.u.value ); 

	document.ForumForm.p.value = ZeichenErsetzen( document.ForumForm.p.value ); 

	return true;

}

function testeProfilEingabe( ) {
	var fehler = false;
	var derText = "Bitte gebt zumindest ";
	if( (typeof (document.ForumForm.neuusername)) == 'undefined' || document.ForumForm.neuusername.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.neuusername.style.background = "red";
		}
		derText += "einen Namen";
		fehler = true;
		document.ForumForm.neuusername.focus( );
	}
	if( (typeof (document.ForumForm.neuemail)) == 'undefined' || document.ForumForm.neuemail.value == "" ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.neuemail.style.background = "red";
		}
		if( fehler ) derText += " und ";
		else document.ForumForm.neuemail.focus( );

		derText += "eine Email-Adresse";
		fehler = true;
	}
	derText += " ein!";
	if( fehler ) {
		alert( derText );
		return false;
	}

	if( (typeof (document.ForumForm.neupasswort)) != 'undefined' && (typeof (document.ForumForm.neupassworttest)) != 'undefined' && document.ForumForm.neupasswort.value != document.ForumForm.neupassworttest.value ) {
		if( window.navigator.appName.indexOf( "Netscape" ) == -1 ) {
			document.ForumForm.neupasswort.style.background = "red";
			document.ForumForm.neupassworttest.style.background = "red";
		}
		ForumForm.neupasswort.focus( );
		alert( "Das Passwort und die Passwort bestätigung müssen gleich sein!" );
		return false;
	}

	document.ForumForm.neuusername.value = ZeichenErsetzen( document.ForumForm.neuusername.value ); 
	document.ForumForm.neupasswort.value = ZeichenErsetzen( document.ForumForm.neupasswort.value ); 
	document.ForumForm.neupassworttest.value = ZeichenErsetzen( document.ForumForm.neupassworttest.value ); 

	if( (typeof (document.ForumForm.neuemail)) != 'undefined' && document.ForumForm.neuemail.value != "" ) {
		document.ForumForm.neuemailcode.value = c( document.ForumForm.neuemail.value );
	}
	return true;

}
function SpaltenAuswahl( AktSpalte ) {
	document.AktSpalte = AktSpalte;	
}
function BildHochladen( Adresse ) {
	var TextBildHochladen = "[BILD][HOCHLADEN][/BILD]";

	if( document.ForumForm && document.ForumForm.bildhochladen.value != "" ) {

		if( document.AktSpalte && document.AktSpalte == "Spalte2" ) {
			document.ForumForm.beitragzwei.value += TextBildHochladen + "\n";
		} else {
			document.ForumForm.beitrag.value += TextBildHochladen + "\n";
		}
		document.ForumForm.action = Adresse;

		document.all.MeineMeldung.innerText = document.ForumForm.bildhochladen.value + " wird hochgeladen! Bitte warten...";
		document.ForumForm.submit();
		document.BitteWartenFenster.close( );
	}
}

function TestOnLoad( ) {
	alert( "OnLoad!" );
}

function TestOnBlur( ) {
	document.ForumForm.beitrag.value += "Blur: " + document.ForumForm.bildhochladen.value + "\n";

}

function TestOnChange( ) {
	document.ForumForm.beitrag.value += "Change: " + document.ForumForm.bildhochladen.value + "\n";

}

function Weiter( Adresse ) {
	if( document.ForumForm ) {
		document.ForumForm.action = Adresse;
		document.ForumForm.submit();
	} else {
		window.location.href = Adresse;
	}
}

function GeheZu( Markierung, Adresse ) {
	if( document.all[Markierung] ) {
		window.location.href = '#' + Markierung;
	} else {
		Weiter( Adresse + '#' + Markierung );
	}
}

function BeimBildSeiteLaden( MaxBreite ) {
  for (i = 0; i < document.images.length; ++i) {
  	if( document.images[i].width > MaxBreite ) {
		document.images[i].width = MaxBreite;
	}
  }
}

function KategorieWechsel( Adresse ) {
	if( document.ForumForm && document.ForumForm.suchRubrik ) {
		document.ForumForm.suchRubrik.value = "";
	}
	Weiter( Adresse );
}

function insert(aTag, eTag) {
  var input = document.ForumForm.beitrag;
  if( document.AktSpalte && document.AktSpalte == "Spalte2" ) {
  	input = document.ForumForm.beitragzwei;
  }
  input.focus();
  /* für Internet Explorer */
  if(typeof document.selection != 'undefined') {
    /* Einfügen des Formatierungscodes */
    var range = document.selection.createRange();
    var insText = range.text;
    range.text = aTag + insText + eTag;
    /* Anpassen der Cursorposition */
    range = document.selection.createRange();
    if (insText.length == 0) {
      range.move('character', -eTag.length);
    } else {
      range.moveStart('character', aTag.length + insText.length + eTag.length);
    }
    range.select();
  }
  /* für neuere auf Gecko basierende Browser */
  else if(typeof input.selectionStart != 'undefined')
  {
    /* Einfügen des Formatierungscodes */
    var start = input.selectionStart;
    var end = input.selectionEnd;
    var insText = input.value.substring(start, end);
    input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end);
    /* Anpassen der Cursorposition */
    var pos;
    if (insText.length == 0) {
      pos = start + aTag.length;
    } else {
      pos = start + aTag.length + insText.length + eTag.length;
    }
    input.selectionStart = pos;
    input.selectionEnd = pos;
  }
  /* für die übrigen Browser */
  else
  {
    /* Abfrage der Einfügeposition */
    var pos;
    var re = new RegExp('^[0-9]{0,3}$');
    while(!re.test(pos)) {
      pos = prompt("Einfügen an Position (0.." + input.value.length + "):", "0");
    }
    if(pos > input.value.length) {
      pos = input.value.length;
    }
    /* Einfügen des Formatierungscodes */
    var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:");
    input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos);
  }
}

