// ¸¶¿ì½º ¿À¹ö&¾Æ¿ô //
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// ·¹ÀÌ¾î //
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



//¸µÅ© ¾ø¾Ö±â
function allblur() {
    var num=document.links.length;
    for (var i = 0; i < num; i++){
        document.links[i].blur();
    }
}
document.onfocusin = allblur;


// ÆË¾÷Ã¢ ¶ç¿ì±â
function popWin(url,winname,wwidth,wheight, scrollbar) {
	var conWidth = wwidth; conHeight = wheight;

	if(wwidth == null && wheight == null) {
		conWidth = 100;
		wHeight = 150;
	}
	conWidth = (screen.Width) / 2 - conWidth;
	conHeight = (screen.Height) / 2 - conHeight;
	focusWin= window.open(url,winname,'left=10' + ',top=10' + ',width=' + wwidth + ',height=' + wheight + ',scrollbars=' + scrollbar + ',resizable=no');
	focusWin.focus();
}


//·¹ÀÌ¾î ShowHide
var onoff=0;
var re_num=0;
function Pub(num,Maxnum){
	if(re_num==num && onoff==0){
		document.all("layer" + num).style.display = 'none';
		onoff=1;
	}
	else{
		for(i=1; i <= Maxnum; i++){
			document.all("layer" + i).style.display = 'none';
		}
	document.all("layer" + num).style.display = 'block';
	onoff=0
	re_num=num;
	}
}


//ÇÁ·¹ÀÓ±¸Á¶ ¼­ºêÆäÀÌÁö ¸µÅ©
// idx ¹øÈ£(1depth)¿¡ µû¸¥ ¸Þ´º
// 0:HOME 1:ÁÖ½Ä/¼±¹°/¿É¼Ç, 2:¸®¼­Ä¡, 3:±ÝÀ¶»óÇ°, 4:ÀÚ»ê°ü¸®, 5:±â¾÷±ÝÀ¶, 6:³ªÀÇ ¿Â¶óÀÎÁöÁ¡, 7:Login/IDµî·Ï, 11:ez-yestrader, 12:ez-mobile, 13:Áß±¹Áõ½Ã, 14:°í°´¼¾ÅÍ, 15:¾ÆÄ«µ¥¹Ì, 16:È¸»ç¼Ò°³, 7:ENGLISH
// ltype ¹øÈ£ => 0 : frameset(default), 1 : no frame, 2 : popup
function goMURL(idx, idy, gURL, ltype)
{
    if (ltype == null || ltype == "undefined") ltype = 0;
    switch (ltype)
    {
        case 0 :
            top.location.href = '/common/inc/frame.jsp?tm='+idx+'&ts='+idy+'&cpage='+gURL;
            break;
        case 1 :
            top.location.href = gURL;
            break;
        case 2 :
            window.open(gURL,'','');
            break;
    }
}

function goMURL2(idx, idy, gURL, ltype)
{
    if (ltype == null || ltype == "undefined") ltype = 0;
    top.menuIdx1 = idx;
    //alert(ltype);
    top.menuIdx2 = idy;
    //alert(top.frm_menu.menuIdx2);
    top.frm_menu.initNavi();
    
    switch (ltype)
    {
        case 0 : //xecure ¹ÌÀû¿ë
            window.location.href = gURL;
            break;
        case 1 : //xecure Àû¿ë
            //window.location.href = OpenXecureUrl(gURL,, "_self");
            OpenXecureUrl(gURL, "_self");
            break;
    }
}

//ÇÁ·¹ÀÓ±¸Á¶ ¼­ºêÆäÀÌÁö ¸µÅ©(È¸»ç¼Ò°³)
// 0:È¸»ç¼Ò°³HOME 1:ÁÖ½Ä/¼±¹°/¿É¼Ç, 2:¸®¼­Ä¡, 3:±ÝÀ¶»óÇ°, 4:ÀÚ»ê°ü¸®, 5:±â¾÷±ÝÀ¶, 6:³ªÀÇ ¿Â¶óÀÎÁöÁ¡
function goHURL(idx, idy, gURL, ltype)
{
    if (ltype == null || ltype == "undefined") ltype = 0;
    switch (ltype)
    {
        case 0 :
            top.location.href = '/common/inc/frame.jsp?tm='+idx+'&ts='+idy+'&cpage='+gURL;
            break;
        case 1 :
            top.location.href = gURL;
            break;
        case 2 :
            window.open(gURL,'','');
            break;
    }
}



