window.onload = function() {
	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:100%;");  
	    swfobject.createCSS("body", "height:100%;");  
	    swfobject.createCSS("#container", "margin:0; width:100%; height:100%; min-width:860px; min-height:590px;");
		window.onresize = function() {
			var el = document.getElementById("container");
			var size = getViewportSize();
			el.style.width = size[0] < 860 ? "860px" : "100%";
		// only scrollbars when NECESSARY, not when window dimensions are askew!
		//	var w = size[0] > 860 ?  size[0] : 860;
		//	var h = 0.686 * w;
		//	el.style.height = size[1] < h ? (h + "px") : "100%";
			el.style.height = size[1] < 590 ? "590px" : "100%";
		};
		window.onresize();
	}

	//var flashvars = { };  
	//var params = {scale:"noscale", "allowscriptaccess": "samedomain" };  

	var url = "static/flash/site.swf";
	var nocache = "?nocache=" + new Date().getTime();
	
	swfobject.embedSWF(url+nocache, "flashdiv", "100%", "100%", "9.0.0", false, false, false);  
	if (swfobject.hasFlashPlayerVersion("9.0.0")) {  
	    swfobject.addDomLoadEvent( createFullBrowserFlash );  
	}
}
