$(document).ready(function() {
   
	// gleiche Höhe f. Boxen auf Startseite/Branchen
	$(".floatboxB .img").setAllToMaxHeight();
	$(".floatbox h3").setAllToMaxHeight();
	$(".floatbox").setAllToMaxHeight();

	// zweite und dritte Menüebene ausblenden
	$("*[class^=node]").each(function() {
		if ($(this).find("li.aktiv").length == 0) $(this).hide();
	});

	// Eltern-Menüpunkt d. ersten und zweiten Ebene formatieren
	$('li.aktiv').parents("li").addClass('aktiv');
	
	// diverse last-child Pseudoklassen 
 	$("#top_navigation ul li:last").addClass("last");
 	
 	$("#content h1:first").addClass("first");
 	$("#content h2:first").addClass("first");
 	
 	$('.floatboxB').each(function(){
        var containerHeight = $(this).innerHeight();
        $('.caption', this).css({
            	height: containerHeight - 20
         });
        /*if ( $.browser.msie ) {
		    $('.caption', this).css({
            	height: containerHeight
        	});
		 } else {
		    $('.caption', this).css({
            	height: containerHeight - 20
        	});
		 }*/

    });

});

// fn.setAllToMaxHeight
$.fn.setAllToMaxHeight = function(){
	return this.height( 
        	Math.max.apply(this, $.map( this , function(e){return $(e).height() }) ) 
	);
}
