// JavaScript Document


var sw;
var sh;
var wid;
var hei;
var isOnload = false;
var flashNode;
var divId = "flashcontent";
var limitW = 1160;
var limitH = 812;
function checkSize()
{
	if(uaObject.ua.isWin && uaObject.ua.isIE)
	{
		//sw = document.body.clientWidth;
		//	sh = document.body.clientHeight;
		sw = document.documentElement.clientWidth;
		sh = document.documentElement.clientHeight;
	}
	else
	{
		sw = window.innerWidth;
		sh = window.innerHeight;
	}
	
	wid = sw;
	hei = sh;
	if(sw > limitW)
	{
		wid = limitW;
	}
	
	if(sh > limitH)
	{
		hei = limitH;
	}
}


function changeSize()
{
	document.getElementById(divId).style.width = wid + "px";
	document.getElementById(divId).style.height = hei + "px";
	document.getElementById(divId).style.top = (sh - hei)/2 + "px";
	document.getElementById(divId).style.left = (sw - wid)/2 + "px";
}

function addResizeEvent()
{
	isOnload = true;
	flashNode = document.getElementById(divId);
	resizeHandler();
	window.onresize = function()
	{
		resizeHandler();
	}
	
}


var timer;
var count;
var flg = false;
function resizeHandler()
{
	if(uaObject.ua.isWin && uaObject.ua.isIE)
	{
		count = 0;
		clearInterval(timer);
		flg = false;
		timer = setInterval(resizeChangeSize, 1);
	}
	else
	{
		checkSize();
		changeSize();
	}
}

function resizeChangeSize()
{
	count += 1;
	if(count == 4)
	{
		clearInterval(timer);
	}
	checkSize();
	changeSize();
}


function installFinish()
{
	top.location.reload(true);
}

setBaseLoadEvent(addResizeEvent);
checkSize();


//writeSwf();

var cssTxt = '<style type="text/css">'
	+'#'+ divId +'{'
	+'width:' + wid + 'px;'
	+'height:' + hei + 'px;'
	+'position:absolute;'
	+'top:' + (sh - hei)/2 + 'px;'
	+'left:' + (sw - wid)/2 + 'px;'
	+'text-align:center;'
	+'z-index:11;'
	+'}'
	+'<\/style>';
document.write(cssTxt);





