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 addFlash() {
	swfobject.createCSS("html", "height:100%;");
	swfobject.createCSS("body", "height:100%; margin:0; padding:0;");
	swfobject.createCSS("#flashcontent", "width:100%; height:100%; min-width:980px; min-height:700px; margin:0;");
	
	var flashvars = {xmlProject:"xml/main.xml"};
	var params = {quality:"best", scale:"noscale", wmode:"window", allowFullScreen:"true", allowscriptaccess:"always", bgcolor:"#fff"};
	var attributes = {id:"flashcontent"};
	
	swfobject.embedSWF("index.swf", "flashcontent", "100%", "100%", "9.0.124", "expressInstall.swf", flashvars, params, attributes);
	
	window.onresize = function() {
		var el = document.getElementById("flashcontent");
		var size = getViewportSize(); 
		el.style.width = size[0] < 980 ? "980px" : "100%";
		el.style.height = size[1] < 700 ? "700px" : "100%";
	};
	
	window.onresize();
}

if (swfobject.hasFlashPlayerVersion("6.0.65")) {
    swfobject.addDomLoadEvent(addFlash);
}
else if (!swfobject.hasFlashPlayerVersion("6.0.65")) {
    window.location = "features/noflash/noflash.html";
}
