var ScrollController = function()
{
	var minClientHeight = 600;
	
	var staticContentHeight = 340;	
	var scrollboxClass = '';
	var enabled = false;
			
	return {
		setScrollboxClass: function(value)
		{
			scrollboxClass = value;
		},
		
		setStaticContentHeight: function(value)
		{
			staticContentHeight  = value;
		},
		
		enable: function(isEnabled)
		{
			enabled = isEnabled;
		},
		
		adjustSize: function()
		{
			var d = document;
			if (enabled)
			{				
				if (d.documentElement.clientHeight)
				{
					var scrollBox = $("."+scrollboxClass);									
					
					if (scrollBox != null)
					{
						var scrollHeight = (d.documentElement.clientHeight < minClientHeight) 
												? (minClientHeight - staticContentHeight)+"px" 
												: (d.documentElement.clientHeight - staticContentHeight) +"px";
												
						scrollBox.css("height", scrollHeight);
					}
				}
			}
		}	
	};
}();
