function getAndSetHeight() {
      // Get natural heights
      var lHeight = $("ul.left_side").outerHeight();
      var rHeight = $("ul.left_space").outerHeight();

       // Find the maximum height & and add 100 (the height of the picture to it if not Explorer)
      var maxHeight = Math.max(lHeight, rHeight);
		if (! $.browser.msie) {
			// maxHeight = maxHeight + 100;
		}

      $("ul.left_side").outerHeight(maxHeight);
      $("ul.left_space").outerHeight(maxHeight);
	  
   }

$(document).ready(function() {
	$("a.inactive").hover(
		function () {
    		//$(this).parent('li').delay(500).addClass('red');
			$(this).parent('li').css({backgroundColor: '#b3071b'});
			// $(this).parent('li').animate({bottom: '3px'}, 250);
			// $(this).parent('li').animate({bottom: '0px'}, 250);
			//$(this).parent('li').animate({backgroundColor: '#b3071b'});
  		}, 
  		function () {
			$(this).parent('li').css({'background-color' : ''});
  		});
  
	$("a.active").parent('li').css({backgroundColor: '#b3071b'});
	
	$('a#printer, ul.left_space li a').hover(
		function () {
			$(this).animate({ color: "#a9b4bb" }, 500);			
		},
		function () {
			$(this).animate({ color: "#6a7b85" }, 500);
		}
	);
	
	// flyout & mouse Effekt der Mitarbeiter
	$('div.ma_block').hover(function() {
			$(this).find('img').css('opacity',1);
		}, function() {
			$(this).find('img').css('opacity',0.5);
	});
	
	$('div#placeholder').click(function () {
		$(this).hide();
	});
	
	$('a.ma_link').bind('click', function(action) {
  		action.preventDefault();
	});
	
	$('a.ma_link').hover(function(action) {
			var position = $(this).position();
			var pos_now = position.top;
			// alert(pos_now);
			
			my_url = $(this).attr('href');
			// alert(my_url);

			$.ajax({
					url: my_url, 
					cache: true, 
					success: function(message) {
						$(this).addClass("done");
						// $('div#image_content').remove('#placeholder');
						$('div#placeholder').empty().prepend(message).css('top', pos_now + 190).fadeIn(500);
						$('div#placeholder').prepend('<span id="close"></span>');
					}
			});
	});
	
	
	$("a.active_article").unbind('mouseenter mouseleave');
	
	$('a.inactive_article').hover(
		function () {
			$(this).animate({ color: "#a9b4bb" }, 500);
			$(this).parent('li').find('span').css('backgroundPosition', "0px -8px");
			
		},
		function () {
			$(this).animate({ color: "#6a7b85" }, 500);
		}
	);
	
	
	var li_width;
	li_width = 0;
	
	$('ul#navi li').each(function(i, e) {
		// li_width += e.width();
		// alert(this.val());
		li_width += $(this).outerWidth();
		// alert(i + ": " + $(this).outerWidth());
	});
	
	// alert(li_width + ' ' + $('ul#navi').width());
	
	/*$('ul#navi li:last-child').after(function() {
		return '<li class="last-space inactive_article"><a>' + '&nbsp' + '</a></li>';
	});
	*/
	// $('ul#navi li:last-child').css('width','+=' + ($('ul#navi').width() - li_width));
	
	
	/*$('ul#navi li:last-child').css('width', $('ul#navi').width() - li_width + 'px');
	$('ul#navi li:last-child').css('margin', '0');
	$('ul#navi li:last-child').css('padding', '0');*/
		
	/* $('ul#navi .last-space').css('width','auto'); */
	/* $('ul#navi .last-space').css('margin',0); */
	/* $('ul#navi .last-space').css('padding',0); */
	// .css('border','1px solid red');
	$('.hide').hide();
	
	$('.hide.flyout').click(function() {
		$.unblockUI();
	});
	
	$(document).keyup(function(e) {
  		if (e.keyCode == 27) { $.unblockUI(); }   // esc
	});

	$('#flyout').click(function() {
		
        $.blockUI({ message: $('.hide.flyout'),
			fadeIn: 700, 
            // fadeOut: 700, 
            // timeout: 2000, 
            // showOverlay: false, 
            centerY: true, 
			centerX: false,
			css: {
				textAlign: 'left',
				width: 'auto',
				left: ($(document).width() - 700) / 2 + 'px',
				top: ($(window).height() - 546) / 2 + 'px',
				cursor: 'pointer'
				// top: '10px',
				// left: ''
			}
            /* css: { 
                width: '350px', 
                top: '10px', 
                left: '', 
                right: '10px', 
                border: 'none', 
                padding: '5px', 
                backgroundColor: '#000', 
                '-webkit-border-radius': '10px', 
                '-moz-border-radius': '10px', 
                // opacity: .6, 
                color: '#fff' 
            } */
			}); 
		 
        // setTimeout($.unblockUI, 2000); 


 
		return (false);
    }); 	
		
	// new window 
	$('a[rel=extern]').attr('target','_blank'); 

	getAndSetHeight();

});
		
		$(window).resize(function() {
			getAndSetHeight();
		});
		
		
		



