// This page contains the javascript needed for the JRH Asset Management Website
//Developed by Tait Chambers / WebDuck Designs 2007

/*
The following function is used to determine the size of the main content area in relation to the right-side dynamic content
The main content area must be at least 20px taller than the right side content area. The script runs when the window is loaded
thus setting the height for the main content div. The right side column is never adjusted. This column can be as tall as the 
content it includes allows it to be. 
*/
function columnAdjust(column1, column2, column3, column4){
	//start off assigning the variables
	var maxHeight, colHeight_1, colHeight_2, colHeight_3, initHeight, colHeight;
	//get the height of the two columns
	colHeight_1 = document.getElementById(column1).offsetHeight;
	colHeight_2 = document.getElementById(column2).offsetHeight;
	colHeight_3 = document.getElementById(column3).offsetHeight;
	initHeight = document.getElementById(column4).offsetHeight;
	//determine the max height for the two columns
	maxHeight = 0;
	if(colHeight_2 <= (colHeight_3)){
		colHeight = colHeight_3;
		maxHeight = (initHeight + colHeight + 20);
	}else{
		colHeight = colHeight_2;
		maxHeight = (initHeight + colHeight + 20);
	}
	//resize the main content column if necessary
	document.getElementById(column3).style.height=colHeight+"px";
	document.getElementById(column2).style.height=colHeight+"px";
	document.getElementById(column1).style.height=maxHeight+"px";
}

window.onload=function(){
	columnAdjust('contentArea', 'empSearch', 'submit-column', 'empTop');
}