﻿$(window).load(function() {

	if (!($.browser.msie && ($.browser.version < 8)))
	{
		var rightColSpace = $('#BodyLeft').outerHeight(true) - $('#BodyRight').outerHeight(true);
		
		if (rightColSpace > 30) {
			var $newBox = $('<div />');
			$newBox.attr('id', 'RightColFillBox');
			
			var $newBoxHead = $('<div />');
			$newBoxHead.attr('id', 'RightColFillBoxHead');
			
			var $newBoxMid = $('<div />');
			$newBoxMid.attr('id', 'RightColFillBoxMid');
			$newBoxMid.css('height', (rightColSpace - 23 - 5) +'px'); // subtract green box's head and foot height	
			
			var $newBoxFoot = $('<div />');
			$newBoxFoot.attr('id', 'RightColFillBoxFoot');
			
			$newBox.append($newBoxHead);
			$newBox.append($newBoxMid);
			$newBox.append($newBoxFoot);
			
			$('#BodyRight').append($newBox);
		}
		else {
			function growLeftCol () {
				var leftColSpace = $('#BodyRight').outerHeight(true) - $('#BodyLeft').outerHeight(true);
				
				if (leftColSpace > 0) {
					var $leftContentDiv = $('#BodyLeft .wideContentBlock .wcbMiddle');
					$leftContentDiv.height($leftContentDiv.height() + leftColSpace);
				}
			}
			
			growLeftCol();	
			//$(document).mousemove(growLeftCol);
		}
	}
	
});

