var flashMinWidth = 1024;
var flashMinHeight = 820;
var $e = document.documentElement;
var $b = document.body;
function $ (id) { return document.getElementById(id); }

window.onresize = onScreenResize;
window.onload = onScreenResize;

// For Mozilla compatibility
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", onScreenResize, false);
}

function onScreenResize ()
{
	var width = flashMinWidth > getWindowWidth() ? flashMinWidth + "px" : "100%";
	var height = flashMinHeight > getWindowHeight() ? flashMinHeight + "px" : "100%";
	
	$("flashContainer").style.width = width;
	$("flashContainer").style.height = height;
	$("core").style.width = width;
	$("core").style.height = height;
}

function getWindowHeight ()
{
	var result = 0;
	if (typeof(window.innerHeight) == "number") result = window.innerHeight;
	else {
		if ($e && $e.clientHeight) result = $e.clientHeight;
		else if ($b && $b.clientHeight) result = $b.clientHeight;
	}
	return result;
}

function getWindowWidth ()
{
	var result = 0;
	if (typeof(window.innerWidth) == "number") result = window.innerWidth;
	else {
		if ($e && $e.clientWidth) result = $e.clientWidth;
		else if ($b && $b.clientWidth) result = $b.clientWidth;
	}
	return result;
}