if (!document.openke)
	openke = {};
	
openke.validator = function() {
	var ok = function(obj) {
		obj.innerHTML = "Korrekte Eingabe";
		obj.addClassName("validatorok");
		obj.removeClassName("validatornok");
	}
	var nok = function(obj) {
		obj.innerHTML = "Falsche Eingabe";
		obj.addClassName("validatornok");
		obj.removeClassName("validatorok");
	}
	
	return {
		checkLength : function(obj, text, len) {
			var txt = text.value;
			if (txt.length > len) {
				ok(obj);
			} else {
				nok(obj);
			}
		},
		checkPassword : function(obj, text) {
			var txt = text.value;
			if (txt.length > 3) {
				ok(obj);
			} else {
				nok(obj);
			}
		},
		checkEmail : function(obj, text) {
			var txt = text.value;
			if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) {
				ok(obj);
			} else {
				nok(obj);
			}
		},
		checkUrl : function(obj, text) {
			var txt = text.value;
			var v = new RegExp();
		    v.compile("^[A-Za-z]+://[A-Za-z0-9-_]+\\.[A-Za-z0-9-_%&\?\/.=]+$");
		    if (v.test(txt)) { 
				ok(obj);
			} else {
				nok(obj);
			}
		}
	};
}();