// Scripts für Formularprüfung
function fehlermeldung(feld,status) {
if (status == true) {
	if(document.all)
	{
		document.all[feld + 'error'].style.display = "block";
		document.all[feld + 'text'].style.color = "#C63F3E";
	}
	else if(document.getElementById)
	{
		document.getElementById(feld + 'error').style.display = "block";
		document.getElementById(feld + 'text').style.color = "#C63F3E";
	}
	return true;
   }
else {
	if(document.all)
	{
		document.all[feld + 'error'].style.display = "none";
		document.all[feld + 'text'].style.color = "#000000";
	}
	else if(document.getElementById)
	{
		document.getElementById(feld + 'error').style.display = "none";
		document.getElementById(feld + 'text').style.color = "#000000";
	}
	return false;
   }
}


// Emailtest
function emailtest(feld) {
maileingabe=document.form[feld].value;

// @. und laenge pruefen
if((maileingabe.length <= 5) || (maileingabe.indexOf('@')==-1) || (maileingabe.indexOf('.')==-1))
	{
//	alert("Zeichen fehlt");
	return false;
}

//Verbotene Zeichen
var zeichen="/ ;:,äüö";
laenge=maileingabe.length;
for( i=0;i<laenge;i++ )
{
  badchar=maileingabe.charAt(i);
  if (zeichen.indexOf(badchar)>-1)
  	{
//	alert("Verboten");
	return false;
}}

// Zeichen vor @
atPosition=maileingabe.indexOf('@');
if(atPosition<=1)
	{
//	alert("kein Name");
	return false;
}

// doppeltes @
if(maileingabe.indexOf('@',atPosition+1)>-1)
	{
//	alert("@ dopppelt");
	return false;
}

// punkt nach @
if(maileingabe.indexOf('.',atPosition)==-1)
	{
//	alert("Punkt falsch");
	return false;
}

// Domainnamen pruefen
punktPosition=maileingabe.lastIndexOf('.');
if((punktPosition+3>maileingabe.length) || (punktPosition+5<maileingabe.length) || (punktPosition-atPosition<=1))
	{
//	alert("domänennamen falsch");
	return false;
}
return true
}

