/**
* JavaScript functionality for the "standard" implementation of the site
**/

/*
	Function used by layouts to even out heights of all columns
*/
function equalHeights(_divs) {
	var height = 0;

	/*
		flattens out array of major divs into string
	*/
	var div_str = '';
	_divs.each(function(value, key) {
		div_str += "'" + value + "'";
		if (key < _divs.length-1) div_str += ',';
	});

	/*
		collect all the divs
	*/
	divs = $$(div_str);

	/*
		find out the tallest div
	*/ 
	divs.each( function(e){
		if (e.offsetHeight > height){
			height = e.offsetHeight;
		}
	});

	/*
		assign the max height to all divs
	*/ 
	divs.each( function(e) {
		e.setStyle( 'height', height + 'px' );
		if (e.offsetHeight > height) {
			e.setStyle( 'height', (height - (e.offsetHeight - height)) + 'px' );
		}
	}); 
}
