$(function () {
  $.fn.scrollToTop = function(){
    $(this).click(function(){
      $("html, body").animate({scrollTop:0},"slow");
    });
  }

  $('#kontakt').click(scrollContact);
  $(".top").scrollToTop();
  $("#tooltip img[title]").tooltip('#tip');

  $(".gallery").each(function() { 
    $("a",this).overlay({   
      target: '#gallery'
    }).gallery({
      speed:800,
      template: "<strong>${title}</strong> "
    }); 
  }); 
});

function scrollContact(){
  scrollWin('kontaktHeader');
}

function scrollWin(link){
  $('html, body').animate({
    scrollTop: $("#" + link).offset().top
  }, 2000);
}
