//ÇÏ´Ù¸¶ÀÌ ÇÃ·¡½Ã »ðÀÔ ÀÚ¹Ù½ºÅ©¸³Æ®-¾×Æ¼ºê¿¢½ºÆÐÄ¡´ëºñ
//2006-02-09
//°¢ ¼Ó¼º ¿ÜºÎ ÀÔ·Â.´ÙÁß»ç¿ë.

function FlashInsert(FlashIDName, FlashFileName, FlashWidth, FlashHeight, DNSSetting, WMODESetting, FlashBGColor, QSetting, FlashAlign, FlashVars)
{
	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('CODEBASE="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,22,0" ');
	document.write(' ID="'+FlashIDName+'" WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" ALIGN="'+FlashAlign+'">');
	document.write('<PARAM NAME="movie" VALUE="'+ FlashFileName +'">');
	document.write('<PARAM NAME="quality" VALUE="'+QSetting+'">');
	document.write('<PARAM NAME="bgcolor" VALUE="'+FlashBGColor+'">');
	document.write('<PARAM NAME="wmode" VALUE="'+WMODESetting+'">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="'+DNSSetting+'">');
	document.write('<PARAM NAME="flashVars" VALUE="'+FlashVars+'">');
	document.write('<EMBED SRC="'+ FlashFileName +'"  NAME="'+FlashIDName+'"');
	document.write(' WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" QUALITY="'+QSetting+'" BGCOLOR="'+FlashBGColor+'"');
	document.write(' ALLOWSCRIPTACCESS="'+DNSSetting+'" ALIGN="'+FlashAlign+'" WMODE="'+WMODESetting+'" TYPE="application/x-shockwave-flash" ');
	document.write(' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" flashVars="'+FlashVars+'">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}


// ¸ÞÀÎ ÇÃ·¡½Ã

    function setFlashVars(command, buffer,k_name) {
           var _string = command;
           var _str = "getMovieName('"+k_name+"')."+_string+"('"+buffer+"');";
           eval(_str);
    }
	
    function fsetMouseOut(k_name)
    {
    	setFlashVars("EVENT_INFO", "MOUSE_OUT",k_name);
    }
    
    function fsetMouseOver(k_name)
    {
    	setFlashVars("EVENT_INFO", "MOUSE_OVER",k_name);
    }
	
    // ID°ªÀ¸·Î, ÆäÀÌÁö¿¡ ÀÖ´Â ÇÃ·¡½ÃÆÄÀÏÀ» °Ë»öÇØÁØ´Ù. (À¯¿ë)
    function getMovieName(movieName) {
    
    	if (navigator.appName.indexOf("Microsoft") != -1) {
    		//return window[movieName];
    		return document.getElementById(movieName);
    	}
    	else {
    		//return document[movieName];
    		return document.getElementsByName(movieName);
    	}
    } 




// popup Ãß°¡ 
function openw(sURL)
{
newwindow=open(sURL,"popupnav","titlebar=no, scrollbars=no, toolbar=no, directories=no, menubar=no, resizable=no, status=no,width=1,height=1, screenX=10000, screenY=10000" );
} 
function openw2(sURL)
{
newwindow=open(sURL,"popupnav","titlebar=no, scrollbars=yes, toolbar=no, directories=no, menubar=no, resizable=no, status=no,width=1,height=1, screenX=10000, screenY=10000" );
} 


// ÇÃ·¡½Ã Ã¤ÆÃ Ãß°¡ // ÇÔ¼ö¸í º¯°æ. .swf Ã³¸® ??

function FlashInsertAction(FlashIDName, FlashPathName, FlashFileName, FlashWidth, FlashHeight, DNSSetting, WMODESetting, FlashBGColor, QSetting, FlashAlign, FlashVars)
{
	document.write('<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('CODEBASE="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,22,0" ');
	document.write(' ID="'+FlashIDName+'" WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" ALIGN="'+FlashAlign+'">');
	document.write('<PARAM NAME="movie" VALUE="'+ FlashFileName +'">');
	document.write('<PARAM NAME="quality" VALUE="'+QSetting+'">');
	document.write('<PARAM NAME="bgcolor" VALUE="'+FlashBGColor+'">');
	document.write('<PARAM NAME="wmode" VALUE="'+WMODESetting+'">');
	document.write('<PARAM NAME="showLiveConnect" VALUE ="true">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="'+DNSSetting+'">');
	document.write('<PARAM NAME="flashVars" VALUE="'+FlashVars+'">');
	document.write('<EMBED SRC="'+ FlashPathName +'"  NAME="'+FlashIDName+'"');
        document.write(' FlashVars="'+FlashVars+'"');
	document.write(' WIDTH="' + FlashWidth + '" HEIGHT="' + FlashHeight + '" QUALITY="'+QSetting+'" BGCOLOR="'+FlashBGColor+'"');
	document.write(' ALLOWSCRIPTACCESS="'+DNSSetting+'" ALIGN="'+FlashAlign+'" WMODE="'+WMODESetting+'" TYPE="application/x-shockwave-flash" ');
	document.write(' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" flashVars="'+FlashVars+'">');
	document.write('</EMBED>');
	document.write('</OBJECT>');
}

// ÇÃ·¡½Ã Ã¤ÆÃ Ãß°¡ // ÇÔ¼ö¸í º¯°æ. .swf Ã³¸® ??


// vod º¸±â - Ãß°¡ 071028

function showPlayer(fla, width, height, AutoStart, ShowTracker, ShowControls, ShowGotoBar, ShowDisplay, ShowStatusBar, AutoSize)
{
	var object =
		"<object id='player' name='player' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' width='" + width + "' height='" + height + "'>"
		+ "<param name='FileName' value='" + fla + "'>"		
		+ "<param name='AutoStart' value='" + AutoStart + "'>"
		+ "<param name='ShowTracker' value='" + ShowTracker + "'>"
		+ "<param name='ShowControls' value='" + ShowControls + "'>"
		+ "<param name='ShowGotoBar' value='" + ShowGotoBar + "'>"
		+ "<param name='ShowDisplay' value='" + ShowDisplay + "'>"
		+ "<param name='ShowStatusBar' value='" + ShowStatusBar + "'>"
		+ "<param name='AutoSize' value='" + AutoSize + "'>"	
		+ "<embed src='" + fla + "' AutoStart='" + AutoStart + "' ShowTracker='" + ShowTracker + "' ShowControls='" + ShowControls + "' ShowGotoBar='" + ShowGotoBar + "' ShowDisplay='" + ShowDisplay + "' ShowStatusBar='" + ShowStatusBar + "' AutoSize='" + AutoSize + "' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='" + width + "' height='" + height + "'></embed>"
		+ "</object>"
												
	document.write( object );
}

function m_play() {
	document.all.player.play();
}

function m_pause() {
	document.all.player.pause();
}

function m_stop() {
	document.all.player.stop();
}

function showPlayer2(fla, width, height, AutoStart, ShowTracker, ShowControls, ShowGotoBar, ShowDisplay, ShowStatusBar, AutoSize)
{
	var object =
		"<object id='player2' name='player2' classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715' width='" + width + "' height='" + height + "'>"
		+ "<param name='FileName' value='" + fla + "'>"		
		+ "<param name='AutoStart' value='" + AutoStart + "'>"
		+ "<param name='ShowTracker' value='" + ShowTracker + "'>"
		+ "<param name='ShowControls' value='" + ShowControls + "'>"
		+ "<param name='ShowGotoBar' value='" + ShowGotoBar + "'>"
		+ "<param name='ShowDisplay' value='" + ShowDisplay + "'>"
		+ "<param name='ShowStatusBar' value='" + ShowStatusBar + "'>"
		+ "<param name='AutoSize' value='" + AutoSize + "'>"	
		+ "<embed src='" + fla + "' AutoStart='" + AutoStart + "' ShowTracker='" + ShowTracker + "' ShowControls='" + ShowControls + "' ShowGotoBar='" + ShowGotoBar + "' ShowDisplay='" + ShowDisplay + "' ShowStatusBar='" + ShowStatusBar + "' AutoSize='" + AutoSize + "' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='" + width + "' height='" + height + "'></embed>"
		+ "</object>"
												
	document.write( object );
}

function m_play2() {
	document.all.player2.play();
}

function m_pause2() {
	document.all.player2.pause();
}

function m_stop2() {
	document.all.player2.stop();
}

// common js Ãß°¡ ÇÕ´Ï´Ù. 
//Trim ÇÔ¼ö ±¸Çö
function Trim(inputString) {
	var retValue = inputString;
	var ch = retValue.substring(0, 1);
	
	while (ch == " ") {
	retValue = retValue.substring(1, retValue.length);
	ch = retValue.substring(0, 1);
	}
	ch = retValue.substring(retValue.length-1, retValue.length);

	while (ch == " ") {
	retValue = retValue.substring(0, retValue.length-1);
	ch = retValue.substring(retValue.length-1, retValue.length);
	
	}
	while (retValue.indexOf(" ") != -1) { 
	retValue = retValue.substring(0, retValue.indexOf(" ")) + retValue.substring(retValue.indexOf(" ")+1, retValue.length); 
	}
return retValue; 
}
// shop »ç¿ë : Æ÷ÀÎÆ® 
function shop_point_use(f,opt){

	ddd = f.od_temp_point.value;

	if ( parseInt(opt) < parseInt(ddd)){

		alert(" ±Ý¾×À» ´Ù½Ã ¼³Á¤ÇØÁÖ¼¼¿ä! ");

		f.od_temp_point.value = 0;
		f.od_temp_point.focus(); 

		return;

	}

}
// ±Ý¾×Ç¥½Ã
function number_format(data) 
{
        
        var tmp = '';
        var number = '';
        var cutlen = 3;
        var comma = ',';
        var i;
       
        len = data.length;
        mod = (len % cutlen);
        k = cutlen - mod;
        for (i=0; i<data.length; i++) 
        {
            number = number + data.charAt(i);
            
            if (i < data.length - 1) 
            {
                k++;
                if ((k % cutlen) == 0) 
                {
                    number = number + comma;
                    k = 0;
                }
            }
        }

        return number;
}
// ÀüÃ¼¼±ÅÃ
function check_all(f)
{
    var chk = document.getElementsByName("chk[]");

    for (i=0; i<chk.length; i++)
        chk[i].checked = f.chkall.checked;
}
function u_btn_check(f, str, opt)   // str : ¹®±¸ , url : ÀÌµ¿url
{

    if (str == "")
    { 
        return;
    } 

    if (opt != "")
    { 
		f.com_check.value = opt;
    } 


    var chk = document.getElementsByName("chk[]");
    var bchk = false;

    for (i=0; i<chk.length; i++)
    {
        if (chk[i].checked)
            bchk = true;
    }

    if (!bchk) 
    {
        alert(str + "ÇÒ ÀÚ·á¸¦ ÇÏ³ª ÀÌ»ó ¼±ÅÃÇÏ¼¼¿ä.");
        return;
    }

    if (str == "»èÁ¦")
    {
        if (!confirm("¼±ÅÃÇÑ ÀÚ·á¸¦ Á¤¸» »èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?"))
            return;
    }

    f.submit();
}
