	function check_form_all() {
		var e1 = check_form('name');
		var e2 = check_form('email');
		var e3 = check_form('betreff');
		var e4 = check_form('nachricht');

		if(e1 && e2 && e3 && e4) {

			 $.ajax({
			   type: "GET",
			   url: "kontaktajax.html",
			   data: "action=send"+
			   "&name="+$('#contact_name').attr('value')+
			   "&email="+$('#contact_email').attr('value')+
			   "&anruf="+$('#contact_anruf').attr('value')+
			   "&telefon="+$('#contact_telefon').attr('value')+
			   "&erreichbarkeit="+$('#contact_erreichbarkeit').attr('value')+
			   "&betreff="+$('#contact_betreff').attr('value')+
			   "&nachricht="+$('#contact_nachricht').attr('value'),
			   
			   success: function(msg){
					if(msg=="1") {
						
						$('#contact_name').attr('value', '');
						$('#contact_email').attr('value', '');
						$('#contact_anruf').attr('value', '');
						$('#contact_telefon').attr('value', '');
						$('#contact_erreichbarkeit').attr('value', '');
						$('#contact_betreff').attr('value', '');
						$('#contact_nachricht').attr('value', '');

						alert("Vielen Dank.\n\nWir haben Ihre Nachricht erhalten und werden uns\numgehend mit Ihnen in Verbindung setzen!");

					}
				}
			 }); 
		}
		
		return false;
	}


	function check_form(name) {
		$.result = false;
		 $.ajax({
		   type: "GET",
		   async: false,
		   url: "kontaktajax.html",
		   data: "action=check"+
		   "&vname="+name+
		   "&value="+$('#contact_'+name).attr('value'),
		   
		   success: function(msg){

				if(msg=="1") {

					//red border + bold text
					$('#border_'+name).css("border", "none");
					$('#border_'+name).css("color", "#000000");
					$('#border_'+name).css("font-weight", "normal");
					//error-message
					$('#error_'+name).html("");		

					$.result = true;
				}
				else {
					//red border + bold text
					$('#border_'+name).css("border", "1px solid #cc0000");
					$('#border_'+name).css("color", "#cc0000");
					$('#border_'+name).css("font-weight", "bold");
					//error-message
					$('#error_'+name).html("&laquo; Bitte ausf&uuml;llen!");
					
					$.result = false;
		   		}
			}
		 }); 
		 
		 return $.result;
	}
