<!--
/*	Gästebuch-Scripts von DeWitts Homepage

	=========================================================
	|        Javascripts by D.Heinze (dew1tt@gmx.de)        |
	|														|
	|  Die folgenden Scripts sind zur nicht-kommerziellen   |
	|  Weitergabe freigegeben, jedoch nur unter der Vor-	|
	|  raussetzung, dass dieser Header erhalten bleibt.		|
	|														|
	|  The following scripts may be resistributed for non-	|
	|  commercial use, provided this header remains intact.	|
	=========================================================
*/

function chkForm() {
	if (document.comment_form.spam_n.value == 'Name hier eingeben') document.comment_form.spam_n.value = '';
	if (document.comment_form.email.value == 'EMail-Adresse hier eingeben') document.comment_form.email.value = '';
	if (document.comment_form.spam_t.value == 'Kommentar hier eingeben') document.comment_form.spam_t.value = '';
	if (document.comment_form.www.value == 'http://') document.comment_form.www.value = '';

	document.getElementById('spam_n_container').className = 'required';
	document.getElementById('spam_t_container').className = 'required';

	if (document.comment_form.spam_n.value == '') {
		document.getElementById('spam_n_container').className = 'required_error';
		window.alert('Bitte geben Sie einen Namen an!');
		document.comment_form.spam_n.focus();
		return false;
	}
	else if (document.comment_form.spam_t.value == '') {
		document.getElementById('spam_t_container').className = 'required_error';
		window.alert('Bitte geben Sie einen Kommentar ein!');
		document.comment_form.spam_t.focus();
		return false;
	}
}

function bbCode(type) {
	if (document.comment_form.spam_t.value == 'Kommentar hier eingeben') document.comment_form.text.value = '';
	if (type == 'b' || type == 'i' || type == 'u') {
		if (text = window.prompt('Zu formattierenden Text eingeben:',''))
			document.comment_form.spam_t.value += '['+type+']'+text+'[/'+type+']';
	}
	else if (type == 'url') {
		if (url = window.prompt('URL des Links eingeben:','http://')) {
			text = window.prompt('Link-Text eingeben:\n(wird nichts eingegeben, erscheint die URL als Text)','');
			if (text == '' || !text) text = url;
			document.comment_form.spam_t.value += '[url='+url+']'+text+'[/url]';
		}
	}
}

//-->
