// 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 )
{
	if ( typeof ( column ) != "object" )
		var col = $E( column );
	col.style.height = size + 'px';
}


function resizeColumns() 
{
	var containerdivheight  = getheight ( document.getElementsByTagName ('html')[0] );
	var top = getheight ( $E('topbarAndMenu') );
	var foot = getheight ( $E('footer') );
	var middle = $E('contentWrapper');
	var midHeight = getheight ( middle );
	if ( containerdivheight - ( foot + top  ) > midHeight )
		resize ( 'contentWrapper', containerdivheight - ( foot + top  ), false );
}

window.onresize = resizeColumns;

