// =================================================================
// Balances the column height of the side and central columns on the homepage
function HomeColumns()
{
	if(document.getElementById('block_1') && document.getElementById('block_2') && document.getElementById('block_3')){

		col1 = parseInt(document.getElementById('block_1').offsetHeight);
		col2 = parseInt(document.getElementById('block_2').offsetHeight);
		col3 = parseInt(document.getElementById('block_3').offsetHeight);

		colmax = col1;
		if (col2 > colmax) colmax = col2;
		if (col3 > colmax) colmax = col3;

		d1 = colmax - col1;
		d2 = colmax - col2;
		d3 = colmax - col3;

		
		if (d1 > 0) document.getElementById('block_1').style.height = parseInt(document.getElementById('block_1').offsetHeight) +
	d1 - 0 + "px";
		if (d2 > 0) document.getElementById('block_2').style.height = parseInt(document.getElementById('block_2').offsetHeight) +
	d2 - 0 + "px";
		if (d3 > 0) document.getElementById('block_3').style.height = parseInt(document.getElementById('block_3').offsetHeight) +
	d3 - 0 + "px";
	}
}

// =================================================================
// Balances the column height of the side and main columns on the jobboard subpages
function JBColumns()
{
	if(document.getElementById('block_5') && document.getElementById('block_3')){

		col1 = parseInt(document.getElementById('block_5').offsetHeight);
		col2 = parseInt(document.getElementById('block_3').offsetHeight);

		colmax = col1;
		if (col2 > colmax) colmax = col2;

		d1 = colmax - col1;
		d2 = colmax - col2;

		
		if (d1 > 0) document.getElementById('block_5').style.height = parseInt(document.getElementById('block_5').offsetHeight) +
	d1 - 0 + "px";
		if (d2 > 0) document.getElementById('block_3').style.height = parseInt(document.getElementById('block_3').offsetHeight) +
	d2 - 0 + "px";
	}
}

// =================================================================
// Balances the column height of the side and main columns on the static subpages
function SubColumns()
{
	if(document.getElementById('block_1') && document.getElementById('block_4')){

		col1 = parseInt(document.getElementById('block_1').offsetHeight);
		col2 = parseInt(document.getElementById('block_4').offsetHeight);

		colmax = col1;
		if (col2 > colmax) colmax = col2;

		d1 = colmax - col1;
		d2 = colmax - col2;

		
		if (d1 > 0) document.getElementById('block_1').style.height = parseInt(document.getElementById('block_1').offsetHeight) +
	d1 - 0 + "px";
		if (d2 > 0) document.getElementById('block_4').style.height = parseInt(document.getElementById('block_4').offsetHeight) +
	d2 - 0 + "px";
	}
}

// =================================================================

// =================================================================
window.onload = function()
{
	// Initiate column balancers
	HomeColumns();
	JBColumns();
	SubColumns();
	
	/*
	// Initiate the expandable menu
	var root = document.getElementById("menuList");
	getMenus(root, root);
	*/
}

// =================================================================