//This script is used to readjust column sizes on pages.  It is automatically run when the page is fully loaded, and is included in phpincludes/meta.php.

//Note 1: The onload event can only be set once.  If more functions need to be run when the page is fully loaded, call each function separately within a new function.
//Note 2: Heights should still be set within the html pages for users with javascript disabled.  These can be approximate, or gross overestimates.  Most people have javascript enabled, and this won't be an issue.

function setColumnSizes(){
	//Set the minimum allowable height allowed, given the height of the left column.  This is manually determined.
	var minHeight = 1100;
	//Set 'boxes' (background container div) height to the height of contents (default is fixed at 9999px with negative margins to erase gap)
	document.getElementById('boxes').style.height = "100%";
	//get 'boxes' height, and add small buffer
	var divHeight = document.getElementById('boxes').offsetHeight +10;
	//set the left column height to the same height as boxes or minHeight, whichever is greater.  (due to the way the footer is included, there is a height difference of 3 pixels)
	document.getElementById('leftcolumn').style.height = Math.max(minHeight,divHeight)+"px";
	document.getElementById('boxes').style.height = Math.max(minHeight,divHeight)+3+"px";
}

//Waits until the page is fully loaded to run the setColumnSizes function
window.onload = setColumnSizes;