/* DOCUMENT READY INITIALIZATION
---------------------------------------------------------*/

function makeScrollPanes() {
	var maxHeight = $(window).height() - $("#group-cols").position().top - 75;
	var minHeight = 200;
	
	if (maxHeight < minHeight) maxHeight = minHeight;
	
	$(".group-list").each(function() {
								   
		$(this).jScrollPaneRemove();
		$(this).css("height", "auto");
		
		if ( $(this).height() > maxHeight) {
			
			$(this)
				.height(maxHeight)
				.jScrollPane({
					scrollbarOnLeft: true,
					scrollbarWidth: 5,
					scrollbarMargin: 15,
					wheelSpeed: 60
				});
		}
	});
}

/* DOCUMENT READY INITIALIZATION
---------------------------------------------------------*/

$(document).ready(function () {
	
	makeScrollPanes();
	
	$(window).resize(function(){
		makeScrollPanes();
	});
	
});
