// JavaScript Document


// JavaScript Document
function getheight ( container )
{
		
	/*if( container.scrollHeight )
      	   containerdivheight = container.scrollHeight; 
*/	
	if ( container.clientHeight )
		  containerdiv2height = container.clientHeight;
	else if( container.offsetHeight )
      	   containerdiv2height = container.offsetHeight; 
	
	//if ( containerdiv2height > containerdivheight)
		return containerdiv2height;
	//else
	//	return containerdivheight;
}


function resize ( column, size )
{
	column.style.height = size + 'px';
}



function resizeColumns() {
	
	var cont = document.getElementsByTagName ('html')[0];
	var contHeight  = getheight ( cont );
	
	colMidHeight = getheight( $E('colMiddle') );
	colLeftHeight = getheight( $E('colLeft') );
	
	theHeight = ( colMidHeight > colLeftHeight ? colMidHeight : colLeftHeight);
	if ( colMidHeight < colLeftHeight )
		resize ( $E('colMiddle'), theHeight );	
		
	resize ( $E('colLeft'), theHeight );
	resize ( $E('colRight'), theHeight);

	if ( contHeight > theHeight )
	{	
		resize ( $E('colLeft'),contHeight -1  );
	 	resize ( $E('colRight'),contHeight -1 );
		resize ( $E('colMiddle'),contHeight -1 );
	}
	
}

window.onresize = resizeColumns;

