/**
 *
 * Copyright (c) 2007 Tom Deater (http://www.tomdeater.com)
 * Licensed under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */
 
(function($) {
	/**
	 * equalizes the heights of all elements in a jQuery collection
	 * thanks to John Resig for optimizing this!
	 * usage: $("#col1, #col2, #col3").equalizeCols();
	 */
	 
	$.fn.equalizeCols = function(){
		var height = 0;
		var max = 0;
		var hauptueberschrift;
  
		this.css("height","auto").each(function() {
				height = this.offsetHeight;
				
				// alert(this.id + " = " + height);
				
				// ermitteln Höhe Hauptüberschrift
				if(this.id == 'hauptueberschrift')
					hauptueberschrift = height;
				
				// merke Höhe
				if(max < height)
					max = height;
		});
		
		
		$("#content").height(max + "px");
		
		return;
	};
	
})(jQuery);

$(document).ready(function(){
	$("#content,#spalte_links,#spalte_rechts,#bildnavigation").equalizeCols();
});