//ÆäÀÌÁö ÀüÈ¯
function drawFrames(tmPage,tsPage,mPage)
{
    var strFrame = "";

    if (tmPage == "") tmPage = 0; //top main ÃÊ±â°ªÁöÁ¤
    if (tsPage == "") tsPage = 0; //top sub ÃÊ±â°ªÁöÁ¤
    if (mPage == "") mPage = "about:blank";
    strFrame += "<frameset rows=\"125,*\" frameborder=\"no\" border=\"0\" framespacing=\"0\">";
    strFrame += "<frame src=\"/common/inc/top.jsp?tm=" + tmPage + "&ts=" + tsPage + "\" name=\"top\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" noresize>";
    strFrame += "<frame src=\"" + mPage + "\" name=\"main\" scrolling=\"auto\" marginheight=\"0\" marginwidth=\"0\">";
    strFrame += "</frameset>";

    document.write(strFrame);
}

//ÆäÀÌÁö ÀüÈ¯(È¸»ç¼Ò°³)
function drawHFrames(tmPage,tsPage,mPage)
{
    var strFrame = "";

    if (tmPage == "") tmPage = 0; //top main ÃÊ±â°ªÁöÁ¤
    if (tsPage == "") tsPage = 0; //top sub ÃÊ±â°ªÁöÁ¤
    if (mPage == "") mPage = "about:blank";
    strFrame += "<frameset rows=\"125,*\" frameborder=\"no\" border=\"0\" framespacing=\"0\">";
    strFrame += "<frame src=\"/common/inc/top.jsp?tm=" + tmPage + "&ts=" + tsPage + "\" name=\"top\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" noresize>";
    strFrame += "<frame src=\"" + mPage + "\" name=\"main\" scrolling=\"auto\" marginheight=\"0\" marginwidth=\"0\">";
    strFrame += "</frameset>";

    document.write(strFrame);
}



//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷
function srchCode(job)
{

		var s_url = '/common/inc/pop_srchcode.jsp';
		
		if (job=='rtf')
		{
			job = 'rtf';
		}
		else if (job=='kosdaq')
		{
			job = 'kosdaq';
		}
		else if (job=='kospi')
		{
			job = 'kospi';
		}		
		else{
			job = 'juka';
		}		
		s_url += '?job='+job;
		
    window.open(s_url,'code','width=320,height=400,resizable=no,scrollbars=0');
}

//·¹ÇÁÆ® Á¾¸ñÄÚµå °Ë»ö ÆË¾÷
function srchCode2(job)
{	
		var s_url = '/common/inc/pop_left_srchcode.jsp';
		
		if (job=='rtf')
		{
			job = 'rtf';
		}
		else{
			job = 'juka';
		}
		
		
		s_url += '?job='+job;
    window.open(s_url,'code','width=320,height=400,resizable=no,scrollbars=0');
}

