/* ***************************************************************
	Flash Player Interface
**************************************************************** */
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Flash ¹«ºñÀÇ ¸ðµç FSCommand ¸Þ½ÃÁö¸¦ Ã³¸®ÇÕ´Ï´Ù.
function SOCIETY_DoFSCommand(command, args) {
	var testObj = isInternetExplorer ? document.all.SOCIETY : document.SOCIETY;
	if (command=="topBtn")
	{
		CICLIFE_TopButton(args);
	}
	if (command=="download")
	{
		CICLIFE_DownloadButton(args);
	}
	if (command=="href")
	{
		CICLIFE_HrefButton(args);
	}
	if (command=="close")
	{
		parent.self.close();
	}
}
// Internet Explorer¿¡ ¿¬°áµÇ´Â ÁöÁ¡
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 SOCIETY_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call SOCIETY_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}


function CICLIFE_TopButton( args )
{
	var arg = args.split("#");
	
	// top button »ç¿ë
	// 0: ÇÐ½Àµµ¿ì¹Ì 
    // 1: ±³Àç´Ù¿î·Îµå
    // 2: ¿ë¾î»çÀü
    // 3: ÀÎ¼âÇÏ±â - ³»ºÎ¿¡¼­ Ã³¸®
	if ( arg[0] == "0" )
	{
		if(arg[3] == "Y") {
    	    //alert(arg[1]);
    		window.open(arg[2],'help','width=820,height=650,scrollbars=1');
    	}
	}
	else if ( arg[0] == "1" )
	{
	    if(arg[3] == "Y") {
	        download_frame.location.href= arg[2];
	    }
	}
	else if ( arg[0] == "2" )
	{
	    if(arg[3] == "Y") {
	        window.open(arg[2], "objDic", "width=830, height=500, resizable=0, scrollbars=0, left=0, top=0");
	    }

	}
	
}

function CICLIFE_DownloadButton( args )
{
	if ( args.length >0 )
	{
        download_frame.location.href= args;
	}
}

// ¿øÇÏ´Â Url·Î ÀÌµ¿
function CICLIFE_HrefButton(args)
{
    if ( args.length >0 )
	{
        // ±âÁ¸ »ç¿ëµÇ´Â ÀüÃ¼URLÀÇ »ç¿ëºÎºÐ¸¸ °¡Á®¿À±â
        alert(window.location.href);
        surl = String(window.location.href).split("/");
        gourl = "";
        for(var i=0;i<surl.length-2;i++) {
            gourl += surl[i]+"/";
            //alert(gourl);
        }
        
        window.location.href = gourl+args;
        
	}
}
/*
 Method: FlashObject
 Param1: SWF path
 Param2: Movie width
 Param3: Movie height
 Param4: BGColor
 Param5: Flashvars (Optional)
*/
function FlashObject(swf, id, width, height, bgcolor, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" ';
        strFlashTag += 'width="' + width + '" height="' + height + '" id="' + id + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';
        if(flashvars != null) {strFlashTag += '<param name="flashvars" value="' + flashvars + '"/>'};
        strFlashTag += '<param name="quality" value="best"/>';
        strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="always"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'id="' + id + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="always" ';
        if(flashvars != null) {strFlashTag += 'flashvars="' + flashvars + '" '};
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '</embed>';
    }

    document.write(strFlashTag);
}