// JavaScript Document

function getLongest() {

	var num_colLength = divIds.length;
	//alert(divIds.length);

	colLength = new Array();

	for(var k=0;k<num_colLength;k++){ //Hold the first element

		var divId = divIds[k];
		
		//alert(divId);
		if(document.getElementById(divId))
			colLength[k] = parseInt(document.getElementById(divId).offsetHeight);

		//colLength[1] = parseInt(document.getElementById("rightbox").offsetHeight);

	}

	var num_colLength = colLength.length;

	var indexLast_colLength = num_colLength-1;

	//colLength.sort();

	for(var i=0;i<num_colLength;i++){ //Hold the first element

		for(var j=i+1;j<num_colLength;j++){ //Hold the next element from the first element

			if(Number(colLength[i]) > Number(colLength[j])){	//comparing first and next element

				tempValue = colLength[j];	

				colLength[j] = colLength[i];

				colLength[i] = tempValue;

			}

		}

	}

	return colLength[indexLast_colLength];

}

function setLongest() {

	var num_colLength = divIds.length;

	var divLen = getLongest(divIds);

	for(var k=0;k<num_colLength;k++){ //Hold the first element

		var divId = divIds[k];

		//if(k==0){divLen = divLen-padng1;}

		//if(k==1){divLen = divLen-padng2;}

		
		if(document.getElementById(divId))
			document.getElementById(divId).style.height = divLen+"px";

		//document.getElementById("rightbox").style.height = divLen2+"px";

	}

}

