var minw = 1000;
var minh = 700;

function css1_compat(){
	if (document.compatMode) return (document.compatMode=="CSS1Compat");
	return 0;
}
function doc_body(){
	if (css1_compat()) return document.documentElement;
	if (document.body) return document.body;
	return 0;
}

//Layer Set
function set_layer(){
	var obj, ww, st, ht;
	ww = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
	ht = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
	
	if (ww<minw) {
		ww = minw;
	}
	if (ht<minh) {
		ht = minh;
	}

	obj = document.getElementById('wflash').style;
	obj.left = '0px';
	obj.top = '0px';
	obj.width = ww+'px';
	obj.height = ht+'px';
}

//Create Layer
window.onload = function() {
	var htm;

	htm = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="flalayer" align="middle">';
	htm += '<param name="allowScriptAccess" value="always" />';
	htm += '<param name="movie" value="index.swf" />';
	htm += '<param name="quality" value="high" />';
	htm += '<param name="bgcolor" value="#000000" />';
	htm += '<embed src="index.swf" quality="high" bgcolor="#000000" width="100%" height="100%" ';
	htm += 'name="flalayer" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	htm += '</object>';

	var ele = document.createElement('div');
	ele.setAttribute('id','wflash');
	ele.innerHTML = htm;
	ele.style.position = 'absolute';
	ele.style.width='800px';
	ele.style.height='600px';
	ele.style.visibility = 'visible';
	document.body.appendChild(ele);

	//Window Resize
	window.onresize = function(){
		set_layer();
	}
	window.onscroll = window.onresize;
	set_layer();
}