//¿µ¹® Á¾¸ñÄÚµå °Ë»ö ÆË¾÷
function srchECode()
{
    window.open('/common/inc/pop_srchEcode.jsp','code','width=320,height=410,resizable=no,scrollbars=0');
}
function srchECodeN()
{
    window.open('/common/inc/n_pop_srchEcode.jsp','code','width=320,height=410,resizable=no,scrollbars=0');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷( KOSPI/KOSDAQ ¼±¹°¿É¼Ç)
function srchFOCode()
{
    window.open('/common/inc/pop_srchFOcode.jsp','FOcode','width=320,height=400,resizable=no,scrollbars=0');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷( KOSPI ¼±¹°¿É¼Ç)
function srchJFOCode()
{
    window.open('/common/inc/pop_srchJFOcode.jsp','JFOcode','width=320,height=400,resizable=no,scrollbars=0');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷( KOSPI ¼±¹°¿É¼Ç)
function srchJFSCode()
{
    window.open('/common/inc/pop_srchJFScode.jsp','JFScode','width=320,height=400,resizable=no,scrollbars=0');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷( KOSDAQ¼±¹°¿É¼Ç)
function srchKFOCode()
{
    window.open('/common/inc/pop_srchKFOcode.jsp','KFOcode','width=320,height=400,resizable=no,scrollbars=0');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷(KOSDAQÁÖ½Ä¿É¼Ç)
function srchZOCode()
{
    window.open('/common/inc/pop_srchZOcode.jsp','KFOcode','width=320,height=400,resizable=no,scrollbars=0');
}

//°ü½ÉÁ¾¸ñ °Ë»ö/µî·Ï ÆË¾÷
function srchFVRCode()
{
    window.open('/common/inc/pop_srchFVRcode.html','FVRcode','width=630,height=450,resizable=no,scrollbars=0');
}

//°ü½ÉÆÝµå °Ë»ö/µî·Ï ÆË¾÷
function srchFVRFund()
{
    window.open('/common/inc/pop_srchFVRfund.html','FVRfund','width=630,height=450,resizable=no,scrollbars=0');
}


//¿ìÆí¹øÈ£ Ã£±â ÆË¾÷
function srchZip()
{
    window.open('/idreg/pop_zip_srch.htm','zip','width=400,height=468,resizable=no,scrollbars=0');
//    window.showModalDialog('/idreg/pop_zip_srch.html','zip','dialogWidth:400px;dialogHeight:468px;center:yes;help:no;resizable:no;status:no;unadorned:no;dialogHide:no;scroll:no;');
}


//¿ìÆí¹°¼ö·ÉÁö È®ÀÎ ÆË¾÷
function mailAddr()
{
    window.open('/idreg/pop_mailaddr.htm','addr','width=600,height=500,resizable=no,scrollbars=0');
}


//IDÁßº¹È®ÀÎ ÆË¾÷
function checkID()
{
    window.open('/idreg/pop_id_overlap.htm','id','width=310,height=200,resizable=no,scrollbars=0');
//    window.showModalDialog('/idreg/pop_zip_srch.html','zip','dialogWidth:400px;dialogHeight:420px;center:yes;help:no;resizable:no;status:no;unadorned:no;dialogHide:no;scroll:no;');
}


//Áõ½ÃÄ¶¸°´õ_ÀÏÁ¤»ó¼¼º¸±â ÆË¾÷
function stcalView()
{
    window.open('/biz/ipo/pop_stockcalendar_detail.htm','stcalview','width=400,height=300,resizable=no,scrollbars=1');
}


//pdf¹®¼­ ±ÛÀÐ±â ÆË¾÷
function pdfOpen()
{
    window.open('/research/board/pop_pdf_read.htm','pdf','width=750,height=610,resizable=no,scrollbars=0');
}


//½ÃÈ²&°ø½Ã&´º½º ±ÛÀÐ±â ÆË¾÷(ÁÖ½Ä¼±¹°¿É¼Ç>´º½º/°ø½Ã)
function newsOpen()
{
    window.open('/wts/analysis/pop_news_read.htm','news','width=600,height=450,resizable=no,scrollbars=0');
}


//°Ô½ÃÆÇ±Û ÀÐ±âÃ¢(¸®¼­Ä¡>´Ü±âÆ÷Æ®Æú¸®¿À) ¶ç¿ì±â
function portOpen()
{
    window.open('/research/board/rch_info_port_read.htm','port','width=750,height=400,resizable=no,scrollbars=0');
}


//´Þ·Â ³¯Â¥°Ë»ö ÆË¾÷
function openCal()
{
    window.open('/common/inc/pop_calendar.html','calendar','width=160,height=165,resizable=no,scrollbars=0');
}


//Áõ±Ç¿ë¾î»çÀü ÆË¾÷
function openDic()
{
    window.open('/common/inc/pop_dic.jsp','dic','width=650,height=420,resizable=no,scrollbars=0');
}


//Áõ±Ç°è»ê±â ÆË¾÷
function openCalcul()
{
    window.open('/common/inc/pop_calculator.html','calcul','width=400,height=360,resizable=no,scrollbars=0');
}


//eznet star ÆË¾÷
function eznetStar()
{
    window.open('/eznetstar/sto_main.htm','eznetstar','width=1017,height=714,top=0,left=0,resizable=no,scrollbars=0');
}


//ÀüÁ¾¸ñÀü±¤ÆÇ ÆË¾÷
function totalBrd()
{ 
//    window.open('/common/inc/pop_totalboard.jsp','total','width=940,height=638,resizable=no,scrollbars=0');
    window.open('/wts/common/panel/scorepanel.html','total','width=920,height=638,resizable=no,scrollbars=1');
}


//±â¾÷ºÐ¼®Á¤º¸(KIS) ÆË¾÷
function compayInfo(jcode)
{
    //var url = 'http://www.koreastock.co.kr/research/kis/html/'+input.jcode.value+'_1.htm';
    var url = '/common/inc/pop_hts.jsp?jcode='+jcode;
    window.open(url,'company_info','width=750,height=650,resizable=no,scrollbars=no');
    //eopen(url,690,650,'yes');
}

function hanwhaOpen()
{
	window.open("/hanwha/ethics/report.jsp");
}

//±â¾÷Á¤º¸(HTS) ÆË¾÷
function compayInfoHTS() 
{
		  var url = '/common/inc/pop_hts.jsp?jcode='+input.jcode.value;
    	eopen(url,660,650,'yes');
}
//±â¾÷±ÝÀ¶ Q&A ÆË¾÷
function openBizQna()
{
    window.open('/biz/pop_qna_list.htm','qna','width=617,height=540,resizable=no,scrollbars=1');
}


//±â¾÷±ÝÀ¶ »ó´ã ÆË¾÷
function openBizCon()
{
    window.open('/biz/pop_consult.htm','consult','width=617,height=610,resizable=no,scrollbars=1');
}


//Æ®·¹ÀÌµùµµ±¸°¡ÀÌµå
function openGuide(idx)
{
    window.open("/img/flash/guide_tour.swf?movieNum="+idx+"&subMovieNum=1","guide","width=780,height=519,top=0,left=0,resizable=no,scrollbars=0");
}


//½ºÅ©·¦ Æú´õ°ü¸® ÆË¾÷ ¶ç¿ì±â
/*function openScrap()
{
    window.open('/myonline/service/pop_scrap_admin.htm','scrap','width=420,height=250,resizable=no,scrollbars=0');
}
*/

// ÁÂÃø ¹è³Ê
function drawBanner() {

// Á¾¸ñÄÚµå °Ë»ö ¹è³Ê
document.write("<table cellpadding=0 cellspacing=0 width='190' class='ban_srch'>");
//document.write("<form name='jongSearch' method='post' action='/wts/stock/sise.jsp'>");
document.write("<tr><td><img src='/img/banner/tle_ban_stock.gif'></td></tr>");
document.write("<tr><th>");
document.write("<input type='text' name='jcode' size='17'>&nbsp;<a href='javascript:jongSubmit();'><img src='/img/banner/btn_go.gif' align='absmiddle'></a>&nbsp;<a href='javascript:srchCode();'><img src='/img/banner/btn_zoom_srch.gif' align='absmiddle'></a>");
document.write("</th></tr>");
//document.write("</form>");
document.write("</table>");

// ¹è³Ê01
document.write("<table cellpadding=0 cellspacing=0 width='190'>");
document.write("<tr><td height='5'></td></tr>");
document.write("<tr><td><a href='#'><img src='/img/banner/ban_01.gif'></a></td></tr>");
document.write("</table>");

// ¹è³Ê02
document.write("<table cellpadding=0 cellspacing=0 width='190'>");
document.write("<tr><td height='5'></td></tr>");
document.write("<tr><td><a href='/center/channel/wts_1.htm'><img src='/img/banner/l_eznetstar.gif'></a></td></tr>");
//document.write("<tr><td><a href='#'><img src='/img/banner/l_eznetspeed.gif'></a></td></tr>");
document.write("<tr><td><a href='/FAQBoardServlet/center/board/faq/list.jsp?cmd=faqList&vc_bid=faq&mode=center'><img src='/img/banner/l_faq.gif'></a></td></tr>");
document.write("<tr><td height='25'></td></tr>");
document.write("</table>");
}



// ¸¶¿ì½º Æ÷ÀÎÅÍ ¼Õ°¡¶ô Ç¥½Ã
var isCursor = ( navigator.appVersion.toString().indexOf("MSIE 6") >= 0 );

function setCursor ( isHead ) {
    obj = event.srcElement;
    if ( isCursor ) {
        if ( isHead ) obj.style.cursor ='hand';
        else obj.style.cursor ='normal';
    }
}


// ÅÇ°ü·Ã iframe Ã³¸®
function _tab ( tname, url, selectedClass, defaultClass, hasSub )
{
    this._id			= tname;
    this._location		= url;
    this._sClass		= selectedClass;
    this._dClass		= defaultClass;
    this._hasSub		= hasSub;
}
function _tabMenu ( tabTB, noSub, hasSub  )
{
    this._tabTBL		= tabTB;
    this.hasSub			= hasSub;
    this.noSub			= noSub;
    this.currentIdx		= 0;
    this.listTab		= new Array();
}
_tabMenu.prototype.add = function ( t )
{
    this.listTab[this.listTab.length]	= t;
}
function tabOnClick ( tabOBJ , mIdx , tabPanel )
{
    if ( tabOBJ.currentIdx != mIdx ) {
        for ( i=0 ; i < tabOBJ.listTab.length ; i++ )
        {
            var	tOBJ	= tabOBJ.listTab[i];
            var	tdOBJ	= document.getElementById ( tOBJ._id );
            if ( tdOBJ != null  ) {
                tdOBJ.className = ( i == mIdx ) ? tOBJ._sClass : ( tOBJ._dClass == null ) ? '' : tOBJ._dClass;
                if ( i == mIdx )
                {
                    _loc = tOBJ._location;
                    var		tt	= document.getElementById ( tabOBJ._tabTBL );
                    if ( tOBJ._hasSub )	tt.className = tabOBJ.hasSub;
                    else				tt.className = tabOBJ.noSub;
                }
            }

        }
		var __sessionKey = '';
		try
		{
			__sessionKey = getSessionKey();
		} catch ( e )
		{}
        if ( _loc != '' )
        {
			if ( __sessionKey == '' )
			{
				tabPanel.location = _loc;
			} else
			{
				OpenXecureUrl( _loc , tabPanel.name );
			}
            //tabPanel.location = _loc + ( (__sessionKey.length > 0) ? ( '?q=' + __sessionKey ) :'');
            tabOBJ.currentIdx = mIdx;
        }
    }
}
function tabOnClick1 ( tabOBJ , mIdx , tabPanel )
{
    if ( tabOBJ.currentIdx != mIdx ) {
        for ( i=0 ; i < tabOBJ.listTab.length ; i++ )
        {
            var	tOBJ	= tabOBJ.listTab[i];
            var	tdOBJ	= document.getElementById ( tOBJ._id );
            if ( tdOBJ != null  ) {
                tdOBJ.className = ( i == mIdx ) ? tOBJ._sClass : ( tOBJ._dClass == null ) ? '' : tOBJ._dClass;
                if ( i == mIdx )
                {
                    _loc = tOBJ._location;
                    var		tt	= document.getElementById ( tabOBJ._tabTBL );
                    if ( tOBJ._hasSub )	tt.className = tabOBJ.hasSub;
                    else				tt.className = tabOBJ.noSub;
                }
            }

        }
		var __sessionKey = '';
		try
		{
			__sessionKey = getSessionKey();
		} catch ( e )
		{}
        if ( _loc != '' )
        {
            tabPanel.location = _loc + ( (__sessionKey.length > 0) ? ( '&q=' + __sessionKey ) :'');
            tabOBJ.currentIdx = mIdx;
        }
    }
}
function tabOnClick2 ( tabOBJ , mIdx , tabPanel )
{
    if ( tabOBJ.currentIdx != mIdx ) {
        for ( i=0 ; i < tabOBJ.listTab.length ; i++ )
        {
            var	tOBJ	= tabOBJ.listTab[i];
            var	tdOBJ	= document.getElementById ( tOBJ._id );
            if ( tdOBJ != null  ) {
                tdOBJ.className = ( i == mIdx ) ? tOBJ._sClass : ( tOBJ._dClass == null ) ? '' : tOBJ._dClass;
                if ( i == mIdx )
                {
                    _loc = tOBJ._location;
                    var		tt	= document.getElementById ( tabOBJ._tabTBL );
                    if ( tOBJ._hasSub )	tt.className = tabOBJ.hasSub;
                    else				tt.className = tabOBJ.noSub;
                }
            }

        }
		var __sessionKey = '';
		try
		{
			__sessionKey = getSessionKey();
		} catch ( e )
		{}
        if ( _loc != '' )
        {
        	//alert(_loc);
            tabPanel.location = _loc;
            tabOBJ.currentIdx = mIdx;
        }
    }
}
function tabOnLoad ()
{
    try
    {
        var	frmOBJ		= event.srcElement;
        eval ( 'var	bdyOBJ		= ' + frmOBJ.name + '.document.body' );
        var	ifrmHeight	= bdyOBJ.scrollHeight + ( bdyOBJ.offsetHeight - bdyOBJ.clientHeight ) + 50;
        if ( ifrmHeight > 300 )		frmOBJ.style.height	= ifrmHeight;
        else						frmOBJ.style.height	= 300;
    } catch ( e )
    {
        alert('11'+e);
    }
    try
    {
        var	mx		= document.all.length;
        var	_objArr	= new Array();
        var	_valArr	= new Array();
        for ( _i=0 ; _i < mx ; _i++ )
        {
            if ( typeof( document.all[_i].style.getExpression("minHeight") ) != 'undefined' )
            {
                _objArr[_objArr.length] = document.all[_i];
                _valArr[_valArr.length]	= document.all[_i].style.getExpression("minHeight");
                document.all[_i].style.setExpression("minHeight", "10");
            }
        }
        document.recalc(true);
        for ( _i=0 ; _i < _objArr.length ; _i++ )
        {
            _objArr[_i].style.setExpression ("minHeight", _valArr[_i] );
        }
        document.recalc(true);
    } catch ( e )
    {
        alert('22'+e);
    }
}

function AX_Write( content )
{
	document.write ( content );
}
