function isEmailAddr(str) 
{
    return str.match(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/);
}

function pruef() {

	if(document.form1.name.value =="") {
	
		document.form1.name.style.backgroundColor='red'
		document.form1.name.style.borderColor='black'		
		alert("Geben Sie einen Namen ein!");
		return false;
	}else{
		document.form1.name.style.backgroundColor='white'
		document.form1.name.style.borderColor='red'		
	
	}
	
	
	if(document.form1.email.value =="") {
		document.form1.email.style.backgroundColor='red'
		document.form1.email.style.borderColor='black'	
		alert("Bitte geben Sie Ihre E-Mail Adresse ein");
		return false;
	}else{
		document.form1.email.style.backgroundColor='white'
		document.form1.email.style.borderColor='red'		
	
	}
	
		if(document.form1.kommentar.value =="") {
		document.form1.kommentar.style.backgroundColor='red'
		document.form1.kommentar.style.borderColor='black'	
		alert("Bitte geben Sie eine Nachricht ein");
		return false;
	}else{
		document.form1.kommentar.style.backgroundColor='white'
		document.form1.kommentar.style.borderColor='red'		
	
	}
	
	
	if(!isEmailAddr(document.form1.email.value)) {
			document.form1.email.style.backgroundColor='red'
		document.form1.email.style.borderColor='black'	
	alert("Die Mailadresse ist nicht g&uuml;litg. Bitte stellen Sie die korrekte Email-Syntax (name@adresse.endung) sicher!");
		return false;
	}
}


function check() {
if (document.form1.email.value != document.form1.email2.value) {
document.form1.Meldung.value = 'Die Mailadressen stimmen nicht &uuml;berein';
document.form1.Meldung.style.backgroundColor='red'

}
else {
document.form1.Meldung.value = 'Die Mailadressen stimmen &uuml;berein!'
document.form1.Meldung.style.backgroundColor='lightgreen'
document.form1.Meldung.style.visibility='visible'}

if(!isEmailAddr(document.form1.email.value)) {
document.form1.Meldung2.value = 'Die Mailadresse ist nicht g&uuml;ltig';
document.form1.Meldung2.style.backgroundColor='red'
}else{
document.form1.Meldung2.value = 'Die Mailadresse ist g&uuml;ltig, Sie k&ouml;nnen das Formular nun absenden!'
document.form1.Meldung2.style.backgroundColor='lightgreen'
document.form1.Meldung2.style.visibility='visible'
}

}