//This file fixes serveral height issues. (container lengths not being high enough etc.
$(document).ready(function(){
	//The actual resizing
	addResizeHandler(function(){
		var h = function(a){ return parseInt(a, 10); };
		var height = $("#top").height()
						+ $("#contentSpacer").height() 
						+ h($("#contentSpacer").css("margin-top"))
						+ h($("#contentSpacer").css("margin-bottom"))
						+ $("#contentBottom").height()
						+ h($("#contentBottom").css("margin-top"))
						+ h($("#contentBottom").css("margin-bottom"));
		if(height > $(window).height()){ //actual content is higher then viewport
			$("#contentBottom").css('position', 'relative');
		} else { //viewport is bigger then actual content
			height = $(window).height();
			$("#contentBottom").css('position', 'absolute');
		}
		$("#leftBar, #rightBar").height(height);
	});
	//$(window).resize();
});
