/**
 * the setTeaserHeight function is used to find the height
 * of the tallest gallery teaser and to set all other
 * teasers to this height.
 */
function setTeaserHeight(){

  var maxHeight = 0;

  $("div.gallery_teaser").each(function(index, domEle) {
    if ($(domEle).height() > maxHeight){
      maxHeight = $(domEle).height();
    }
    $("div.gallery_teaser").height(maxHeight);
  });
}

function initTeasers(){
  $("div[class*='_teaser']").hover(
    function(){
      $(this).addClass("active");
      $(this).css('cursor','pointer');
    },
    function(){
      $(this).removeClass("active");
      $(this).css('cursor','auto');
    }
  );
  
  $("div[class*='_teaser']").each(
    function(index, domEle){
      var src = $(this).children('a').attr("href");
      $(this).click(
        function (){
          window.location.href = src;
        }
      );
    }
  );
}
