var	plogin = null;

function	chg_tab(nTab1, nTab2, nCnt)
{
	var	i;

	for (i = 1; i <= nCnt; i++)
	{
		document.getElementById("m_tab_list" + nTab1 + i).style.display = "none";
		document.getElementById("img_tab" + nTab1 + i).src = "/aImg/main/m_tab" + nTab1 + i + ".gif";
	}

	document.getElementById("m_tab_list" + nTab1 + nTab2).style.display = "block";
	document.getElementById("img_tab" + nTab1 + nTab2).src = "/aImg/main/m_tab" + nTab1 + nTab2 + "_on.gif";
}
function	chg_tab_art(nTab1, nTab2, nCnt)
{
	var	i;

	for (i = 1; i <= nCnt; i++)
	{
		document.getElementById("m_tab_list" + nTab1 + i).style.display = "none";
		document.getElementById("img_tab" + nTab1 + i).src = "/aImg/art/art_tab" + nTab1 + i + ".gif";
	}

	document.getElementById("m_tab_list" + nTab1 + nTab2).style.display = "block";
	document.getElementById("img_tab" + nTab1 + nTab2).src = "/aImg/art/art_tab" + nTab1 + nTab2 + "_on.gif";
}

function	chg_ctxt(nTab1, nTab2, nCnt, pgm)
{
	var	i;

	for (i = 1; i <= nCnt; i++)
	{
		document.getElementById("ctxt" + nTab1 + "_" + i).style.display = "none";
		document.getElementById("clink" + nTab1 + "_" + i).src = "/aImg" + pgm + "_" + nTab1 + "_" + i + ".gif";
	}

	document.getElementById("ctxt" + nTab1 + "_" + nTab2).style.display = "block";
	document.getElementById("clink" + nTab1+ "_" + nTab2).src = "/aImg" + pgm + "_" + nTab1 + "_" + nTab2 + "_on.gif";
}
/* 플래쉬 Play */
function playflash(fileid, file, width, height, quality)
{
	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" width="'+width+'" height="'+height+'" id="'+fileid+'">');  //플래쉬플레이어 버전이 이전버전일경우 버전 8을 변경
	document.write('<param name="movie" value="'+ file +'">');
	document.write('<param name="quality" value="' + quality + '">');  
	document.write('<param name="WMode" value="Transparent">');
	document.write('<param name="allowScriptAccess" value="always" >');
	document.write('<param name="base" value=".">');
	document.write('<param name="menu" value="false">');
	document.write('<embed base="." src="' + file + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="'+fileid+'" width="'+width+'" height="'+height+'">');
	document.write('</embed>');
	document.write('</object>')
}

function popupLogin()
{
	var window_name;


	if (plogin != null)
	{
	   if (!plogin.closed)	plogin.close();
	}
	plogin = window.open("/pmember/Memb_Login.aspx", "plogin", "width=456, height=341, left=0, top=0");

	if (plogin == null)	alert("차단된 팝업창을 허용해 주십시오.");

	plogin.focus();
				
}

/**  
 * 사용법 : 아이프레임에 해당 하는 페이지 에서    
 * function onWindowLoad(){  
 * IframeControl.doParentReSize("아이프레임 ID");  
 * }  
 * window.onload = onWindowLoad;  
 */
var IframeControl = {
	Browser: {
		IE: !!(window.attachEvent && !window.opera),
		Opera: !!window.opera,
		WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
		Gecko: navigator.userAgent.indexOf('Gecko') > -1
                     && navigator.userAgent.indexOf('KHTML') == -1
	},

	doParentReSize: function(id, siz) {
		var tmpFrame = parent.document.getElementById(id);
		var tmpHeight;

		tmpHeight = document.body.scrollHeight;
		
		if(siz == null || siz == 0)	siz = 900;
		if(tmpHeight < siz) tmpHeight = siz;

		if (this.Browser.IE) {
			tmpFrame.style.height = tmpHeight + "px";
		} else if (this.Browser.Gecko) {
		tmpFrame.style.height = (tmpHeight + 20) + "px";
		}
	}
} 

function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}


function show()
 {
  try{
   Layer1.style.visibility = "visible";
  } catch(x) {}
 }
 /* 시장지수 레이어 숨기기 */
 function hide() {
  try{
    Layer1.style.visibility = "hidden";
  } catch(x) {}
 }