/*

------------------------------------------------------------------
	JAVA-SCRIPT FOR FLASH
    -------------------------------------------
       creator * PARK JONGJAE ( Namoo )
       contact * admin@namoo.net, http://namoo.net
------------------------------------------------------------------

*/

//----------------------------------------------------------------

// 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);
}


// Window Utilities
document.write("<object id='winMinimize' type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11'><param name='command' value='minimize'></object>");
document.write("<object id='winMaximize' type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11'><param name='command' value='maximize'></object>");

function minWin ()
{
	document.winMinimize.Click();
}

function maxWin ()
{
	document.winMaximize.Click();
}

function opnWin (u, i, o)
{
	var win = window.open(u, i, o);
	win.focus();
}
