var min_width = 1024;
var min_height = 786;

var size = getViewportSize();

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%; margin:0; padding:0;");
	swfobject.createCSS("body", "height:100%; margin:0; padding:0;");
	swfobject.createCSS("#flash", "margin:0; width:100%; height:100%; min-width:" + parseInt(min_width) + "px; min-height:" + parseInt(min_height) + "px; display:block;");
	window.onresize = function() {
		var el = document.getElementById("flash");
		var size = getViewportSize(); 
		el.style.width = size[0] < min_width ? parseInt(min_width) + "px" : "100%";
		el.style.height = size[1] < min_height ? parseInt(min_height) + "px" : "100%";
	};
	window.onresize();
}	
function setHeight( h ) {
	if ( h < size[1] ) h = "100%";
	var el = document.getElementById("flash");
	if ( h != "100%" ) el.style.height = h < min_height ? parseInt(min_height) + "px" : h + "px";
	else el.style.height = "100%";
}
