$(document, this).ready(function(){
	
	function setContainerHeight()
	{
		var overflow = true;
		var holder = $('.newsContainer').height();
		
		var alto = 0;
		
		var hDoc = $(document).height();
		var hWin = $(window).height();
		
		if ( hDoc == hWin ){ alto = hDoc; }
		else { alto = hWin; }
		
		alto = alto - 15 - $('#pageTitle').height() - $('.roundedBottom').height() - 20;
		
		if( alto >= holder ){
			overflow = false
		}

		$('.newsWrapper').css({ height: alto+'px' });
		
		if ( overflow ){
			$('.newsWrapper').css({ 'overflow-y': 'scroll' });
			$('.newsContainer').css({ 'padding-right': '10px' });
		} else {
			$('.newsWrapper').css({ 'overflow': 'hidden' });
			$('.newsContainer').css({ 'padding-right': '0' });
		}
		
	}
	
	$(window)
	.resize(function(){
		setTimeout(function(){
			setContainerHeight();
		}, 100);
	})
	.load(function(){
		setTimeout(function(){
			setContainerHeight();
		}, 100);
	})
	;
	
	setTimeout(function(){
		setContainerHeight();
	}, 100);
	
});