$(document).ready(function(){

  // 2. Menueebene Otto-Nav
  $(".menu2").each(function(){
    // Zusaetzliche Klassen für erste und letzte Spalte pro Zeile
    $(this).children("li:eq(0)").addClass("first");
    $(this).children("li:eq(5)").addClass("last");
    $(this).children("li:eq(6)").addClass("first");
    $(this).children("li:eq(11)").addClass("last");
    $(this).children("li:eq(12)").addClass("first");
    $(this).children("li:eq(17)").addClass("last");

    // Gleiche Hoehe 2. Menueebene
    // 1. Reihe
    var firstrowheight = $(this).children("li").filter(":first").height();
    //$(this).children("li").filter(":first").hide();
    $(this).children("li").slice(0, 6).each(function(){
        var columnheight = $(this).height();
        if (columnheight > firstrowheight){
           firstrowheight = columnheight;
        }
    });
    $(this).children("li").slice(0, 6).height(firstrowheight);

    // 2. Reihe
    var secondrowheight = $(this).children("li:eq(6)").height();
    $(this).children("li").slice(6, 12).each(function(){
        var columnheight = $(this).height();
        if (columnheight > secondrowheight){
           secondrowheight = columnheight;
        }
    });
    $(this).children("li").slice(6, 12).height(secondrowheight);

    // 3. Reihe
    var thirdrowheight = $(this).children("li:eq(12)").height();
    $(this).children("li").slice(12, 18).each(function(){
        var columnheight = $(this).height();
        if (columnheight > thirdrowheight){
           thirdrowheight = columnheight;
        }
    });
    $(this).children("li").slice(12, 18).height(thirdrowheight);

  });

  // Anpassung Hoehe Content, falls Submenue hoeher
  var submenu_height =  $("#submenu").height();
  var content_height = $("#leftcol_content").height();
  if (submenu_height > content_height) {
    $("#leftcol_content").height(submenu_height);
  }

});