/* 
Derived from a script by Alejandro Gervasio. 
Modified to work in FireFox by Stefan Mischook for Killersites.com

How it works: just apply the CSS class of 'column' to your pages' main columns.
*/


CalcDivHeight=function(d)
{
	var divHeight;
	
	divHeight = 0;
	
	// Use the greatest value - we're stretching documents to the match here.
	if (d.style.pixelHeight > d.offsetHeight)
	{
		divHeight = d.style.pixelHeight;
	}
	else
	{
		divHeight = d.offsetHeight;
	}
	
	return divHeight;
}

function jsEvenColumns()
{
	var ObjLeft,ObjMain,HLeft,HMain,HNew,HNewM,Offset;
	
	ObjLeft = document.getElementById('LeftDock');
	ObjMain = document.getElementById('MainPage');
	
	if (ObjLeft)
	{
		ObjMain.style.height = "auto";
		ObjLeft.style.height = "auto";
		
		HMain = ObjMain.offsetHeight;
		HLeft = CalcDivHeight(ObjLeft);
		
		Offset = 15;
		if (HLeft > HMain)
		{
			HLeft = HLeft;
			HMain = HLeft - Offset;
		}
		else
		{
			HLeft = HMain + Offset;
		}
		
		ObjLeft.style.height = HLeft + "px";
		ObjMain.style.height = HMain + "px";
			
		HNew = ObjLeft.style.height;
		HNewM = ObjMain.style.height;
	}
}


// Runs the script when page loads
window.onload=function()
{
	jsEvenColumns();
} 

// Runs the script when the page is resized
window.onresize=function()
{
	jsEvenColumns();
}

