// JavaScript Document

Event.observe(window, 'load', function() { 

	var leftColH = typeof($$('.col-left')[0]) != "undefined" ? $$('.col-left')[0].getHeight() : 0;
	var rightColH = typeof($$('.col-right')[0]) != "undefined" 
	? $$('.col-right')[0].getHeight() 
	: 0;
	var middleColH = typeof($$('.col-main')[0]) != "undefined" ? $$('.col-main')[0].getHeight() : 0;
	
	maxHeight = getMax([middleColH, rightColH, leftColH]);
	
	if( typeof($$('.col-left')[0]) != "undefined" ){
		$$('.col-left')[0].setStyle({ height:maxHeight+'px' });
	}
	if( typeof($$('.col-right')[0]) != "undefined" ){
		$$('.col-right')[0].setStyle({ height:maxHeight+'px' });
	}
	if( typeof($$('.col-main')[0]) != "undefined" ){
		$$('.col-main')[0].setStyle({ height:maxHeight+'px' });
	}
});

function getMax(arr){
	max = 0;
	for(i=0; i<arr.length; i++){
		if(arr[i]>max)
			max = arr[i];
	}
	return max;
}
