var FlashWidth=940;
var FlashHeight=775;
var WrapID="flash";

function writeObject(){
	var so = new SWFObject("./assets/swf/top.swf", "externalInterface", "100%", "100%", "8", "#FFFFFF");
	so.addParam("scale", "noscale");
	so.addParam("allowscriptaccess", "always");
	so.addParam("swLiveConnect", "true");
	so.addParam("quality", "high");
		
	var myver = so.installedVer;
	myver = myver.major;
	if( myver != 8 && navigator.userAgent.indexOf("MSIE")==-1 ){
		so.addParam("wmode", "opaque");
	}
	
	if( visited ){
		so.addVariable("cookie", "true" );
	}

	so.addVariable("configpath", "./assets/xml/setting.xml" );
	so.addVariable("configpath2", "./message/top-allxml/" );

	so.write("flashcontent");
}

function getBrowserWidth ( ) {  
 if ( window.innerWidth ) { return window.innerWidth; }  
 else  if ( document.documentElement && document.documentElement.clientWidth != 0 ) { return document.documentElement.clientWidth; }  
 else if ( document.body ) { return document.body.clientWidth; }  
 return 0;  
}
function getBrowserHeight ( ) {  
 if ( window.innerHeight ) { return window.innerHeight; }  
 else if ( document.documentElement && document.documentElement.clientHeight != 0 ) { return document.documentElement.clientHeight; }  
 else if ( document.body ) { return document.body.clientHeight; }  
 return 0;  
}
function setWrapWidth (WrapWidth) {  
 FlashWidth=WrapWidth;
 setFlaArea();
}
function setWrapHeight (WrapHeight) {  
 FlashHeight=WrapHeight;
 setFlaArea();
}
function setWrapSize (WrapWidth,WrapHeight) {  
 FlashWidth=WrapWidth;
 FlashHeight=WrapHeight;
 setFlaArea();
}
function setWrapID (IDName) {  
 WrapID=IDName;
}
function setFlaArea(){
 var WrapFlashElement = document.getElementById(WrapID);
 if(getBrowserWidth()>FlashWidth){ WrapFlashElement.style.width = "100%"; }
 else{ WrapFlashElement.style.width = FlashWidth+"px"; }
 if(getBrowserHeight()>FlashHeight){ WrapFlashElement.style.height = "100%"; }
 else{ WrapFlashElement.style.height = FlashHeight+"px"; }
}
window.onresize = setFlaArea;
window.onload=setFlaArea;
