jQuery(document).ready(function()
{

	var myHeight = 30;
	var councils = $("#councils");
	var articles = $("#articles");
	var features = $("#features");
	
	
	var myWidth = (councils.width() - $(".loadImage").height())/2;

	var myHeight = (councils.parent().height() - $(".loadImage").height())/2-20;
	
	$(".loadImage").css("margin-left",myWidth);
	$(".loadImage").css("margin-top",myHeight);

	
	myHieght = myLoad('/rss/councils/', myHeight, councils);
	
	myHeight = myLoad('/rss/articles/', myHeight, articles);
	
	myHeight = myLoad('/rss/features/', myHeight, features);


})

function updateHeight(myHeight)
{
	$(".rsscontent").css('min-height', myHeight + 'px');
}

function myLoad(where, myHeight, thing)
{
		thing.load(where, function(response, status, request){
			thing.html(response);
			if(thing.height() > myHeight)
			{
				myHeight = thing.height();
				updateHeight(myHeight);
			}


		});
		
		return myHeight;
	
}
