$(document, this).ready(function(){
	
	function setContainerHeight()
	{
		var overflow = true;
		var holder = $('.articleContainer').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
		}

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