// public variables
var appWidth = 1070;
var appHeight = 750;

// swfobject code and initialize app
function initialize()
{
	var so = new SWFObject("swf/sgLoader.swf", "swf", "100%", "100%", "9", "#d2d2d2");
	so.addParam("scale", "noscale");
	so.addParam("menu", "false");
	so.addParam("base", "/");
	so.addVariable("mainURL", "swf/supergenius.swf");
	so.addVariable("feedURL", "/feed/");
	
	so.write("content");
	
	adjustHeight();
	window.onresize = adjustHeight;
}

// resize flash
function adjustHeight()
{
	w = (self.innerWidth > document.body.clientWidth) ? 
		self.innerWidth : (
			(document.body.clientWidth > document.documentElement.clientWidth) ? 
				document.body.clientWidth : document.documentElement.clientWidth
		);
		
	h = (self.innerHeight > document.body.clientHeight) ? 
		self.innerHeight : (
			(document.body.clientHeight > document.documentElement.clientHeight) ? 
				document.body.clientHeight : document.documentElement.clientHeight
		);
	
	fw = (w > appWidth) ? "100%" : appWidth + "px";
	fh = (h > appHeight) ? "100%" : appHeight + "px";
	
	document.getElementById("content").style.height = fh;
	document.getElementById("content").style.width = fw;
}