var _marginBottom=20;

function equalHeight(id1,id2,id3,BlockClassName)
{
	var firstCol = document.getElementById(id1);
	var secondCol = document.getElementById(id2);
	var thirdCol = document.getElementById(id3);
	
	var heights = [firstCol.offsetHeight,secondCol.offsetHeight,thirdCol.offsetHeight];
	
	var lim=heights.length;
	var max = heights[0];
	while (lim--)
	{
		if (heights[lim]>max) max = heights[lim];
	}
	
	if (heights[0]<max)
	{
		var tChilds = firstCol.getElementsByTagName('div');
		var fchilds = [];
		
		var lim = tChilds.length;
		while (lim--)
		{
			if (tChilds[lim].className==BlockClassName) fchilds[fchilds.length]=tChilds[lim];
		}
		
		delete tChilds;
		
		var lim = fchilds.length;
		var diff = Math.floor((max-heights[0])/(lim-1));
		
		lim--
		while (lim--)
		{
			fchilds[lim].style.marginBottom=_marginBottom+diff+'px';
		}
	}
	
	var val = max-_marginBottom;
	/*@cc_on
	if (typeof(JSON)=='undefined') var val = max;
	@*/
		
	if (heights[1]<max)
	{
		secondCol.getElementsByTagName('div')[0].style.height=val+'px';
	}
	
	if (heights[2]<max)
	{
		thirdCol.getElementsByTagName('div')[0].style.height=val+'px';
	}
}

window.onload = function() {equalHeight('leftColumn','centerColumn','rightColumn','blockShadow');};