﻿var checkH;
var checkW;
var swf_src = "swf/main.swf";

function setFlash() {
	var str = "";
	if (document.all) {
		str += "<object id='flash' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' ";
		str += "codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' ";
		str += "width='"+checkW+"' height='"+checkH+"'>";
		str += "<param name='movie' value='" + swf_src + "' />";
		str += "<param name='quality' value='high' />";
		str += "</object>";
	} else if (document.getElementById) {
		str += "<embed id='flash' src='" + swf_src + "' quality='high' ";
		str += "pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' ";
		str += "width='"+checkW+"' height='"+checkH+"'>";
		str += "</embed>";
	}
	document.getElementById("container").innerHTML = str;
}
function checkScreen() {
	if (window.innerWidth) {
		checkW = window.innerWidth;
		checkH = window.innerHeight;
	}
	else if (document.documentElement.clientWidth) {
		checkW = document.documentElement.clientWidth;
		checkH = document.documentElement.clientHeight;
	}
	else if (document.body) {
		checkW = document.body.clientWidth;
		checkH = document.body.clientHeight;
	}
	if (checkW < 980) {
		checkW = 980;
	} else {
		checkW = "100%";
	}
	if (checkH < 800) {
		checkH = 620;
	} else {
		checkH = checkH-180;
	}
}
window.onload = function() {
	checkScreen();
	setFlash();
}
window.onresize = function() {
	checkScreen();
	document.getElementById("flash").width = checkW;
	document.getElementById("flash").height = checkH;
}

