d// JavaScript Document
function ChangeSrc(ImgId,NewPic)
//Überschreibt die Img-Src des übergebenen Elementes mit neuem Pfad
{
	var Img2Change;
	Img2Change = document.getElementById(ImgId);
	Img2Change.src = NewPic;
}
function NewWindow()
//öffnet neues Browser-Fenster
{
	window.open();
}
function ValidateGuestBook()
// Prüft ob alle Felder gefüllt sind (Eintragung ins Gästebuch)
{
	SubmitForm=true;
	if (document.GuestbookAddEntry.Name.value == "" || document.GuestbookAddEntry.Name.value == "Bitte ausfüllen!!")
	{
		document.GuestbookAddEntry.Name.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	
	//Prüfen ob Internetadresse in Textfeld und im Betreff eingegeben wurde
	GuestbookName= document.GuestbookAddEntry.Name.value;
	GuestbookText = document.GuestbookAddEntry.Text.value;
	if (GuestbookText.indexOf("www.") != -1 || GuestbookText.indexOf("http:") != -1 || GuestbookName.indexOf("www.") != -1 || GuestbookName.indexOf("http:") != -1)
	{
		document.GuestbookAddEntry.Text.value="Sie dürfen keine Internetadressen eingeben!! "+document.GuestbookAddEntry.Text.value;
		SubmitForm=false;
	}
	
	if (document.GuestbookAddEntry.Text.value=="" || document.GuestbookAddEntry.Text.value == "Bitte ausfüllen!!")
	{
		document.GuestbookAddEntry.Text.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	return SubmitForm;
}
function ValidateMailForm()
{
	SubmitForm=true;
	if (document.MailForm.Name.value == "" || document.MailForm.Name.value == "Bitte ausfüllen!!")
	{
		document.MailForm.Name.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.MailForm.Email.value == "" || document.MailForm.Email.value == "Bitte ausfüllen!!")
	{
		document.MailForm.Email.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.MailForm.Betreff.value == "" || document.MailForm.Betreff.value == "Bitte ausfüllen!!")
	{
		document.MailForm.Betreff.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.MailForm.Nachricht.value == "" || document.MailForm.Nachricht.value == "Bitte ausfüllen!!")
	{
		document.MailForm.Nachricht.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	return SubmitForm;
}


////////
////Forum
////////
function ValidateForumReg()
// Prüft ob alle Felder gefüllt sind, ob das Passwort 2x korrekt eingegeben wurde und ob die E-Mail-Adresse gültig ist
{
	SubmitForm=true;
	//Felder gefüllt?
	if (document.ForumRegistration.VName.value == "" || document.ForumRegistration.VName.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.VName.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.NName.value == "" || document.ForumRegistration.NName.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.NName.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.Pseudo.value == "" || document.ForumRegistration.Pseudo.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.Pseudo.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.Passwort.value == "" || document.ForumRegistration.Passwort.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.Passwort.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.PasswortWiederh.value == "" || document.ForumRegistration.PasswortWiederh.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.PasswortWiederh.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.Email.value == "" || document.ForumRegistration.Email.value == "Bitte ausfüllen!!")
	{
		document.ForumRegistration.Email.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.ForumRegistration.GebDatumJahr.value == "" ||  document.ForumRegistration.GebDatum.value == "Ausf")
	{
		document.ForumRegistration.GebDatumJahr.value="Ausf";
		SubmitForm=false;
	}
	
	//Passwort bestätigt?
	if (document.ForumRegistration.Passwort.value != document.ForumRegistration.PasswortWiederh.value)
	{
		document.ForumRegistration.Passwort.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	
	//E-Mail korrekt? (xyz@abc.xx)
	
	//Geburtsdatum korrekt? (TT.MM.JJJJ)
	
	return SubmitForm;
}
function ValidateThreadCreator()
{
	SubmitForm=true;
	//Inhalt und Betreff müssen gefüllt sein
	if (document.CreateNewThread.Betreff.value == "" || document.CreateNewThread.Betreff.value == "Bitte ausfüllen!!")
	{
		document.CreateNewThread.Betreff.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	if (document.CreateNewThread.Inhalt.value == "" || document.CreateNewThread.Inhalt.value== "Bitte ausfüllen!!")
	{
		document.CreateNewThread.Inhalt.value="Bitte ausfüllen!!";
		SubmitForm=false;
	}
	return SubmitForm;
}
