$(document).ready(function() {
    $("#altLocations").show();
    $(".altLocations").hide();
    $("#altLocations").mouseover(function() {
    	$("#altLocations").hide();
    	$(".altLocations").fadeIn();
    });
    $(".altLocations").mouseleave(function() {
    	$(".altLocations").fadeOut();
    	$("#altLocations").show();
    });

    /*
     * Beim Klick auf den Link zu einer anderen Beratungsstelle würde die
     * Seite neu geladen und das Formular wäre wieder leer.
     * Wir wechseln stattdessen die Action des Formulars und schicken dieses
     * ab.
     * NOTE: submit() hatte immer ein leeres Formular zur Folge. Die
     * Simulation des Klicks auf den Button funktioniert jedoch. 
     */
    $(".altLocations div ul li a").click(function() {
    	$("form.kontakt").attr('action', this.href);
    	$(".altLocations").fadeOut();
    	$("#senden").click();
    	return false;
    });

});

