window.onload = function()
{
    FillLayout();
}

window.onresize = function()
{
    FillLayout();
}

function FillLayout()
{
    var container = document.getElementById( 'Container' );
    var tableHeight = document.getElementById( 'ContainerTable' ).clientHeight;
    var viewportHeight = GetViewportHeight();

    if ( tableHeight > viewportHeight )
        container.style.height = '';
    else if ( container.clientHeight != viewportHeight )
        container.style.height = viewportHeight + 'px';
}

function GetViewportHeight()
{
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight; 
	return window.undefined; 
}

