/**
 * @author joseph.schmitt
 */
var params = {
	quality: "high",
	scale: "noscale",
	wmode: "opaque",
	allowscriptaccess: "always",
	bgcolor: "#151515"
};
var flashvars = {};
var attributes = {id:"geobee", name:"geobee" };
swfobject.embedSWF("main.swf", "geobee", "100%", "100%", "8.0.0", "expressInstall.swf", flashvars, params, attributes);

// Declare variables to store the x and y dimensions when xWidth and yHeight are specified:
var currentWidth;
var currentHeight;
var tophatHeight = 168;

// Sets the Flash player object size within the page:
function setPlayerSize(flashObject, divObject, xWidth, yHeight) {
	// Set currentWidth and currentHeight to passed values for use on resize:
	currentWidth = xWidth;
	currentHeight = yHeight;
	
	var iw, ih; // Set inner width and height of page:
	if (self.innerHeight){
		iw = self.innerWidth;
		ih = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) {
		iw = document.documentElement.clientWidth;
		ih = document.documentElement.clientHeight;
	} else if (window.innerWidth == null) {
		iw = document.body.clientWidth;
		ih = document.body.clientHeight; 
	} else {
		iw = window.innerWidth;
		ih = window.innerHeight;
	}
	
	// Code to execute if the browser does NOT USE the embedded Flash Player:
	if(document.embeds > -1) {
		// Set Flash Player's width parameter:
		if(iw <= xWidth) {
			document.embeds[flashObject].width = xWidth;
			document.getElementById(divObject).style.width = xWidth + "px";
			
		} else {
			document.embeds[flashObject].width = "100%";
			document.getElementById(divObject).style.width = "100%";
		}
		
		// Set Flash Player's height parameter:
		if(ih <= yHeight) {
			document.embeds[flashObject].height = yHeight;
			document.getElementById(divObject).style.height = yHeight + "px";
		} else {
			document[flashObject].height = ih-tophatHeight;
			document.getElementById(divObject).style.height = ih-tophatHeight+'px';
		}
	// Code to execute if the browser USES the embedded Flash Player:
	} else {
		// Set Flash Player's width parameter:
		
		if(iw <= xWidth) {
			document[flashObject].width = xWidth;
			document.getElementById(divObject).style.width = xWidth + "px";
		} else {
			document[flashObject].width = "100%";
			document.getElementById(divObject).style.width = "100%";
		}
		
		// Set Flash Player's height parameter:
		if(ih <= yHeight) {
			document[flashObject].height = yHeight;
			document.getElementById(divObject).style.height = yHeight + "px";
		} else {
			document[flashObject].height = ih-tophatHeight;
			document.getElementById(divObject).style.height = ih-tophatHeight+'px';
		}
	}
}