function chkFormular(){

mail=document.Formular.Mail;
mailv=document.Formular.Mail.value;

len=mail.length;
leer = mailv.indexOf(" ");
at = mailv.indexOf("@");

	if(document.Formular.Vorname.value==""){
		alert("Geben Sie bitte Ihren Vornamen ein.");
		document.Formular.Vorname.focus();
		return false;
    }  

	if(document.Formular.Nachname.value==""){
		alert("Geben Sie bitte Ihren Nachnamen ein.");
		document.Formular.Nachname.focus();
		return false;
    } 
	
	if(mail.value == ""){
		alert("Geben Sie bitte Ihre Emailadresse ein");
		mail.focus();
		return false;
    }
	
	if(leer != -1) {
		alert("Eine Mail-Adresse darf keine Leerzeichen enthalten!");
		mail.focus();
		return false;
	}
	
	if(at == -1) {
		alert("Eine Mail-Adresse muss ein '@' enthalten!");
		mail.focus();
		return false;
	}
	
	if(mailv.lastIndexOf(".",(len-3)) == -1){
        alert("Das ist keine gültige Emailadresse!");
        mail.focus();
        return false;
	}
}



function checkit (inhalt, id) {
	if (inhalt == "") {
		document.getElementById(id).className="formnein";
	} else {
		document.getElementById(id).className="formok";
	}
}

function checkitanzahl (inhalt, id, anzahl) {
	if (inhalt == "") {
		document.getElementById(id).className="formnein";
	} else {
		if (inhalt.length >anzahl ){
			alert("Bitte maximal "+anzahl+" Zeichen!\n\nIhre Zeichenanzahl: "+inhalt.length);
			return false;
		} else {
			document.getElementById(id).className="formok";
		}
	}
}

function checkitanrede (inhalt, id) {
	if (inhalt == "3") {
		document.getElementById(id).className="formnein";
	} else {
		document.getElementById(id).className="formok";
	}
}

function checkitbundesland (inhalt, id) {
	if (inhalt == "11") {
		document.getElementById(id).className="formnein";
	} else {
		document.getElementById(id).className="formok";
	}
}

function checkitland (inhalt, id) {
	if (inhalt == "88") {
		document.getElementById(id).className="formnein";
	} else {
		document.getElementById(id).className="formok";
	}
}

function chkRegister(sprache){

mail=document.newsletterform.email;
mailv=document.newsletterform.email.value;

len=mail.length;
leer = mailv.indexOf(" ");
at = mailv.indexOf("@");

	if(document.newsletterform.vorname.value==""){
		if (sprache == 2){
			text = "Please specify your firstname.";
		} else {
			text = "Geben Sie bitte Ihren Vornamen an.";
		}
		alert(text);
		document.newsletterform.vorname.focus();
		return false;
    }  

	if(document.newsletterform.nachname.value==""){
		if (sprache == 2){
			text = "Please specify your lastname.";
		} else {
			text = "Geben Sie bitte Ihren Nachnamen an.";
		}
		alert(text);
		document.newsletterform.nachname.focus();
		return false;
    } 
	
	if(mail.value == ""){
		if (sprache == 2){
			text = "Please specify your email.";
		} else {
			text = "Geben Sie bitte Ihre Emailadresse an.";
		}
		alert(text);
		mail.focus();
		return false;
    }
	
	if(leer != -1) {
		if (sprache == 2){
			text = "An email does not contains whitespaces!";
		} else {
			text = "Eine Mail-Adresse darf keine Leerzeichen enthalten!";
		}
		alert(text);
		mail.focus();
		return false;
	}
	
	if(at == -1) {
		if (sprache == '2'){
			text = "Missing @!";
		} else {
			text = "Eine Mail-Adresse muss ein '@' enthalten!";
		}
		alert(text);
		mail.focus();
		return false;
	}

}