﻿

function LayoutWindow()
{
	var windowHeight = WindowHeight();
	var windowWidth = WindowWidth();
	
	var windowHeightOffset = 206;
	var windowWidthOffset = 240;

    $('layout_main').setStyle({
//        width : (windowWidth - windowWidthOffset) + "px",
        height : (windowHeight - windowHeightOffset) + "px"
    });
}

Event.observe(window, 'load', LayoutWindow);
Event.observe(window, 'resize', LayoutWindow);


function WindowHeight()
{
	if (self.innerHeight) // all except Explorer
	{
		return self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		return document.body.clientHeight;
	}
}

function WindowWidth()
{
	if (self.innerWidth) // all except Explorer
	{
		return self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
		// Explorer 6 Strict Mode
	{
		return document.documentElement.clientWidth;
	}
	else if (document.body) // other Explorers
	{
		return document.body.clientWidth;
	}
}
