// v1.0

var _w;// = 800;
var _h;// = 3600;


function setStage(my_w, my_h)
{
	//alert("setStage!");
	_w = my_w;
	_h = my_h;
			
	resize();
	window.onresize = resize;
}

function getWidth()
{
	//alert("stage.js: getWidth");
	
	if (window.innerWidth != null)
	{
		return window.innerWidth;	
	}
			
	if (document.body.clientHeight != null)
	{
       	return document.body.clientWidth;
   		return (null);
	}
}
		
function getHeight()
{
	//alert("stage.js: getHeight");
    if (window.innerHeight != null)
	{
		return window.innerHeight;
	}
			
    if (document.body.clientHeight != null)
	{
       	return document.body.clientHeight;
   		return (null);
	}
}
function resize_w()
{
	//alert("stage.js: resize_w");
	if (getWidth() > _w)
	{
		document.getElementById('flashcontainer').style.width = '100%';
       	return;
    }
    else
	{
		document.getElementById('flashcontainer').style.width = _w + 'px';
       	return;
    }
}
function resize_h()
{
	//alert("stage.js: resize_h");
	if (getHeight() > _h)
	{
		document.getElementById('flashcontainer').style.height = '100%';
       	return;
    }
    else
	{
		document.getElementById('flashcontainer').style.height = _h + 'px';
       	return;
    }
}
function resize()
{	
	resize_w();
	resize_h();
}

//resize();