var Contact = {
	formId: "contactForm",
	post: function(newFormId) {
		if (newFormId && $(newFormId)) {
			this.formId = newFormId;
		}
		var hasErrors = false;
		$A([$F("a"), $F("name"), $F("kommentar")]).each(function(value) {
			value = value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
			if (!hasErrors && value.length == 0) {
				alert("Bitte füllen Sie alle Felder aus.");
				hasErrors = true;
				return;
			}
		});
		if (hasErrors == true) {
			return;
		}
		$(this.formId).request({
			onSuccess: function(transport) {
				if (transport.responseJSON == null) {
					transport.responseJSON = transport.responseText.evalJSON(true);
				}
				if (transport.responseJSON.success) {
					alert("Danke, wir haben Ihre Kontaktanfrage erhalten.");
					$("contactForm").reset();
				} else {
					alert("Fehler beim Speichern der Änderungen!\r\n\tLade Seite neu.");
					window.location.reload();
				}
			}
		});
	}
}
