var _height = 0;
var _minWidth = 1000;

function replaceFooter(pY)
{
	_height = pY;
	onWindowResize();
}

function getWindowWidth()
{
    if (typeof window.innerWidth != 'undefined')
	{
		return window.innerWidth;
	}
    else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0) 
	{
        return document.documentElement.clientWidth;
	}
	else
	{
		return document.getElementsByTagName('body')[0].clientWidth;
	}
}

function getWindowHeight()
{
	if(typeof window.innerHeight != 'undefined')
	{
		return window.innerHeight;
	}
	else if(typeof document.documentElement != 'undefined' && typeof document.documentElement.clientHeight !='undefined' && document.documentElement.clientHeight != 0)
	{
		return document.documentElement.clientHeight;
	}
	else
	{
		return document.getElementsByTagName('body')[0].clientHeight;
	}
}

function onWindowResize()
{
	var w = getWindowWidth() > _minWidth ? '100%' : _minWidth + 'px';
	var h = _height == 0 ? '100%' : _height + 'px';
	
	document.getElementById('main').style['height'] = h;
	document.getElementById('main').style['width'] = w;
	
	swfobject.createCSS('#content', 'margin:0; width:' + w + '; height:' + h + ';');
}

window.onload = window.onresize = function()
{
    onWindowResize();
}
