function setEqualHeight(columns) {
	var tallestcolumn = 0;
	columns.each(
		function() {
			currentHeight = $(this).height();
			if(currentHeight > tallestcolumn) {
				tallestcolumn  = currentHeight;
			}
		}
	);
	columns.height(tallestcolumn);
}

$(function() {

	$('#page_content ul.progress').each(function() {	
		setEqualHeight($('li',this));
	});	
	if (!$.browser.msie) $('#content_scroll').jScrollPane({ topCapHeight: 34, reinitialiseOnImageLoad: true });
	else $('#content_scroll').jScrollPane({ topCapHeight: 34 });
	/* if ($.browser.msie) {
		$('.jScrollPaneContainer, #content').css('height','auto');
		$('#icon_fullsize').hide();
	} */

	
	$('#icon_fullsize').toggle(
	
		function() {
			var content_height = $('#content_scroll').height();
			$('#content_scroll')[0].scrollTo(0);
			$('.jScrollPaneContainer, #content').css('height',content_height);
			$('#content_scroll').jScrollPaneRemove();
			return false;
		},
		function() {
			$('.jScrollPaneContainer, #content').css('height','380px');
			if (!$.browser.msie) $('#content_scroll').jScrollPane({ topCapHeight: 34, reinitialiseOnImageLoad: true });
			else $('#content_scroll').jScrollPane({ topCapHeight: 34 });
			return false;
		}	
	);
	
	var anchors_width = $('#anchors_menu').width() - 10;
	$('#anchors_menu span:last').css('position','absolute').css('right','-10px');
	$('#anchors_menu').width(anchors_width);
	
	$('#anchors_menu a').click(function() {
		
		if ($(this).parent().attr('class') != 'active') {
			$('#anchors_menu span').attr('class','');
			$(this).parent().attr('class','active');
		}
		var anchor = $(this).attr('href');
		$('#content_scroll')[0].scrollTo(anchor);
	});
	
});

