var flashMinWidth = 960;
var flashMinHeight = 580;
var $ = document.getElementById;
var $e = document.documentElement;
var $b = document.body;

window.onresize = onScreenResize;

function onScreenResize ()
{
	var width = flashMinWidth > getWindowWidth() ? flashMinWidth + "px" : "100%";
	var height = flashMinHeight > getWindowHeight() ? flashMinHeight + "px" : "100%";

	document.getElementById("flash").style.width = width;
	document.getElementById("flash").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;
}


function popupPage (url, w, h) {
	if (!w) w = 500;
	if (!h) h = 400;
	
	win = window.open(url,"racPopup","toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + w + ",height=" + h);
	if (!win) return;
	
	win.focus();
}
