//  set height of content-sidebar to full height of content div
$(document).ready(function() 
{ 
	var content = $("meta[name='equal_height']").attr("content");
	if (content)
	{
		var meta_array = content.split(" ");
		adjustHeight(meta_array);
	}
	else alert("Nothing to resize");
});
 	
function adjustHeight(meta_array)
{
	var array = [];
	var max_height = 1;
	var temp = 1;
	var wrapper = null;
	
	for(var i=0; i<meta_array.length; i++)
	{
		if(meta_array[i].match("wrapper="))
		{
			var temp_array = meta_array[i].split("=");
			wrapper = temp_array[1];
			meta_array.splice(i,1);
		}
	}
	// array without wrapper element if specified. 
	array = meta_array;
		
	for(var i=0; i<array.length; i++)
	{
		// Wraps the element to be aligned with the wrapper, if defined.
		if(wrapper!=null) 
		{
			var wrapped_object = wrapper + " " + array[i];
			var object = $(wrapped_object);
		}
		else var object = $(array[i]);
		
		// Calculates max height of given elements and applied it to all. 
		temp = parseInt(object.height());
		max_height = Math.max(max_height, temp);
		object.height(max_height);
	}
}


