function ClassCheckform(thisform) {
	this.errors = "";
	this.checkval = true;
	this.checkfield = checkfields;
	this.checkmail = checkmails;
	this.showerrors = showerrors;
	this.thisform = thisform;

	function checkfields(field, msg){
		if (eval("this.thisform." + field + ".value") == "") {	
			this.errors += "- " + msg + "\n";
			this.checkval = false;			
		}
	}
	
	function checkmails(field, msg, required){
		var regexp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
		if (required != 0){
			if (!regexp.test(eval("this.thisform." + field + ".value"))){
				this.errors += "- " + msg + "\n";
				this.checkval = false;
			}
		}else if (required == 0 && eval("this.thisform." + field + ".value") != ""){
			if (!regexp.test(eval("this.thisform." + field + ".value"))){
				this.errors += "- " + msg + "\n";
				this.checkval = false;
			}
		}
	}
	
	function showerrors(){
		if (this.errors != ""){
			alert("Folgende Fehler sind aufgetreten:\n\n" + this.errors);
		}
	}
}