$(document).ready(function() {
  // highlight points on map
  $("#menu-therapeuten a").bind("mouseover", function(e) {
    var id = $(this).attr("id");
    var praxen = therapeuten[id].praxen
    $.each(praxen, function(k,v) {
      $("#map-pos-" + v).addClass("point-rollover");
    });
  });
  
  // remove highlight on map
  $("#menu-therapeuten a").bind("mouseout", function(e) {
    $(".map-item").removeClass("point-rollover");
  });
  
  // ajax form
  $("#kontakt-form").submit(function(e){
    e.preventDefault();
    var str = $(this).serialize();
      $.ajax({
      type: "POST",
      url: "/contact.php",
      data: str,
      success: function(msg){
        $("#note").ajaxComplete(function(event, request, settings){
          if(msg == 'OK') // Message Sent? Show 'Thank You' message and hide the form
          {
            result = '<div class="success"><span class="bold">Vielen Dank.</span><br/> Ihre Nachricht an die Kinderphysiotherapie Hamburg wurde gesendet!</div>';
            $(this).html(result).slideDown('fast', function() {
              $('#kontakt-form').fadeOut(2000);
            });
          }
          else {
            result = '<div class="error"><span class="bold">Bitte &uuml;berpr&uuml;fen Sie Ihre Eingaben.</span><br />' + msg + '</div>';
            $(this).html(result);
          }
        }); // end ajax complete
      } // end success
    }); // end ajax
  }); // end kontakt form
  
}); // end document ready

