function getAndSetHeight() {
      // Get natural heights
      var lHeight = $("div#sub_content_one").height();
      var rHeight = $("div#sub_content_two").height();
	  var cHeight = $("div#main_content").height();

       // Find the maximum height
      var maxHeight = Math.max(cHeight,Math.max(lHeight, rHeight));
	  
	  // set the height
      $("div#sub_content_one").height(maxHeight);
      $("div#sub_content_two").height(maxHeight);
	  $("div#main_content").height(maxHeight);
	  
   }


$(document).ready(function() {
			getAndSetHeight();
	
			// tool tips
			// $("a.icon, p.schmetter_back, a.logo_europe, ul#target li a, ul#subject li a, ul#months li a, ul#letter li a").hover(
			//	function() { $(this).contents("span:last-child").css({ display: "block" }); },
			//	function() { $(this).contents("span:last-child").css({ display: "none" }); }
			// );

			// logo animation
			$('a.logo').hover(
				function() { $(this).css( "backgroundPosition", "center bottom"); },
				function() { $(this).css( "backgroundPosition", "center top"); }
			);
			
			// logo click
			$('a.logo').click(function() {
				if ( $(this).attr('href') == "#logo_europe") { return false; }
				else { return true; }
			});
			
			// new window 
			$('a[rel=external]').attr('target','_blank'); 
			
			// content URLs open new window
			$('div.description a').attr('target','_blank');
			$('div.description a[rel=intern]').attr('target','_self');
			
			// tool tips
			$('a.logo_europe').SetBubblePopup({
				innerHtml: '<span>Dieses Vorhaben der TSB Technologiestiftung Berlin wird aus Mitteln der Investitionsbank Berlin gef&ouml;rdert, kofinanziert von der Europ&auml;ischen Union - Europ&auml;ischer Fonds f&uuml;r Regionale Entwicklung. Investition in Ihre Zukunft.</span>',
				imageFolder: 'images/bp_images',
				width: '338px',
				color: 'grey'
			});
			
});

$(window).resize(function() {
	getAndSetHeight();
});
