
// Flash Insert
function inputSWF (u, w, h, id, md, lc, fv, sc)
{
	if (!id) id = "swf_main";
	if (!md) md = "transparent"; // window | opaque | transparent
	if (!sc) sc = "always"; // always | never | samedomain

	//Flash
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '">\n');
	document.write('	<param name=movie value="' + u + '" />\n');
	document.write('	<param name=quality value="high" />\n');
	document.write('	<param name=wmode value="' + md + '" />\n');
	document.write('	<param name=flashVars value="' + fv + '" />\n');
	document.write('	<param name=allowScriptAccess value="' + sc + '" />\n');
	document.write('	<embed name="' + id + '" src="' + u + '" width="' + w + '" height="' + h + '" wmode="' + md + '" flashVars="' + fv + '" allowScriptAccess="' + sc + '" swLiveConnect="' + fv + '" type="application/x-shockwave-flash" quality=high pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');

/*	if (lc)
	{
		//FSCommand
		document.write('<script language="JavaScript">\n');
		document.write('function ' + id + '_DoFSCommand (command, args)\n');
		document.write('{\n');
		document.write('	if (command == "javascript") eval(args);\n');
		document.write('}\n');
		document.write('</script>\n');

		//VBScript
		if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
			document.write('<script language="VBScript">\n');
			document.write('On Error Resume Next\n');
			document.write('Sub ' + id + '_FSCommand(ByVal command, ByVal args)\n');
			document.write('	Call ' + id + '_DoFSCommand(command, args)\n');
			document.write('End Sub\n');
			document.write('</script>\n');
		}
	}*/
}

// Remote Function
function remoteCall (swf, cmd)
{
	var swf_obj;
	if (typeof(swf) && typeof(swf) != "object")
	{
		if (navigator.appName.indexOf("Microsoft") != -1) swf_obj = eval("document.all." + swf)
		else swf_obj = eval("document." + swf);
	}
	swf_obj.SetVariable("remote", cmd);
}



//* 레이어 가운데로 위치 맞추기... *//
function CenterLayer(div_id){
    var obj = document.getElementById(div_id);
    var x = 0;
    var y = 0;
    //var div_width = 0;  // 레이어 가로크기
    //var div_height = 0; // 레이어 세로크기

    if (obj != null){
      // [1] 레이어 크기 구하기
      div_width  = parseInt(obj.style.width);
      div_height = parseInt(obj.style.height);

  // [2] 레이어를 위치시킬 x, y좌표 구하기
      x = (document.body.clientWidth - div_width) / 2 - 150;
      y = (window.screen.width - div_height * 2) /2 - 150;

      // [3] 좌표변경
      obj.style.top = y + "px";
      obj.style.left = x + "px";
    
    }
}
