


// Properties
var browsertype = "";
var container_min_width = 980;
var container_min_height = 580;
var container_id = "flashcontent";


// Browser Checks
if (navigator.userAgent.indexOf("Opera") != -1 && document.getElementById) 
	browsertype = "OP";
if (document.all)
	browsertype = "IE";
if (document.layers)
	browsertype = "NN";
if (!document.all && document.getElementById)
	browsertype="MO";



// Set ID Width
function setWidth (id, w)
{
	if (browsertype == "IE")
		eval("document.all." + id + ".style.width='" + w + "'");
	if (browsertype == "NN")
		eval("document." + id + ".width='" + w + "'");
	if (browsertype == "MO" || browsertype == "OP")
		eval("document.getElementById('" + id + "').style.width='" + w + "'");
}



// Set ID Height
function setHeight (id, h)
{
	if (browsertype == "IE")
		eval("document.all." + id + ".style.height='" + h + "'");
	if (browsertype == "NN")
		eval("document." + id + ".height='" + h + "'");
	if (browsertype == "MO" || browsertype == "OP")
		eval("document.getElementById('" + id + "').style.height='" + h + "'");
}



// Get Inner Width
function getInnerWidth ()
{
	var myWidth = 0;
	if (typeof(window.innerWidth) == 'number')
	{
		// Non-IE
    	myWidth = window.innerWidth;
	}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		// IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	}
	else if ( document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		// IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}



// Get Inner Height
function getInnerHeight ()
{
	var myHeight = 0;
	if (typeof(window.innerWidth) == 'number')
	{
		// Non-IE
		myHeight = window.innerHeight;
	}
	else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
	{
		// IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	}
	else if (document.body && (document.body.clientWidth || document.body.clientHeight))
	{
		// IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}



function scalePage ()
{
	var w = getInnerWidth();
	var h = getInnerHeight();
	//obj = document.getElementById("container");
	if (w < container_min_width)
	{
		setWidth(container_id, container_min_width + "px");
		//obj.style.width = 960 + "px";
	}
	else
	{
		setWidth(container_id, 100 + "%");
		//obj.style.width = 100 + "%";	
	}
	if (h < container_min_height)
	{
		setHeight(container_id, container_min_height + "px");
		//obj.style.height = 600 + "px";
	}
	else
	{
		setHeight(container_id, 100 + "%");
		//obj.style.height = 100 + "%";	
	}
}



function fullscreen ()
{
	self.moveTo(0,0);
	self.resizeTo(screen.availWidth,screen.availHeight);
}



window.onresize = scalePage;
window.onload = scalePage;
addLoadEvent(fullscreen);
addLoadEvent(scalePage);


