
var Pods = {

	// heights for pods
	oneU: 90,

	// initialize the pods
	init: function() {

		// height to fill
		var totalHeight = $("main-wrapper").getHeight();
		var padding = parseInt($("main-wrapper").getStyle("paddingTop")) + parseInt($("main-wrapper").getStyle("paddingBottom"));
		var top = $("pods").positionedOffset().top;

		totalHeight = totalHeight - (padding + top);

		// space available for pods (in units)
		var availPodHeight = Math.floor(totalHeight / this.oneU);

		$("pods").hide();

		if (availPodHeight > 0) {

			// get HTML
			new Ajax.Updater("pods-container", window.siteBase + "/pods/sidebar/pods:" + availPodHeight, {
				method: "get",
				onComplete: function() {
					new Effect.Appear("pods");
				}
			});

		}

	}

}

Pods.init();