function fix_news() {
	// Iterate through accordion elements
	$('.acc_container').each(function(index) {
		var height = 0;
		$(this).find('a.newsroom').each(function(news) {
			height += parseInt($(this).css('height'));
			if (height >= acc_container_height) {
				$(this).hide(); //css("display", "none");  
			}
		});
	});
}

$(document).ready(function(){
	//Set default open/close settings
	$('.acc_container').hide(); //Hide/close all containers
	$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
	
	acc_container_height = parseInt($('.acc_container').css('height'));
	fix_news();

	//On Click
	$('.acc_trigger').click(function(){
		if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
			$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all .acc_trigger classes and slide up the immediate next container
			$(this).toggleClass('active').next().slideDown(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
			fix_news();
		}
		return false; //Prevent the browser jump to the link anchor
    });

});
