jQuery(document).ready(function(){

    var geschlecht = "";
    var anrede = jQuery(".powermail_all_value_uid41").text();
    if (anrede == "Sehr geehrte Frau") {
        geschlecht = "Frau";
    } else if(anrede =="Sehr geehrter Herr") {
        geschlecht = "Herr";
    }
    jQuery(".powermail_all_value_uid41").text(geschlecht);
    
    
    var max_height_contenttext = 0;
    
    jQuery('#content_text').each(function(e) {
         
        var h = jQuery(this).height();
            
        if(typeof(h) != "undefined") {
            if(h > max_height_contenttext) {
                max_height_contenttext = h;
                    
            }
        }
    });
    if(max_height_contenttext > 0) {
        jQuery('#content_text').height(max_height_contenttext);
        jQuery('#sidebar').height(max_height_contenttext);
    }
    
    var max_height_branchen = 0;
    
    jQuery('#branchen').each(function(e) {
         
        var h = jQuery(this).height();
            
        if(typeof(h) != "undefined") {
            if(h > max_height_branchen) {
                max_height_branchen = h;
                    
            }
        }
    });
    if(max_height_branchen > 0) {
        jQuery('#sidebar').height(max_height_branchen);
    }
    
    
    
    
    
    //When page loads...
    jQuery(".tab-contents").hide(); //Hide all content
    jQuery(".tabs ul li:first").addClass("active").show(); //Activate first tab
    jQuery(".tab-contents:first").show(); //Show first tab content
    
    //On Click Event
    jQuery(".tabs ul li").click(function() {
    
        jQuery(".tabs ul li.active").removeClass("active"); //Remove any "active" class
        jQuery(this).addClass("active"); //Add "active" class to selected tab
        jQuery(".tab-contents").hide(); //Hide all tab content
    
      var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
     
      if(activeTab == "#tab-2") {
          jQuery(".list_carousel").css("display", "none");
          jQuery("#mainnav").css("display", "none");
          
      }else {
          jQuery(".list_carousel").css("display", "block");
          jQuery("#mainnav").css("display", "block");
      }
      jQuery(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });
    
    
    var max_height_start = 0;

    jQuery('.subcolumns .teasers_start').each(function(e) {
         
        var h = jQuery(this).height();
            
        if(typeof(h) != "undefined") {
            if(h > max_height_start) {
                max_height_start = h;
                    
            }
        }
    });
    if(max_height_start > 0) {
        jQuery('.subcolumns .teasers_start').height(max_height_start);
        jQuery('.subcolumns .more_news').height(max_height_start);
    }
    
    
    
    jQuery('#mainnavbuttom img.bouton_act').parent().css("cursor","default");

});





