//Event.observe(window, 'load', setLongest_2(new Array('left','main','right',-270)));

function sortNumber(a,b){
	return a - b;
}

function getHighestHeight(param) {
	//alert("length of param : "+ param.length);
	var colLength = new Array();
	for (i=0; i<param.length; i++){ //looping through the array received by the function with the columns names and offset numbers
		if(typeof param[i] == "string"){
			// get column height
			var elHeight = $(param[i]).offsetHeight;
			//alert(param[i]+ " height : " + elHeight);
			// if there is a manual offset
			if(typeof param[i+1] == "number"){
				elHeight += param[i+1];
				//alert(param[i]+ " height + : " + elHeight + ") offset : "+param[i+1]);
				i++;
			}
			colLength.push(elHeight);
		}
	}
	colLength.sort(sortNumber);
	colLength.reverse();
	//alert("longest height : "+ colLength[0]);
	return colLength[0];
}

function balanceColumns(param) {
	divHeight = getHighestHeight(param);
	for (i=0; i<param.length; i++){ //updating with the new size.
		if(typeof param[i] == "string"){
			$(param[i]).style.height = divHeight+"px";
		}
	}
	
	
}
