// JavaScript Document
/** thanks to: http://www.genlinux.org/2009/09/equal-height-columns-with-prototype.html 
	Basado en: http://www.cssnewbie.com/equalheights-jquery-plugin/
**/

function equalHeight(group) {
	tallest = 0;
    group.each(function(c) {
		thisHeight = c.offsetHeight;
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}		
	});
group.invoke("setStyle", {height: tallest + 'px'}) 	
}
Event.observe(window, 'load', function()
{
	equalHeight($$(".column"));
	
	/**** ESPECIAL PARA MMMM ****/
	var col1 = $$("div#contenttext .col1");
	var col2 = $$("div#contenttext .col2");

	if ((col1.length > 0) && (col2.length > 0))
	{
		col1 = col1[0];
		col2 = col2[0];
		if ((col1.offsetHeight <= 286) && (col2.offsetHeight <= 286))
		{
			col2.style.height = col1.style.height = '286px'; //300 alto lat1/submenu - 12 margin-top - 5px 
			
		}else if (col1.offsetHeight > col2.offsetHeight)
		{
			col2.style.height = col1.offsetHeight+'px';	
		}else{
			col1.style.height = col2.offsetHeight+'px';
		}
	}
});
