/**
 * 
 * @author Mark Eijsermans <mark_eijsermans@warpmail.net>
 * 
 */

var width = 950;
var height = 650;

function getViewportSize() { 
	var size = [0, 0]; 
	if (typeof window.innerWidth != "undefined") { 
		size = [window.innerWidth, window.innerHeight];
	} 
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
	}
	else {
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
	}
	return size; 
}
function createFullBrowserFlash() {
	swfobject.createCSS("html", "height:99.8%;");
	swfobject.createCSS("body", "height:99.8%;");
	swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:"+ width.toString() +"px; min-height:"+ height.toString() +"px;");
	window.onresize = function() {
		var el = document.getElementById("container");
		if(el){
			var size = getViewportSize();
	 		el.style.width = size[0] < width ? width.toString() + "px" : "100%";
			el.style.height = size[1] < height ? height.toString() + "px" : "100%";
		} 
	};
	window.onresize();
}

function startFlash(){
	var flashvars = {};
	var params = {
		menu: "false",
		allowFullScreen: true
	};
	var attributes = {
		id: "mainSwf",
		name: "mainSwf"
	};

	swfobject.embedSWF("/main.swf", "contentWrapper", "100%", "100%", "9.0.0","/javascript/expressInstall.swf", flashvars, params, attributes);
	
	swfobject.embedSWF("/main.swf", "contentWrapper", "100%", "100%", "9.0.0");
	if (swfobject.hasFlashPlayerVersion("9.0.0")) {
		swfobject.addDomLoadEvent(createFullBrowserFlash);
	}
}

