/**** Utils 2008/12/21 ************/

function makeWindowed(p_div) {
    var is_ie6 = document.all
            && (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1);
    if (is_ie6) {

        var html = "<iframe style=\"position: absolute; display: block; "
                + "z-index: -1; width: 100%; height: 100%; top: 0; left: 0;"
                + "filter: mask(); background-color: #ffffff; \"></iframe>";
        if (p_div)
            p_div.innerHTML += html;
        // force refresh of div
        var olddisplay = p_div.style.display;
        p_div.style.display = 'none';
        p_div.style.display = olddisplay;
    }
}


// return Flash Object Tag
function getFlashObjectTag(flashSrc, flashWidth, flashHeight, etcParam , flashId) {
    var tag = "";
    var baseFlashDir="";
    flashSrc = baseFlashDir + flashSrc;

    if ( etcParam != "" || etcParam != null ) {
        if ( etcParam.substr(0, 1) == "?" )
            flashSrc += etcParam;
        else
            flashSrc += "?" + etcParam;
    }
    tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
    tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.42.34\" ";
    tag += " allowScriptAccess=\"always\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" id=\""+flashId+"\">";
    tag += "<param name=\"allowScriptAccess\" value=\"always\">";
    tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
    tag += "<param name=\"flashVars\" value=\"" + etcParam + "\">";
    tag += "<param name=\"menu\" value=\"false\">";
    tag += "<param name=\"quality\" value=\"high\">";
    tag += "<param name=\"wmode\" value=\"transparent\">";
    tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
    tag += "type=\"application/x-shockwave-flash\" name=\""+name+"\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" ";
    tag += "wmode=\"transparent\"></embed>";
    tag += "</object>";
    return tag;
}
function getFlashObjectTagExt(flashSrc, flashWidth, flashHeight, etcParam , flashId, flashWmode) {
    var tag = "";
    var baseFlashDir="";
    flashSrc = baseFlashDir + flashSrc;

    if ( etcParam != "" || etcParam != null ) {
        if ( etcParam.substr(0, 1) == "?" )
            flashSrc += etcParam;
        else
            flashSrc += "?" + etcParam;
    }
    tag += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";
    tag += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.42.34\" ";
    tag += " allowScriptAccess=\"always\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" id=\""+flashId+"\">";
    tag += "<param name=\"allowScriptAccess\" value=\"always\">";
    tag += "<param name=\"movie\" value=\"" + flashSrc + "\">";
    tag += "<param name=\"flashVars\" value=\"" + etcParam + "\">";
    tag += "<param name=\"menu\" value=\"false\">";
    tag += "<param name=\"quality\" value=\"high\">";
    tag += "<param name=\"wmode\" value=\"" + flashWmode + "\">";
    tag += "<embed src=\"" + flashSrc + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ";
    tag += "type=\"application/x-shockwave-flash\" name=\""+name+"\" width=\"" + flashWidth + "\" height=\"" + flashHeight + "\" ";
    tag += "wmode=\"transparent\"></embed>";
    tag += "</object>";
    return tag;
}



function getObject(objName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[objName];
    } else {
        return document[objName];
    }
}

function addCommas( strValue ){
    var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
    while(objRegExp.test(strValue)) {
        strValue = strValue.replace(objRegExp, '$1,$2');
    }
    return strValue;
}

function fixRate(str) {
    str = str.replace(/^\s+|\s+$/g,"");
    try {
        if(str == null) return "";
        if(str.substring(0,1)==".") str = "0" + str;
        else if(str.substring(0,2)=="-.") str = "-0." + str.substring(2);
    } catch(e) {
        alert(e.message);
    }
    return str;
}

function xmlToDataSet(pXml) {
    var xmlDoc = createXMLFromString(pXml);
    var resultNodes = xmlDoc.getElementsByTagName("result");
    var resultNode = resultNodes.item(0);
    var dataNodes = resultNode.childNodes;

    var dataSet = new DataSet();
    if (dataNodes) {
        for ( var i = 0; i < dataNodes.length; i++) {
            var dataNode = dataNodes.item(i);
            if (dataNode.nodeType != dataNode.TEXT_NODE) {
                var childNodes = dataNode.childNodes;
                for ( var j = 0; j < childNodes.length; j++) {
                    var childNode = childNodes.item(j);
                    var nodeName = "";
                    var nodeValue = "";
                    try {
                        nodeName = childNode.nodeName
                        nodeValue = childNode.firstChild.nodeValue
                        // text = text + "\nnodeName=" + nodeName + ",
                        // nodeValue" + nodeValue ;
                    } catch (e) {
                        nodeName = childNode.nodeName
                        nodeValue = "";
                        // text = text + "\nnodeName=" + nodeName;

                    } finally {
                        dataSet.put(nodeName, nodeValue);
                    }
                }
            }
        }
    }
    return dataSet;
}

function getStringFromElement(elem) {
    var strOut = "";
    if (elem) {
        if (elem.childNodes) {
            for ( var i = 0; i < elem.childNodes.length; i++) {
                var child = elem.childNodes[i];
                var nodeName = "";
                var nodeValue = "";
                if (child.nodeValue) {
                    nodeName = elem.nodeName;
                    nodeValue = child.nodeValue;
                    strOut += "<" + nodeName + ">" + nodeValue + "</"
                            + nodeName + ">";
                } else {
                    if (child.childNodes) {
                        if (child.childNodes[0].nodeValue) {
                            var nodeName = child.nodeName;
                            var nodeValue = child.childNodes[0].nodeValue;
                            strOut += "<" + nodeName + ">" + nodeValue + "</"
                                    + nodeName + ">";
                        }
                    }
                }
            }
        }
    }
    return strOut;
}

function createXMLFromString(string) {
    var xmlDocument;
    var xmlParser;
    if (window.ActiveXObject) { // IEÀÏ °æ¿ì
        xmlDocument = new ActiveXObject('Microsoft.XMLDOM');
        xmlDocument.async = false;
        xmlDocument.loadXML(string);
    } else if (window.XMLHttpRequest) { // Firefox, NetscapeÀÏ °æ¿ì
        xmlParser = new DOMParser();
        xmlDocument = xmlParser.parseFromString(string, 'text/xml');
    } else {
        return null;
    }
    return xmlDocument;
}
/*****************************************/


// ¸¶¿ì½º ¿À¹ö&¾Æ¿ô //
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');
}

//Á¾¸ñÄÚµå °Ë»ö ÆË¾÷( 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('/wts/common/panel/scorepanel.html','total','width=920,height=638,resizable=no,scrollbars=1');
}



//ÁÖ½Ä ºÐ¼® ¸®Æ÷Æ®
function analysisreport()
{
	window.open("/research/board/poplist.jsp?jcode="+getCookie("jcode"),'analysisreport','width=500,height=400');
}


//±â¾÷ºÐ¼®Á¤º¸(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=680,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 );
}





 var baseScript = true;

function selectedBox(name, val)
{
//	alert("test : " + typeof(name));
//	alert(val);
	var selectedIndexNum = 0;
	if (typeof(name) == 'undefined') return false;
	for (i=0; i<name.length; i++)
	{
		if (name.options[i].value == val )
			selectedIndexNum = i;
	}
	name.selectedIndex = selectedIndexNum;
	//alert("end");
}

function checkedBox(obj, val)
{
    //alert(obj.length);
    if(obj.length ==null)
    {
        if(obj.value == val)
            obj.checked = true;

        return;
    }

	for (i=0; i<obj.length; i++)
	{
		//alert(obj[i].value);
		//alert(val);
		if (obj[i].value == val)
		{
	 		obj[i].checked = true;
	 		return;
        }
	}
}

/**********Radio ¹öÆ° Value get*************/
function getRadioCheckedValue( _oRadio) {
    for( var i = 0 ; i< _oRadio.length ; i++)
    {
      if( _oRadio[i].checked == true)	{
        return true;
      }
    }
	return false;
}

function getRadioValue(obj)
{
	if(obj == undefined || obj == null || obj == "") return '';

    for (i=0; i<obj.length; i++)
	{
	    if(obj[i].checked == true)
	        return obj[i].value;
	}
	return '';
}


function setRadioValue(obj, value)
{
	if(obj == undefined || obj == null || obj == "") return false;

    for (i=0; i<obj.length; i++)
	{
	    if(obj[i].value == value)
		{
			obj[i].checked = true;
	        return true;
		}
	}
	return false;
}

var COLOR1 = '#3787A8';
var COLOR2 = '#CDCDCD';
var COLOR3 = '#999999';
var IMG1='/tsn/img/arrow_down_white.gif';
var IMG2='/tsn/img/arrow_right_black.gif';


function getShowLayerNum(id)
{
    var tmp=null;

    for(i=0;i<10;i++)
    {
        layer = document.all[id+'_'+i];
        if(layer==null) {

            if(tmp!=null)
            {
                //alert(id+'_0');
                tmp.style.visibility = 'visible' ;
                return 0;
            }
            return -1;
        }

        if(i==0)
            tmp = layer;

        if(layer.style.visibility != 'hidden')
            return i;
    }

    return -1;
}



// layer¸¦ ÀÚµ¿À¸·Î ¼±ÅÃÇØÁÜ
function chgLayer(id, num)
{
    if(num<0) return false;
    table = document.all[id];

    row1 = table.rows[0];
    row2 = table.rows[1];

    idx = num*2 +1;
    layerId=0;
    for(i=1;i<row2.cells.length-1;i+=2)
    {
        layer = document.all[id+'_'+layerId];
        img = document.all['img_'+id+'_'+layerId];

        if(i==idx)
        {
            //alert(i+"="+id+"_"+layerId);
            row1.cells[i-1].bgColor=COLOR1;
            row1.cells[i].bgColor=COLOR1;
            row1.cells[i+1].bgColor=COLOR1;

            row2.cells[i-1].bgColor=COLOR1;
            row2.cells[i].bgColor=COLOR1;
            row2.cells[i+1].bgColor=COLOR1;

            if(img!=null)
                img.src = IMG1;

            if( 'wts_white' == row2.cells[i].className )
                return false;

            row2.cells[i].className='wts_white';

            if(layer!=null) {
                layer.style.visibility='visible';

                if(typeof(layer.style.display)!='undefined')
                    layer.style.display='';
            }
        }
        else
        {
            //alert(i+"=="+id+"_"+layerId);

            row1.cells[i-1].bgColor=COLOR3;
            row1.cells[i].bgColor=COLOR3;
            row1.cells[i+1].bgColor=COLOR3;

            row2.cells[i-1].bgColor=COLOR3;
            row2.cells[i].bgColor=COLOR2;
            row2.cells[i+1].bgColor=COLOR3;

            row2.cells[i].className='wts';

            if(img!=null)
                img.src = IMG2;


            if(layer!=null)
                layer.style.visibility='hidden';


        }
        ++layerId;
    }
    return true;
}


function UpDown2(val) {

    document.write("<img src='/img/debi/"+val+".gif' align=left valign=middle hspace=4>");
}

//°¡°Ýµî¶ô Ç¥½Ã È­»ìÇ¥¸¦ Âï¾îÁÖ´Â ÇÔ¼ö
function UpDown(val) {
    var tgt;
    var col="";
	var mystr;
	var flagCheck = 0;
	if (typeof(val) == 'number') {
		if        ( val == 1 ) {		tgt = "up2";		col="red";  //±â¼¼»óÇÑ
		} else if ( val == 2 ) {		tgt = "up1";			col="red";  //½Ã¼¼»ó½Â
		} else if ( val == 7 ) {		tgt = "up2";		col="red";  //»óÇÑ
		} else if ( val == 6 ) {		tgt = "up1";			col="red";  //»ó½Â
		} else if ( val == 5 ) {		mystr = "&nbsp;";	col="black";  //º¸ÇÕ
		} else if ( val == 3 ) {		tgt = "down2";	col="blue";  //ÇÏÇÑ
		} else if ( val == 4 ) {		tgt = "down1";		col="blue";  //ÇÏ¶ô
		} else if ( val == 8 ) {		tgt = "down2";	col="blue";  //±â¼¼ÇÏÇÑ
		} else if ( val == 9 ) {		tgt = "down1";		col="blue";  //±â¼¼ÇÏ¶ô
		} else                 {
			mystr = "&nbsp;";	//Unknown
			flagCheck = 1;
		}
	} else {
		mystr = "&nbsp;";
		flagCheck = 1;
	}

	if (flagCheck == 0) {
		if((val != 5) && (val != 0) && (val != "&nbsp; "))
			//mystr = "<img src=/hvimg/button/arrow_" + tgt + ".gif  width=7 height=4 align=absmiddle hspace=4>";  //y2on-8/25
			//mystr = "<img src=/hvimg/button/arrow_" + tgt + ".gif  width=7 height=4 align=left hspace=4>";  //y2on-8/25
			//img/common/ico_down1.gif
			//mystr = "<img src=/hvimg/wts/" + tgt + ".gif  width=11 align=left hspace=4>";  //y2on-8/25
			mystr = "<img src=/img/common/ico_" + tgt + ".gif  valign=bottom align=left vspace=0 hspace=0>";
	}

	//return mystr;

	document.write(mystr);
	document.write("<font color='"+col+"'>");
}

function enterCheck(formObj) {
    if(event.keyCode == 13) {
        formCheck(formObj);
    }

}

function formCheck(obj) {

    if(!formBaseCheck(obj))
	{
        return false;
	}


    obj.method = 'post';
	obj.submit();
}

function formCheckX(obj) {

    if(!formBaseCheck(obj))
	{
        return false;
	}

    return XecureSubmit(obj);
}

// ÀÎÁõ¼­·Î Ã¼Å©
function formCheckPki(obj) {
    //alert("test1");
    if(!formBaseCheck(obj))
	{
		if ( typeof(document.all.prgrss) != 'undefined' )						clearBusyStatus() ;
		if ( typeof(parent.document.all.prgrss) != 'undefined' )				parent.clearBusyStatus() ;
		if ( typeof(parent.parent.document.all.prgrss) != 'undefined' )			parent.parent.clearBusyStatus() ;
		if ( typeof(parent.parent.parent.document.all.prgrss) != 'undefined' )	parent.parent.clearBusyStatus() ;
		return false;
	}
    //alert("test2");
    if(!signdata(obj))
	{
		if ( typeof(document.all.prgrss) != 'undefined' )						clearBusyStatus() ;
		if ( typeof(parent.document.all.prgrss) != 'undefined' )				parent.clearBusyStatus() ;
		if ( typeof(parent.parent.document.all.prgrss) != 'undefined' )			parent.parent.clearBusyStatus() ;
		if ( typeof(parent.parent.parent.document.all.prgrss) != 'undefined' )	parent.parent.clearBusyStatus() ;
		return false;
	}

    //alert("test3");
    return XecureSubmit(obj);
    //alert("test4");
}

function formBaseCheck(obj) {
    with (obj) {
		if (typeof(residentN) != 'undefined') {
			if (residentN.value == '' || residentN.value.length != 6) {
				alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä!');
				residentN.focus();
				return false;
			}
		}

		if (typeof(residentN2) != 'undefined') {
			if (residentN2.value == '' || residentN2.value.length != 7) {
				alert('ÁÖ¹Îµî·Ï¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä!');
				residentN2.focus();
				return false;
			}
		}

		if (typeof(account) != 'undefined') {
			if (account.value == '0') {
				alert('°èÁÂ¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä');
				return false;
			}
		}

        if (typeof(pass) != 'undefined') {
			if (pass.value == '' || pass.value.length < 4 || pass.value.length > 8) {
				alert('ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇÏ¼¼¿ä!');
				//pass.focus();
				return false;
			}
			else if(pass.disabled==true)
		        pass.disabled=false;
		}

		if ( typeof(amount) != 'undefined' && typeof(amount.value) != 'undefined' ) {
		    mds = amount.value;
		    if ( mds!='' && ( mds.indexOf(".")>0 || mds <=0) ) {
					alert('¼ö·®Àº 0º¸´Ù Å« ¼ýÀÚ¿©¾ß ÇÕ´Ï´Ù.');
					return false;
			}
		}

		if ( typeof(sdate) != 'undefined' && typeof(sdate.value) != 'undefined' ) {
			if (sdate.value == '') {
				alert('Á¶È¸ÀÏÀÚ¸¦ È®ÀÎÇÏ¼¼¿ä!');
				sdate.focus();
				return false;
			}
		}
	}
	return true;
}





//function compayInfo()
//{
//    var url = '/research/kis/html/'+input.jcode.value+'_1.htm';
//    eopen(url,660,650,'yes');
//}




var DIRS = "/common/inc/";


function popJcodeSrch(name) {

    //name Àº input form ÀÇ ¸í

    if(typeof(name) !=='undefined')
    {
        eopen(DIRS+"pop_srchcode.jsp?"+name, 320,400);
    }else{

        eopen(DIRS+"pop_srchcode.jsp", 320,400);
    }
}

function popJcodeSrchF(name) {
	//star/future only
    //name Àº input form ÀÇ ¸í
    if(typeof(name) !=='undefined')
    {
        eopen(DIRS+"pop_srchcodeF.jsp?job="+name, 320,400);
    }else{
        eopen(DIRS+"pop_srchcodeF.jsp", 320,400);
    }
}

function popJcodeSrchSMS(name) {
    //name Àº input form ÀÇ ¸í
    if(typeof(name) !=='undefined')
        eopen(DIRS+'pop_srchJcodeSMS.jsp?'+name, 320,400);
    else
        eopen(DIRS+'pop_srchJcodeSMS.jsp', 320,400);
}


//Á¾¸ñÄÚµå°Ë»ö±â
//fg=ALL,kospi
function popSrchJCode(fg)
{
	var callURL = "/common/inc/n_pop_srchcode.jsp?fg=" + fg ;
	window.open(callURL,'jcode','width=280,height=420,resizable=no,scrollbars=0');

}


function pop3codeSrch(name) {
    eopen(DIRS+'pop_srch3code.jsp', 320,400);
}


// ECN Á¾¸ñ°Ë»ö
function popECNcodeSrch() {
    eopen(DIRS+'pop_srchECNcode.jsp', 320,400);
}

// KOSPI ¼±¹°¿É¼ÇÄÚµå
function popJFOcodeSrch() {
    eopen(DIRS+'pop_srchJFOcode.jsp', 320,400);
}

// KOSPI ¿É¼ÇÄÚµå
function popJOcodeSrch() {
    eopen(DIRS+'pop_srchJOcode.jsp', 320,400);
}

// KOSDAQ ¿É¼ÇÄÚµå
function popKOcodeSrch() {
    eopen(DIRS+'pop_srchKOcode.jsp', 320,400);
}

// ÄÚ½º´Ú ¼±¹°¿É¼ÇÄÚµå
function popKFOcodeSrch() {
    eopen(DIRS+'pop_srchKFOcode.jsp', 320,400);
}

// ÁÖ½Ä¿É¼ÇÄÚµå
function popZOcodeSrch() {
    eopen(DIRS+'pop_srchZOcode.jsp', 320,400);
}

// ½ÅÁÖÀÎ¼ö±Ç
function popSJcodeSrch() {

    eopen(DIRS+'pop_srchSJcode.jsp', 320,400);
}

// ELW
function popELWcodeSrch() {

    eopen(DIRS+'pop_srchELWcode.jsp', 320,400);
}


// 20090520 È²±âÆò´ë¸®°¡ »õ·Î¸¸µç ELW Á¾¸ñ°Ë»ö±â
function popELWcodeSrchTable() {

    eopen('/common/include/pop_search/pop_srchELWTable.htm', 750,460);
}


// Àå³»Ã¤±Ç
function popBcodeSrch() {
    eopen(DIRS+'pop_srchBcode.jsp', 320,400);
}

// Ã¤±Ç
function popBScodeSrch() {
    eopen(DIRS+'pop_srchBScode.jsp', 320,400);
}

// »óÀå¼öÀÍÁõ±Ç,ÈÄ¼øÀ§Ã¤
function popPcodeSrch() {
    eopen(DIRS+'pop_srchHcode.jsp', 320,400);
}

// °ü½ÉÁ¾¸ñ 630 x 450
function popFavStock(jusikCode) {
    //alert(jusikCode);
    eopen('/wts/common/interest/mgrFavStock.jsp?jongcode='+jusikCode, 630,525);
}

// °ü½ÉÆÝµå 630 x 450
function popFavFund() {
    eopen('/common/inc/pop_srchFVRfund.html', 630,450);
}

function popSpeed(opt, jcode) {
	eopen("/common/ctrl/starter/speedCtrlDownload.jsp?opt=" + opt + "&jcode=" + jcode, 500, 627, "no", "no");
}
var __chartCnt = 0;

// Â÷Æ®ºÐ¼®±â
function popITSChart(opt, jcode) {
	window.open('/star/starter.html?/common/ctrl/starter/chart.jsp?opt=' + opt + '&jcode=' + jcode + '&q=' + getSessionKey(), 'ITSChart','width=820,height=570,menubar=no,scrollbars=no,resizable=no,toolbar=no,status=no');
}




//´º½º/°ø½Ã
function newsNnotice(jcode)
{
	location.href = "/wts/analysis/news.jsp?jcode="+jcode;
}



function eopenEtc(url,wt,ht,scrl){
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,'', "width=" + wt + ",height=" + ht + ",scrollbars=" + scrl + ",status=no,left=0,top=0");
}

function starOpen(gubun)
{

	if ( gubun == null ) gubun = "jusik";
	if ( gubun == "jusik" )
		eopenEtc("/star/starter.html?/star/stock/main.jsp",1014,715,'yes');
	else
		eopenEtc("/star/starter.html?/star/future/main.jsp",1014,715,'yes');

}

// ½ÃÈ²
function NewsOpen(k1,k2,k3,k4, tt1, tt2, esc,k8) {
	var url = "/TRServlet/common/inc/pop_news_read.jsp"
					+ "?sdate=" + k1
	        + "&stime=" + k2
	        + "&iprofferid=" + k3
	        + "&inewsno=" + k4
	        + "&text1=" + tt1
	        + "&text2=" + tt2
	        + "&inews_Seq=" + k8
	        + "&subj=" + charChange(esc)
	        + "&trcode=HWS11111";
	//eopen(url, 640, 400, 'yes');
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	//newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=" + scrl);
	//alert('¤·¤·?');
	//newwin = window.showModalDialog(URL, window, 'dialogWidth:640px; dialogHeight:400px; center:yes;');
	window.showModelessDialog (url, window, 'dialogWidth:640px; dialogHeight:400px; scroll:yes; help:no; status:no;');
}

function charChange(str) {
	var rs = "";
	for(var i=0;i<str.length;i++)
		if(str.charAt(i) == '%') rs += "%25";
		else rs += str.charAt(i);

	return rs;
}

var codeObj;
var nameObj;
var typeObj;

function preSetCode(cdo,no,to)
{
    //alert("preSetCode");
    codeObj = cdo;
    nameObj = no;
    //alert(no);
    typeObj = to;
}

function isSetCode()
{
    if(codeObj==null)
        return false;
    else
        return true;
}


function setCode(code, name, type)
{
    //alert(code+'=='+name+'==' + type);
    if(nameObj!=null && typeof(nameObj.value)!='undefined')
        nameObj.value=name;
//alert(nameObj.value);
    if(typeObj!=null && typeof(typeObj.value)!='undefined')
        typeObj.value=type;
//alert(typeObj.value);
    if(codeObj!=null && typeof(codeObj.value)!='undefined')
    {
        codeObj.value=code;
//alert(codeObj.value);
        try {
            codeObj.onkeyup();
        } catch(e) {}

    }
    else
        alert('¹Ì¸® preSetCode ¸Þ½îµå·Î ÄÚµå°´Ã¼¸¦ µî·ÏÇØ¾ß ÇÕ´Ï´Ù. to °³¹ßÀÚ');
}



function eopen(url) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=600,height=400,scrollbars=auto");
}

function eopen(url, wt, ht) {
	alert(wt);
	alert(ht);
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}
	newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=yes");
	alert(newwin);
}

function eopen3(url, wt, ht, winName) {

	if( self.winName && !winName.closed ) {
		winName.close();
		winName = null;
	}
	winName = window.open(url,winName, "width=" + wt + ",height=" + ht + ",scrollbars=no");
}

function eopen3_scroll(url, wt, ht, winName){

	if( self.winName && !winName.closed ) {
		winName.close();
		winName = null;
	}
	winName = window.open(url,winName, "width=" + wt + ",height=" + ht + ",scrollbars=yes" );
}

function eopen(url, wt, ht, scrl) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=" + scrl);
}

function eopen(url, wt, ht, scrl, resize) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=" + scrl + ",resizable=" + resize);
}

function eopen(url, wt, ht, scrl, resize , winName) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}
	newwin = window.open(url ,winName ,"width=" + wt + ",height=" + ht + ",scrollbars=" + scrl + ",resizable=" + resize );
}


// For Date Formatting append by yakjin.
function dateFormat(obj, mode) {
	d = obj.value;
	if ( mode == 'off' ) {
		while ( d.indexOf('/') >= 0 ) {
			d = d.substring(0, d.indexOf('/')) +  d.substring(d.indexOf('/')+1);
		}
	} else if ( mode == 'on' ) {
		d=d.substring(0,4) + '/' + d.substring(4,6) + '/' + d.substring(6);
	}
	obj.value = d;
	if ( mode == 'off' ) {
		obj.select();
	}
}



// For Date Formatting append by yakjin.
function dateFormatRtn(d, mode) {
	if ( mode == 'off' ) {
		while ( d.indexOf('/') >= 0 ) {
			d = d.substring(0, d.indexOf('/')) +  d.substring(d.indexOf('/')+1);
		}
	} else if ( mode == 'on' ) {
		d=d.substring(0,4) + '/' + d.substring(4,6) + '/' + d.substring(6);
	}
	return d;
}


// ÀÚ»çÁÖ °èÁÂ ¿©ºÎ
function getScstbyUsid(acct) {
	if (typeof(acctr) == 'undefined')
		return "0";
    var rs = "";
    for(var i=0;i<acctrcode.length;i++)
        if(acct == acctr[i].usid) rs = acctr[i].scst;
    return rs;
}

function accountCheck(accno) {
	if (typeof(accno) != 'undefined') {
		if (accno.value == '0') {
			alert('ÇØ´ç°èÁÂ°¡ ¾ø½À´Ï´Ù...');
			return false;
		}
		if (accno.value.length != 11) {
			if (accno.value.length != 12) {
				alert('ÇØ´ç°èÁÂ°¡ ¾ø½À´Ï´Ù...');
				return false;
			}
		}
	}
}

function getAccount(accno) {
	var ret;
	if(accno.length == 12) {
		ret = accno.substring(0,11);
	} else {
		ret = accno;
	}
	return (ret);

}


function valClean(obj) {

	with (obj) {

		obj.reset();
		if (typeof(tcode) != 'undefined') {
			tcode.value = "";
		}
		if (typeof(jcode) != 'undefined') {
			jcode.value = "";
		}

		if (typeof(bdt) != 'undefined') {
			bdt.value = "";
		}

		if (typeof(jn1) != 'undefined') {
			jn1.value = "";
		}

		if (typeof(marketname) != 'undefined') {
			marketname.value = "";
		}

		if (typeof(price) != 'undefined') {
			price.value = "";
		}

		if (typeof(amount) != 'undefined') {
			amount.value = "";
		}

		if (typeof(orderNo) != 'undefined') {
			orderNo.value = "";
		}
		if (typeof(repay) != 'undefined') {		// tran0509¿¡¼­ »óÈ¯°¡´ÉÁÖ¼ö
			repay.value = "";
		}

		if (typeof(jcode) != 'undefined') {
			jcode.value = "";
		}

		if (typeof(amount) != 'undefined') {
			amount.value = "";
		}

		if (typeof(price) != 'undefined') {
			price.value = "";
		}
	}
}

// /js/master/Member.js¸¦ includeÇØ¾ßÇÑ´Ù.
function makeMemberOtions(optNm)
{
    var stx = optNm.options.length;

    for(var i=0; i<mb.length; i++)
    {
        optNm.options[stx+i] = new Option(mb[i].jname, mb[i].jcode, '', '');
    }

}


// ÇöÀç°¡/ÁÖ¹®È­¸é¿ë
var rf = new Array();
var lastIdx = 0;


function registForm(rfobj)
{
    //alert(rfobj.name);
    rf[lastIdx] = rfobj;
    lastIdx++;
}



function onChgAccnt(acc)
{
    for(var i=0; i<rf.length;i++) {
        var rlo = rf[i];
        if(rlo.account != null) {
            if(rlo.account != acc)
                selectedBox( rlo.account, acc.value);
        }
    }
    account = acc.value;
}


function onChgPwd(pwd)
{
    for(var i=0; i<rf.length;i++) {
        var rlo = rf[i];
        if(rlo.pass != null) {
            if(rlo.pass != pwd)
                rlo.pass.value = pwd.value;
        }
    }
    pass = pwd.value;
}

function setCookie( name, value, expiredays )
{
	var todayDate = new Date();
	if(expiredays==null)
	    expiredays = 7;
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function getCookie( name )
{
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}


function getAccountType( account ) {
	account  = trim(account);
	//if ( account.length == 11 )	{
		typeNum = account.substring(3,5);
		typeN	= typeNum * 1;
		if			( typeN == 15					) {	return 8;		// ÀÏÀÓÇü·¦
		} else if	( typeN >= 10 && typeN <= 19	) {	return 1;		// À§Å¹
		} else if	( typeN >= 60 && typeN <= 69	) {	return 2;		// ÀúÃà
		} else if	( typeN == 30					) {	return 3;		// ¼±¹°
//		} else if	( typeN == 25 || typeN == 45	) {	return 4;		// ¼öÀÍÁõ±Ç
		} else if	( typeN == 50					) {	return 5;		// CD
		} else if	( typeN == 55					) {	return 6;		// CP
		} else if	( typeN >= 90 && typeN <= 99	) {	return 7;		// RP
		} else if	( typeN == 25					) {	return 9;		// ¼öÀÍÁõ±Ç
		} else {										return 0;
		}
	//} else {
	//	return 0;
	//}
}


/*-----------------------------------------
left trim
-----------------------------------------*/
function ltrim(str) {
    var i;
    var ch;
    var retStr = '';
    if (str.length == 0)
        return str;
    for (i=0;i<str.length;i++) {
        ch = str.charAt(i);
        if (retStr.length == 0 && (ch == ' ' || ch == '\r' || ch == '\n'))
            continue;
         retStr += ch;
    }
    return retStr;
}

/**
 * ¹®ÀÚ¿­ÀÇ rightÂÊ trim()
 * @return trimµÈ ¹®ÀÚ¿­
 */
/*-----------------------------------------
right trim
-----------------------------------------*/
function rtrim(str) {
    var i;
    var ch;
    var retStr = '';
    if (str.length == 0)
        return str;
    for (i=str.length-1;i>=0;i--) {
        ch = str.charAt(i);
        if (ch != ' ' && ch != '\r' && ch != '\n') {
            break;
        }
    }
    retStr = str.substring(0, i+1);
    return retStr;
}

/**
 * ¹®ÀÚ¿­ÀÇ ¾çÂÊ trim()
 * @return trimµÈ ¹®ÀÚ¿­
 */
/*-----------------------------------------
trim
-----------------------------------------*/
function trim(str) {
    var retStr;
    retStr = ltrim(str);
    retStr = rtrim(retStr);
    return retStr;
}

function replaceStr(str, oldstr, newstr)
{
	var index = 1;
	var temp = String(str);

	if(newstr == null)
		newstr = "";

	while(index > 0)
	{
		temp = temp.replace(oldstr, newstr);
		index = temp.indexOf(oldstr);
	}

	return temp;
}

var link_url		= '';
var link_name		= '';
var link_isAction	= false;
function linkNotice(l_url, l_name, isA) {
	link_url		= l_url;
	link_name		= l_name;
	link_isAction	= isA;
	window.showModalDialog('/common/linknotice.html',window,'dialogHeight:245px;dialogWidth:367px;center:yes;help:No;resizable:No;status:No;unadorned:yes;dialogHide:No;scroll:no;');
}






// trim
String.prototype.trim = function()
{
    // Use a regular expression to replace leading and trailing
    // spaces with the empty string
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

// comma trim
String.prototype.ctrim = function ()
{
	var re = /,/g;
	return this.replace(re, "");
}
String.prototype.format = function(type)
{
	var data  = this.split('.');
	var out = '';
	var ch;
	var len = data[0].length-1
	for ( __i=len ; __i >= 0 ; __i--)
	{
		ch = data[0].charAt(__i);
		out = ch + (((len-__i)%3==0&&len-__i!=0)?',':'') + out;
	}
	return out + ((data.length > 1)?'.'+data[1]:'') ;
}

// ¼ýÀÚ ÀÔ·Â¸¸ ¹Þ¾Æ¼­ ÄÞ¸¶ Âï¾î º¸¿©ÁÖ±â..
function filterNum ()
{
	if	(	( event.keyCode > 57 || event.keyCode < 48 )							&&
			!( event.keyCode != 16 && event.keyCode > 95 && event.keyCode < 106 )	&&
			( event.keyCode !=8 && event.keyCode !=9 && event.keyCode !=13 && event.keyCode != 46)        &&
			!( event.keyCode > 36 && event.keyCode < 41 )
		)
	{
		event.returnValue = false;
	}
}

function filterComma()
{
	if (	( typeof ( event.srcElement.value ) != 'undefined' ) &&
			( event.keyCode !=9 && event.keyCode !=13  )        &&
			!( event.keyCode > 36 && event.keyCode < 41 )
		)
	{
		var loop = /^\$|,/g;
		var num = event.srcElement.value.toString();

		if ( typeof ( event.srcElement.maxLength ) != 'undefined' &&
			 num.length <= event.srcElement.maxLength )
		{
			num = num.replace ( loop, '' );

//			num += '0';

			var comma = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
			var data = num.split('.');
			data[0] += '.';
			do
			{
				data[0] = data[0].replace(comma, '$1,$2');
			} while ( comma.test(data[0]) );

			if (data.length > 1)
			{
				num = data.join('');
			} else
			{
				num = data[0].split('.')[0];
			}
			//event.srcElement.value = num.substring(0, num.length-1 );
			event.srcElement.value = num;
		}
	}
}
function resizeScrollTable(headTable, bodyTable) {
	if(bodyTable.rows.length==0)
	  return;

	var scrollBarWidth = bodyTable.offsetWidth - bodyTable.clientWidth;

	// set width of the table in the head
	//headTable.style.width = Math.max(0, Math.max(bodyTable.offsetWidth + scrollBarWidth, headTable.clientWidth));

	// go through each cell in the head and resize
	var headCells = headTable.rows[0].cells;
	var bodyCells = bodyTable.rows[bodyTable.rows.length-1].cells;

	var mx = bodyCells.length-1;
	for (var i = 0; i < mx; i++) {
	  if(i==0)
		  headCells[i].style.width = bodyCells[i].offsetWidth-2;
		else
		  headCells[i].style.width = bodyCells[i].offsetWidth-3;
		//alert(bodyCells[i].offsetWidth);
  }


  scrollBarWidth = bodyTable.parentNode.offsetWidth - bodyTable.parentNode.clientWidth;

  if(headCells[mx]==null)
    return;
}

function eopen(url) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=800,height=600,scrollbars=yes");
}
function eopen(url, wt, ht) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}
	newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=yes");
}

function eopen3(url, wt, ht, winName) {

	if( self.winName && !winName.closed ) {
		winName.close();
		winName = null;
	}
	winName = window.open(url,winName, "width=" + wt + ",height=" + ht + ",scrollbars=yes");
}
function eopen(url, wt, ht, scrl) {
	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=" + wt + ",height=" + ht + ",scrollbars=" + scrl);
}

function eopen2(url) {

	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}

	newwin = window.open(url,"newwin", "width=500,height=400,scrollbars=yes");

}

function eopen2(url, w, h) {

	if( self.newwin && !newwin.closed ) {
		newwin.close();
		newwin = null;
	}
	newwin = window.open(url,"newwin", "width="+"600"+",height="+h+",scrollbars=yes");
}



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

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

function escape_url(url) {
	var i;
	var ch;
	var out = '';
	var url_string = '';

	url_string = String(url);

	for (i = 0; i < url_string.length; i++) {
		ch = url_string.charAt(i);
		if (ch == ' ')		out += '%20';
		else if (ch == '%')	out += '%25';
		else if (ch == '&')	out += '%26';
		else if (ch == '+')	out += '%2B';
		else if (ch == '=')	out += '%3D';
		else if (ch == '?') out += '%3F';
		else				out += ch;
	}
	return out;
}



var v_loginURLs			= new Object();
	v_loginURLs['0' ]	= '/common/login/login.htm';
	v_loginURLs['11']	= '/common/login/login4POP.jsp';	// /common/login4Popup.jsp
function fn_loginRotate( p_loc, p_l_type, p_search )
{
	p_loc.href = v_loginURLs[p_l_type] + '?' + p_search;
}


function menuSCHGo ( m_url, isXecure )
{
	try
	{
		if ( m_url == '/index.shtml' )
		{
			location = m_url;
		} else
		{
			var skey = '';
			if ( isXecure )
			{
				if ( typeof(getSessionKey) != 'undefined' )
					skey = '?q=' + getSessionKey();
				else if ( typeof(frm_menu) != 'undefined' &&
						  typeof(frm_menu.getSessionKey) != 'undefined' )
					skey = '?q=' + frm_menu.getSessionKey();
			}
			top.location = '/n_frame.jsp?' + m_url + skey;
		}
	} catch ( E )
	{
		alert(E);
	}
}
function menuSCHPop ( theForm )
{
	 window.showModelessDialog ( '/common/modalwindow.html?/common/menuSearch.jsp?stext=' + theForm.stext.value ,
								 window ,
								 "help:off; resizeable:no; scroll:no; status:no; dialogWidth:650px; dialogHeight:600px");
}

//[KES] local ÄÄÇ»ÅÍÀÇ ÇöÀç ³¯Â¥ Ãâ·Â
function today()
{
	var now = new Date();

	var year = now.getYear();
	var mon = now.getMonth();
	var day = now.getDate();

	mon += 1;

	if(mon < 10) mon = "0" + mon;
	if(day < 10) day = "0" + day;

	return "" + year + mon + day;
};

//[KES] colgroup element ¿¡ col_witdh, col_alignÀÇ ¼Ó¼ºÀ» °¡Áø col element »ý¼º
function addCol(colgroup, col_width, col_align, col_class)
{

	for(var i=0 ; i<col_width.length ; ++i)
	{
		var col = document.createElement("COL");

		if(col_width != null) col.width = col_width[i];
		if(col_align != null) col.align = col_align[i];
		if(col_class != null) col.className = col_class[i];
		colgroup.appendChild(col);
	}

};

//[KES] Table colgroup »ý¼º
function addColgroup(table, align, classname, col_width, col_align, col_class)
{
	var colgroup = document.createElement("COLGROUP");
	if(align != null ) colgroup.align = align;
	if(classname != null ) colgroup.className = classname

	addCol(colgroup, col_width, col_align, col_class);

	table.appendChild(colgroup);
};

//[KES] Table colgroup »ý¼º
function clickedBtn(obj)
{
	obj.style.cursor = "wait";
	obj.src = "/img/common/btn_refer2_off.gif"; //Á¶È¸Áß»óÅÂ·Î º¯°æ
	obj.onClick = function() { alert('Á¶È¸ÁßÀÔ´Ï´Ù.'); };
};

//[KES] Á¶È¸ ¹öÆ° Å¬¸¯½Ã »óÅÂ
function searchOnAir(obj)
{
	obj.style.cursor = "wait";
	obj.src = "/img/common/btn_refer2_off.gif"; //Á¶È¸Áß»óÅÂ·Î º¯°æ
	obj.onClick = function() { alert('Á¶È¸ÁßÀÔ´Ï´Ù.'); };
};

//[KES] Á¶È¸ ¹öÆ° Å¬¸¯ ÇÁ·Î¼¼¼­ Á¾·á »óÅÂ
function searchOffAir(obj)
{
	obj.style.cursor = "hand";
	obj.src = "/img/common/btn_inquiry3.gif";
	obj.onClick = function(){ searchPage(this); };
};

//[KES] Table colgroup »ý¼º
function addTd(tr, text)
{
	var td = tr.insertCell();
	td.innerHTML = text;
};

//[KES] Table colgroup »ý¼º
function insertOption(publisher, name, value, sel)
{
	var opt = document.createElement("OPTION");
	opt.text = name;
	opt.value = value;
	if(sel == null) sel = false;
	opt.selected = sel
	publisher.add(opt);
};

//[KES] 0-9, A-Z ¹üÀ§³»ÀÇ char »ý¼º
function getRandomChar(type)
{
	var chr = "";

	if(type == undefined || type == null) type = "";


	if(type == 1) //¼ýÀÚ, ¿µ¹®´ë¹®ÀÚ, ¿µ¹® ¼Ò¹®ÀÚ È¥ÇÕ
	{
		while(true)
		{
			chr = Math.ceil(Math.random() * 1000) % 123;
			if((48 <= chr && chr <= 57) || (65 <= chr && chr <= 90) || (97 <= chr && chr <= 122)) break;
		}
	}
	else //¼ýÀÚ¸¸
	{
		while(true)
		{
			chr = Math.ceil(Math.random() * 1000) % 91;
			if((48 <= chr && chr <= 57)) break;
		}
	}

	return String.fromCharCode(chr);
};

//[KES] len ±æÀÌ ¸¸Å­ÀÇ random String ¸®ÅÏ
function getRandomString(len, type)
{
	var str = "";

	for(var i=0 ; i<len ; ++i) str += getRandomChar(type);

	return str;
};

//[KES]³¯Â¥ Æ÷¸Ë º¯°æ
//¹«Á¶°Ç 8ÀÚ¸® È¤Àº 10ÀÚ¸® ¼ýÀÚÇü µ¥ÀÌÅ¸¸¸ Ãë±Þ.
function dtFormatChg(dt, format)
{
	var len = dt.length;

	if(len == 8)
	{
		dt = dt.substring(0,4) + format + dt.substring(4,6) + format + dt.substring(6);
	}
	else if(len == 10)
	{
		dt = dt.substring(0,4) + format + dt.substring(5,7) + format + dt.substring(8);
	}
	else
	{
		//alert('µ¥ÀÌÅ¸ ÀÔ·Â°ªÀ» È®ÀÎÇØ ÁÖ½Ê½Ã¿ä.');
		return;
	}

	return dt;

};//dtFormatChg


//[KES] ¼ýÀÚÇüÅÂÀÇ string ÀÎÁö Ã¼Å©
String.prototype.isNumber = function()
{
	var n = Number(this);
	if(!isNaN(n)) return true;
	else return false;
};






//[KES] ±âÁ¸ dataFormat ¿¡ ¿¹¿ÜÃ³¸® ºÎºÐ Ãß°¡
function dateFormatExt(obj, mode, div) {
	d = obj.value;

	if( mode == 'off' )
	{
		while(d.indexOf(div) >= 0 )
		{
			d = d.substring(0, d.indexOf(div)) +  d.substring(d.indexOf(div)+1);
		}

	}
	else if( mode == 'on' )
	{
		if(d.length == 0) return;


		if(d.isNumber() && d.length == 8)
		{
			d = d.substring(0,4) + div + d.substring(4,6) + div + d.substring(6);
		}
		else
		{
			d = "";
			alert('³¯Â¥Æ÷¸ËÀ» Àû¿ëÇÏ±â À§ÇØ¼­´Â 8ÀÚ¸®ÀÇ ¼ýÀÚ°¡ ÇÊ¿äÇÕ´Ï´Ù.');
		}
	}

	obj.value = d;
	if ( mode == 'off' ) {
		obj.select();
	}
}







//[KES] ÁÖ¹Î¹øÈ£ Ã¼Å©
function juminCheck(obj)
{
	var rsn_no = obj;

	if(rsn_no.value.length !=13)
	{
		alert('ÁÖ¹Î¹øÈ£´Â 13ÀÚ¸® ÀÔ´Ï´Ù.');
		rsn_no.value = '';
		rsn_no.focus();
		return false;
	}

	errfound = false;

	var str_jumin1 = rsn_no.value.substring(0,6);
	var str_jumin2 = rsn_no.value.substring(6,13);
	var checkImg='';

	var i3=0
	for (var i=0;i<str_jumin1.length;i++)
	{
		var ch1 = str_jumin1.substring(i,i+1);
		if (ch1<'0' || ch1>'9') { i3=i3+1; }
	}
	if ((str_jumin1 == '') || ( i3 != 0 ))
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	var i4=0
	for (var i=0;i<str_jumin2.length;i++)
	{
		var ch1 = str_jumin2.substring(i,i+1);
		if (ch1<'0' || ch1>'9') { i4=i4+1; }
	}
	if ((str_jumin2 == '') || ( i4 != 0 ))
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	if(str_jumin1.substring(0,1) < 4)
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	// ¼ºº° ±¸ºÐ (ÇÑ±¹ÀÎµé¸¸, ¿Ü±¹ÀÎ µî·ÏÀ» ¹Þ¾Æ¾ß ÇÏ´Â °æ¿ì ÀÌ ºÎºÐ Ã³¸® »èÁ¦ ÇÊ¿ä)
	if(str_jumin2.substring(0,1) < 1 || str_jumin2.substring(0,1) > 4)
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	if((str_jumin1.length > 7) || (str_jumin2.length > 8))
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	if ((str_jumin1 == '72') || ( str_jumin2 == '18'))
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	var f1=str_jumin1.substring(0,1);
	var f2=str_jumin1.substring(1,2);
	var f3=str_jumin1.substring(2,3);
	var f4=str_jumin1.substring(3,4);
	var f5=str_jumin1.substring(4,5);
	var f6=str_jumin1.substring(5,6);
	var hap=f1*2+f2*3+f3*4+f4*5+f5*6+f6*7;
	var l1=str_jumin2.substring(0,1);
	var l2=str_jumin2.substring(1,2);
	var l3=str_jumin2.substring(2,3);
	var l4=str_jumin2.substring(3,4);
	var l5=str_jumin2.substring(4,5);
	var l6=str_jumin2.substring(5,6);
	var l7=str_jumin2.substring(6,7);

	hap=hap+l1*8+l2*9+l3*2+l4*3+l5*4+l6*5;
	hap=hap%11;
	hap=11-hap;
	hap=hap%10;
	if (hap != l7)
	{
		alert('¾ø´Â ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!!');
		return false;
	}

	var i9=0;

	if (!errfound) return true;
}


//data ¹Þ¾Æ 3ÀÚ¸®¸¶´Ù ÄÄ¸¶ Âï±â
function formatComma(oldData)
{
	var loop = /^\$|,/g;
	var num = oldData.toString();

	num = num.replace ( loop, '' );

	var comma = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
	var data = num.split('.');
	data[0] += '.';
	do
	{
		data[0] = data[0].replace(comma, '$1,$2');
	} while ( comma.test(data[0]) );

	if (data.length > 1)
	{
		num = data.join('');
	} else
	{
		num = data[0].split('.')[0];
	}
	return num;
}



//[KES] stock_chart ±×¸®±â ½ºÅ©¸³Æ® ¸®ÅÏ
function getStockChartScript(jcode, sort, jongbar, width, height)
{
	if(jcode == null || jcode == undefined || jcode == "") jcode = "";
	if(sort == null || sort == undefined || sort == "") sort = "";
	if(jongbar == null || jongbar == undefined || jongbar == "") jongbar = "N";
	if(width == null || width == undefined || width == "") width = "115";
	if(height == null || height == undefined || height == "") height = "115";


	var objscript =

 	  "            <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'"
	+ "                    codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10.0.42.34'"
	+ "                    width='"+width+"'"
	+ "                    height='"+height+"'"
	+ "                    id='stock_chart'>"
	+ "                <param name='movie'     value='/img/flash/stock_chart.swf'>"
	+ "                <param name='quality'   value='high'>"
	+ "                <param name='AllowScriptAccess' value='always' />  "
	+ "                <param name='FlashVars' value='sort="+sort+"&jongbar="+jongbar+"&jcode="+jcode+"' />  "
	+ "                <embed  src='/img/flash/stock_chart.swf'"
	+ "                        AllowScriptAccess='always'"
	+ "                        quality='high'"
	+ "                        width='"+width+"'"
	+ "                        height='"+height+"'"
	+ "                        name='stock_chart'"
	+ "                        type='application/x-shockwave-flash'"
	+ "                        pluginspage='http://www.macromedia.com/go/getflashplayer'"
	+ "                        FlashVars='sort="+sort+"&jongbar="+jongbar+"Y&jcode="+jcode+"'"
	+ "                        >"
	+ "                </embed>"
	+ "            </object>";

	return objscript;
}

String.prototype.isKorean = function()
{
	var len         = this.length;
	var v_result    = true;
	for ( var i=0 ; i < len ; i++ )
	{
		if ( !( ( this.charCodeAt(i) >  0x0029 && this.charCodeAt(i) <  0x0040 )        // ¼ýÀÚ
			 || ( this.charCodeAt(i) >  0x3163 && this.charCodeAt(i) <  0x318F )        // ÀÚÀ½ ¸ðÀ½ Á¦¿Ü ÇÑ±Û
			 || ( this.charCodeAt(i) >= 0xAC00 && this.charCodeAt(i) <= 0xD7A3 ) ) )    // ÀÚÀ½ ¸ðÀ½ Á¦¿Ü ÇÑ±Û
			v_result = false;
	}
	return v_result;
}

String.prototype.isPassPortEnglish = function()
{
	var len         = this.length;
	var v_result    = true;

	for ( var i=0 ; i < len ; i++ )
	{

		if ( !(
			  ( this.charCodeAt(i) >  0x0029 && this.charCodeAt(i) <  0x0040 ) // ¼ýÀÚ
			||  (this.charCodeAt(i) >= 0x0061 && this.charCodeAt(i) <= 0x007A)  // ¿µ¹® ´ë¹®ÀÚ
			||(this.charCodeAt(i) == 0x20  )    // space
			)
		)
		v_result = false;

	}

	return v_result;
}

String.prototype.isEnglish = function()
{
	var len         = this.length;
	var v_result    = true;
	for ( var i=0 ; i < len ; i++ )
	{
		if ( !( ( this.charCodeAt(i) >  0x0029 && this.charCodeAt(i) <  0x0040 )      // ¼ýÀÚ
			 || ( this.charCodeAt(i) >= 0x0000 && this.charCodeAt(i) <= 0x007F ) ) )  // ¿µ¹®
			v_result = false;
	}
	return v_result;
}
//*********************************************************
// ¼ýÀÚ,¿µ¹®, ÇÑ±Û ÀÌ¸é true (!,@ ... ) ÀÌ·± ¹®ÀÚµµ ÀÔ·Â ¾ÈµÇµµ·Ï ÇÑ´Ù.
//*********************************************************
String.prototype.isLanguage = function()
{
	var len         = this.length;
	var v_result    = true;

	for ( var i=0 ; i < len ; i++ )
	{
		//alert(this.charCodeAt(i) );

		if ( !( ( this.charCodeAt(i) >  0x0029 && this.charCodeAt(i) <  0x0040 )        // ¼ýÀÚ
			 || ( this.charCodeAt(i) >  0x3163 && this.charCodeAt(i) <  0x318F )        // ÀÚÀ½ ¸ðÀ½ Á¦¿Ü ÇÑ±Û
			 || ( this.charCodeAt(i) >= 0xAC00 && this.charCodeAt(i) <= 0xD7A3 ) ) )    // ÀÚÀ½ ¸ðÀ½ Á¦¿Ü ÇÑ±Û
		{

			if ( !(
				(this.charCodeAt(i) >= 0x0061 && this.charCodeAt(i) <= 0x007A)    // ¿µ¹® ¼Ò¹®ÀÚ
				||(this.charCodeAt(i) >= 0x0041 && this.charCodeAt(i) <= 0x005A)  // ¿µ¹® ´ë¹®ÀÚ
				||(this.charCodeAt(i) == 0x20 ||  this.charCodeAt(i) == 0x5F )    // space or _
				)
			)
			v_result = false;
		}

	}
	return v_result;
}


var month = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

//*********************************************************
// obj¸¦ ±¸¼ºÇÏ´Â byte¼ö¸¦ ¹ÝÈ¯
// @return int
//*********************************************************
String.prototype.bytes = function()
{
	var str = this;
	var l = 0;
	for (var i = 0; i < str.length; i++) l += (str.charCodeAt(i) > 128) ? 2 : 1;
	{
		return l;
	}
}

//********************************************************
//ÀÌ¸ÞÀÏ Ã¼Å·
//********************************************************
function emailCheck( str )
{
	if (str <= 6 ||
	    str.indexOf('@', 0) == -1 ||
	    str.indexOf ('.', 0) == -1)
	{
		alert("¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÁÖ¼ÒÇü½ÄÀÌ ¾Æ´Õ´Ï´Ù!");
		return false;
	}
	return true;
}



//********************************************************
//Æ¯Á¤ ¹®ÀÚ Á¦°Å
//********************************************************
function changeReplace( str , chan )
{
	for (; str.indexOf(chan) != -1 ;)
	{
		str = str.replace(chan,"");
	}
	return str;
}

//*********************************************************
// ¿ÞÂÊ Trim
//*********************************************************
function trimLeft( str )
{
	for (var i = 0 ; i < str.length ; i++)
	{
		if ( str.charAt == ' ' ) str = str.substring(1);
	   	else break;
    }
    return str;
}

//*********************************************************
// ¿À¸¥ÂÊ Trim
//*********************************************************
function trimRight( str )
{
	for (var i = str.length-1 ; i >= 0 ; i--)
	{
		if (str.charAt(i) == ' ') str = str.substring(0,i);
		else break;
	}
	return str;
}

//*********************************************************
// ¾çÂÊ Trim
//*********************************************************
function trimLR( str )
{
	return trimRight( trimLeft( str ) );
}

//*********************************************************
// Å°º¸µåÀÇ Å°°¡ ¼ýÀÚÀÏ°æ¿ì¿¡¸¸ ÀÔ·ÂÀ» ¹Þµµ·Ï
// text box¿¡ Ãß°¡ : onkeypress="return checkKeyNumber(event.keyCode)"
//*********************************************************
function checkKeyNumber( ch )
{
	if (ch > 47 && ch < 58 || 95 < ch < 106) return true;
	else return false;
}

//*********************************************************
// Å°º¸µåÀÇ Å°°¡ ¼ýÀÚ¿Í '-'ÀÏ°æ¿ì¿¡¸¸ ÀÔ·ÂÀ» ¹Þµµ·Ï
// text box¿¡ Ãß°¡ : onkeypress="return checkKeyNumber2(event.keyCode)"
//*********************************************************
function checkKeyNumber2( ch )
{

	if ( ch == 45 || ch == 189 || (ch > 47 && ch < 58) ) return true;
	else return false;
}


//*********************************************************
// Å°º¸µåÀÇ Å°°¡ ¼ýÀÚÀÏ°æ¿ì¿Í .¸¸ ÀÔ·ÂÀ» ¹Þµµ·Ï
// text box¿¡ Ãß°¡ : onkeypress="return checkKeyNumber(event.keyCode)"
//*********************************************************
function checkKeyNumber3( ch )
{
	if (ch == 46 || ch > 47 && ch < 58) return true;
	else return false;
}


//*********************************************************
// ³Ñ¾î¿Â ¹®ÀÚ¿­ÀÌ ¼ýÀÚÀÎÁö È®ÀÎ
//*********************************************************
function checkStrNumber( str )
{
	for (var i = 0 ; i < str.length ; i++)
	{
		ch = str.charAt(i);
		if ( (ch < '0' || ch > '9') )
		{
			return false;
		}
	}
	return true;
}

//*********************************************************
// ³Ñ¾î¿Â ¹®ÀÚ¿­ÀÌ ¼ýÀÚÀÌ°Å³ª ¿µ¹®ÀÚÀÎÁö È®ÀÎ
//*********************************************************
function checkStrEng( str )
{
	for (var i = 0 ; i < str.length ; i++)
	{
		ch = str.charAt(i);
		if ( (ch < '0' || ch > '9')&&
		     (ch < 'a' || ch > 'z')&&
		     (ch < 'A' || ch > 'Z') )
		{
			return false;
		}
	}
	return true;
}

//*********************************************************
// ¼ýÀÚÃ¼Å©, ¼ýÀÚÀÌ¿ÜÀÇ ¹®ÀÚ¸¦ ÀÔ·Â½Ã °æ°íÃ¢À» ¶ç¿ò
//*********************************************************
function numCheck()
{
	// ie¿¡¼­¸¸ ÀÛµ¿
	var keyCode = event.keyCode
	if (keyCode < 48 || keyCode > 57)
	{
		alert("¹®ÀÚ´Â »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù." + "[" + keyCode + "]")
		event.returnValue = false
	}
}

//*********************************************************
// ¼ýÀÚÃ¼Å©, ¼ýÀÚÀÌ¿Ü´Â ÀÔ·ÂÀ» ¸øÇÏµµ·Ï ¸·À½.
//*********************************************************
function numCheck2()
{

  	var keyCode = event.keyCode
	//alert(keyCode);
	if (keyCode < 48 || keyCode > 57)
	{
		event.returnValue = false;
	}
}


//*********************************************************
// objÀÇ °ªÀÌ ¼ýÀÚ·Î¸¸ µÇ¾îÀÖ´ÂÁö Ã¼Å©
//  @param object obj
//	@param string msg
//	@return boolean
//*********************************************************
function numCheck3( obj, msg )
{
	var val = obj.value;

	if ( isNaN(val) )
	{
		alert(msg + "´Â ¼ýÀÚ¸¸ ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù..");
		obj.value = "";
		obj.focus();
		return false;
	}

	return true;
}

//*********************************************************
// ¿ÀÇÂÃ¢, ½ºÅ©·Ñ¹Ù ¾øÀ½, ¸®»çÀÌÁî ¾ÈµÊ
//*********************************************************
function winOpenNoscroll( strUrl, openname, width, Height )
{
	//window.open( strUrl, openname , "scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no,width=" + width + ",height=" + Height + ", left=" + (window.screen.availWidth / 2 - width / 2) + ",top=" + (window.screen.availHeight / 2 - Height / 2) );
	window.open( strUrl, openname , "scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no,width=" + width + ",height=" + Height + ", left=0,top=0");
}

//*********************************************************
// ¿ÀÇÂÃ¢, ½ºÅ©·Ñ¹Ù ÀÖÀ½, ¸®»çÀÌÁî ¾ÈµÊ
//*********************************************************
function winOpenScroll( strUrl, openname, width, Height )
{
	//window.open( strUrl, openname, "scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no,width=" + width + ",height=" + Height + ", left=" + (window.screen.availWidth / 2 - width / 2) + ",top=" + (window.screen.availHeight / 2 - Height / 2) );
	window.open( strUrl, openname, "scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=no,width=" + width + ",height=" + Height + ", left=0,top=0");
}

//*********************************************************
// ¿ÀÇÂÃ¢, ½ºÅ©·Ñ¹Ù ¾øÀ½, ¸®»çÀÌÁî µÊ
//*********************************************************
function winOpenNoscroll2( strUrl, openname, width, Height )
{
	//window.open( strUrl, openname , "scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=" + width + ",height=" + Height + ", left=" + (window.screen.availWidth / 2 - width / 2) + ",top=" + (window.screen.availHeight / 2 - Height / 2) );
	window.open( strUrl, openname , "scrollbars=no,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=" + width + ",height=" + Height + ", left=0,top=0");
}

//*********************************************************
// ¿ÀÇÂÃ¢, ½ºÅ©·Ñ¹Ù ÀÖÀ½, ¸®»çÀÌÁî µÊ
//*********************************************************
function winOpenScroll2( strUrl, openname, width, Height )
{
	//window.open( strUrl, openname, "scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=" + width + ",height=" + Height + ", left=" + (window.screen.availWidth / 2 - width / 2) + ",top=" + (window.screen.availHeight / 2 - Height / 2) );
	window.open( strUrl, openname, "scrollbars=yes,directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=" + width + ",height=" + Height + ", left=0,top=0");
}

//*********************************************************
// ¼ýÀÚ¸¦ ÅëÈ­Æ÷¸Ë¿¡ ¸Â°Ô 3ÀÚ¸® ÄÞ¸¶·Î ±¸ºÐ(¸¶ÀÌ³Ê½º Æ÷ÇÔ)
//*********************************************************
function formatCurrency( num )
{
	num = num.toString().replace(/\$|\,/g,'');
	if( isNaN(num) )
	{
		num = "0";
	}

	sign = ( num == ( num = Math.abs(num) ) );
	num = Math.floor(num * 100 + 0.50000000001);
	cents = num % 100;
	num = Math.floor(num / 100).toString();

	if(cents < 10)
	{
		cents = "0" + cents;
	}

	for (var i = 0; i < Math.floor((num.length-(1 + i)) / 3); i++)
	{
		num = num.substring(0,num.length-(4 * i + 3))+','+num.substring(num.length-(4 * i + 3));
	}

	return (((sign)?'':'-') + num);
}


//*********************************************************
//	objÀÇ °ªÀÇ ±æÀÌ°¡ ÁÖ¾îÁø len°ú ÀÏÄ¡ÇÏ´ÂÁö Ã¼Å©
//	@param object obj
//	@param int len
//	@param string msg
//	@return boolean
//*********************************************************
function checkLength( obj, len, msg )
{
	var val = obj.value;
	var l = parseInt(len);

	if (val == "" || val.length <= 0)
	{
		alert(msg + "À» ÀÔ·ÂÇÏ¼¼¿ä..");
		obj.focus();
		return false;
	}
	else if (l != 0 && val.length < l)
	{
		alert(msg + "Àº "+len+"ÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼Å¾ßÇÕ´Ï´Ù..");
		obj.focus();
		return false;
	}

	return true;
}

//*********************************************************
//	iframeÀÇ height¸¦ Table Row ¼ö¿¡ µû¶ó ÀÚµ¿À¸·Î »çÀÌÁî Á¶Àý
//	@param rowCount -- ÃÖ´ë º¸ÀÌ°íÀÚ ÇÏ´Â Row ¼ö
//	@param rowHeight -- °¢ Row ³ôÀÌ
//	* tb1 = Table Ä®·³ id
//	<body> ÅÂ±× onloadÀÌº¥Æ®¿¡ »ç¿ë
//*********************************************************
function iframeResize( rowCount, rowHeight )
{
	var rowLength = tb1.rows.length;
	var i = rowLength - ( (rowCount * 2) + 2 );
	var iheight = i * rowHeight;
	var iscrollWidth = document.body.scrollWidth;
	var iscrollHeight = document.body.scrollHeight;

	if(rowLength < rowCount)
	{
		self.resizeTo(iscrollWidth, iscrollHeight);
	}
	else
	{
		self.resizeTo(iscrollWidth, iscrollHeight - iheight);
	}
}



//*********************************************************
// ³¯Â¥ Ã¼Å©
//*********************************************************
function dateCheck( fromDate, toDate )
{
	var fromDt = fromDate.value;
	var toDt = toDate.value;

	if (fromDt > toDt)
	{
		alert("½ÃÀÛÀÏÀÌ Á¾·áÀÏº¸´Ù Å¬ ¼ö ¾ø½À´Ï´Ù.");
		fromDate.focus();
		return false;
	}
	return true;
}


//*********************************************************
//*	³¯Â¥ Check
//*	@param object objValue
//*	@return string
//* @param datType : 1 --> 2004.01.01
//*					 2 --> 20040101
//*********************************************************
function chkDate( objValue, dateType )
{
	var sRtnDate;

	if(trimLR(objValue.value) == "")
	{
		alert("³â¿ùÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä");
		objValue.focus();
		return "";
	}


	if((sRtnDate = isDate(objValue.value, dateType)) == "")
	{
		alert("³â¿ùÀÏÀº YYYYMMDD Çü½ÄÀ¸·Î ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		objValue.value = "";
		objValue.focus();
		return "";
	} else
	{
		return objValue.value = sRtnDate;
	}
}

//*********************************************************
//*	³¯Â¥ Check
//*	@param string sDate
//*	@return string
//* @param datType : 1 --> 2004.01.01
//*					 2 --> 20040101
//*********************************************************

function isDate( sDate, dateType )
{
	var sOrgDate, sPatt;
	var sYear = "", sMonth = "", sDay = "";
	var iYear = 0, iMonth = 0, iDay = 0;

	sPatt = /\//g; sDate = sDate.replace(sPatt,"");
	sPatt = /-/g;  sDate = sDate.replace(sPatt,"");
	sPatt = /\./g; sDate = sDate.replace(sPatt,"");

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

	if(sDate.length != 8)
	{
		return "";
	} else
	{
	   sYear = sDate.substring(0,4);
	   sMonth = sDate.substring(4,6);
	   sDay = sDate.substring(6,8);
	}

	if(isNaN(sYear) || isNaN(sMonth) || isNaN(sDay)) return "";

	iYear = parseInt(sYear,'10');
	iMonth = parseInt(sMonth,'10');
	iDay = parseInt(sDay,'10');

	if (iYear < 1) iYear = 0;
	if (iMonth < 1 || iMonth > 12)  iMonth = 0;
	if (iDay < 1) iDay = 0;

	if ( iMonth == 1 || iMonth == 3 || iMonth == 5 || iMonth == 7
			|| iMonth == 8 ||	iMonth == 10 || iMonth == 12)
	{
		if (iDay > 31)
		{
			iDay = 0;
		}
	} else if (iMonth == 4 || iMonth == 6 ||  iMonth == 9 || iMonth == 11)
	{
		if (iDay > 30)
		{
			iDay = 0;
		}
	} else if (iMonth == 2 )
	{
		if (iYear % 4 != 0 || (iYear % 100 == 0 && iYear % 400 != 0))
		{
			if (iDay > 28)
			{
				iDay = 0;
			}
		} else if (iDay > 29)
		{
			iDay = 0;
		}
	}

   if(iYear == 0 || iMonth == 0 || iDay == 0)
   {
   	return "";
   } else
   {
   		if( dateType == '1')
   		{
			return sYear + "." + sMonth + "." + sDay;
		}
		else
		{
			return sYear + sMonth + sDay;
		}
	}
}

//===================================================================================

function DateView(sel){
	var M;
	var D;

	if(sel == document.form1.startD){
		if((document.form1.startY.value)%4==0) month[1]=29;
		M = document.form1.startM.value;
    }
	else if(sel == document.form1.endD){
		if((document.form1.endY.value)%4==0) month[1]=29;
		M = document.form1.endM.value;
    }
	else if(sel == document.form1.s_selectD){
		if((document.form1.s_selectY.value)%4==0) month[1]=29;
		M = document.form1.s_selectM.value;
	}
	else if(sel == document.form1.e_selectD) {
		if((document.form1.e_selectY.value)%4==0) month[1]=29;
		M = document.form1.e_selectM.value;
	}

	if(M == '08') M = 8;
	else if( M == '09') M = 9;
	M = parseInt(M);


    sel.options.length = month[M-1];
    for(i=0; i<month[M-1]; i++){
        D = i+1;
        if(D<10) {
            sel.options[i].value = "0"+D;
            sel.options[i].text  = "0"+D+"ÀÏ";
        }
        else {
            sel.options[i].value = D;
            sel.options[i].text  = D+"ÀÏ";
        }
    }
}
//=========================================== SelectBox value
function SelectBoxSet( SSet, OValue ) {
    for ( i = 0 ; i < SSet.length ; i++ ) {
        if ( SSet.options[i].value == OValue )
            SSet.options[i].selected = true;
    }
}

function realStrLength(s)
{
   var len = 0;
   if ( s == null ) return 0;
   for(var i=0;i<s.length;i++){
      var c = escape(s.charAt(i));
      if ( c.length == 1 ) len ++;
      else if ( c.indexOf("%u") != -1 ) len += 2;
      else if ( c.indexOf("%") != -1 ) len += c.length/3;
   }
   return len;
}

// ÇØ´ç Ç×¸ñÀÇ ÀÚ¸´¼ö¿Í ¿øÇÏ´Â ¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å©
// target = ÇØ´ç Ç×¸ñ
// cmt = »ç¿ëÀÚ¿¡°Ô ÁÙ Ç×¸ñ¸í
// astr = Çã¿ë°¡´ÉÇÑ ¹®ÀÚ¿­
// lmin = ÃÖ¼Ò ±æÀÌ
// lmax = ÃÖ´ë ±æÀÌ
function rcheck(target, cmt, astr, lmin, lmax)
{
	var i;
	var t = target.value;
	if (realStrLength(t) < lmin || realStrLength(t) > lmax) {
		if (lmin == lmax) alert(cmt + '´Â ' + lmin + ' ÀÚ¸® ÀÌ¾î¾ß ÇÕ´Ï´Ù');
		else alert(cmt + '´Â ' + lmin + ' ~ ' + lmax + ' ÀÚ¸® ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		if(target) target.focus();
		return true
	}
	if (astr.length > 1) {
		for (i=0; i< t.length; i++)
			if(astr.indexOf(t.substring(i,i+1))<0) {
				alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
				target.focus();
				return true
			}
	}
	return false
}

// ÇØ´ç Ç×¸ñÀÇ ÀÚ¸´¼ö¿Í ¿øÇÏ´Â ¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å© (Æ÷¸ËÆÃµÈ ¼ýÀÚ ¿¹:1,234)
// target = ÇØ´ç Ç×¸ñ
// cmt = »ç¿ëÀÚ¿¡°Ô ÁÙ Ç×¸ñ¸í
// astr = Çã¿ë°¡´ÉÇÑ ¹®ÀÚ¿­
// lmin = ÃÖ¼Ò ±æÀÌ
// lmax = ÃÖ´ë ±æÀÌ
function rcheck2(target, cmt, astr, lmin, lmax)
{
	var i;
	if (realStrLength(target) < lmin || realStrLength(target) > lmax) {
		if (lmin == lmax) alert(cmt + '´Â ' + lmin + ' ÀÚ¸® ÀÌ¾î¾ß ÇÕ´Ï´Ù');
		else alert(cmt + '´Â ' + lmin + ' ~ ' + lmax + ' ÀÚ¸® ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		return true
	}
	if (astr.length > 1) {
		for (i=0; i< target.length; i++)
			if(astr.indexOf(target.substring(i,i+1))<0) {
				alert(cmt + '¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù');
				return true
			}
	}
	return false
}

// ÇØ´ç Ç×¸ñÀÇ ÀÚ¸´¼ö¿Í ¿øÇÏ´Â ¾Ê´Â ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ´ÂÁö Ã¼Å©
// target = ÇØ´ç Ç×¸ñ
// cmt = »ç¿ëÀÚ¿¡°Ô ÁÙ Ç×¸ñ¸í
// astr = Çã¿ë°¡´ÉÇÑ ¹®ÀÚ¿­
// lmin = ÃÖ¼Ò ±æÀÌ
// lmax = ÃÖ´ë ±æÀÌ
function rcheck3(target, cmt, lmax)
{
	var i;
	var t = trimLR(target.value);
	var mid = Math.floor(lmax/2);
	if (realStrLength(t) < 1 || realStrLength(t) > lmax) {
		alert(cmt + '´Â ÇÑ±Û ' + mid + ', ¿µ¹®¹×¼ýÀÚ ' + lmax + 'ÀÚ¸® ÀÌ³»·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù');
		if(target) target.select();
		return true
	}
	return false
}

//*********************************************************
// Å°º¸µåÀÇ Å°°¡ ¼ýÀÚÀÏ°æ¿ì¿¡¸¸ ÀÔ·ÂÀ» ¹Þµµ·Ï
// text box¿¡ Ãß°¡ : onkeypress="return check_key_number(event.keyCode)"
//*********************************************************
function check_key_number(ch) {
	if(ch>47 && ch<58)	return true;
	else	return false;
}

// ÀÔ·ÂÀÚ·á°¡ DATE TYPE¿¡ ¸Â´ÂÁö Ã¼Å©
// yyyymmdd = ÇØ´ç Ç×¸ñ
function checkDate(ymd)
{
	var yyyy;
	var mm;
	var dd;
	if ( ymd.length != 8 ) return true;
	if ( checkNumber(ymd) ) { alert('¿©±ä°¡'); return true; }
	yyyy = parseInt(ymd.substring(0,4));
	mm = parseInt(ymd.substring(4,6));
	dd = parseInt(ymd.substring(6,8));

	if (ymd.substring(4,6) == '08') mm = 8;
	else if (ymd.substring(4,6) == '09') mm =9;

	if (ymd.substring(6,8) == '08') dd = 8;
	else if (ymd.substring(6,8) == '09') dd =9;

	if (yyyy < 1900) return true;
	if ((mm < 1) || (mm > 12)) return true;
	if ((dd < 1) || (dd > getLastDay(yyyy, mm))) return true;
	return false;
}

// ÇØ´ç¿ùÀÇ ÃÖÁ¾ÀÏÀ» ¾ò¾î¿Â´Ù
// year = ³âµµ
// month = ¿ù
function getLastDay(year, month)
{
	var Last_Mon = new Array(31,29,31,30,31,30,31,31,30,31,30,31);
	var Mon2;

	if (year % 4 == 0)
		if (year % 100 == 0)
			if (year % 400 == 0)
				Mon2 = true;
			else
				Mon2 = false;
		else
			Mon2 = true;
	else
		Mon2 = false;

	Last_Mon[1] = Mon2 ? 29 : 28;

	return Last_Mon[month - 1];
}

// ÀÔ·ÂÀÚ·á°¡ ±Ý¾×ÀÌ ¸Â´ÂÁö Check
// num = ÇØ´ç Ç×¸ñ
function checkNumber(num)
{
	if ( isNaN(num) ) return true;

	var m = parseFloat(num);

	if ( m < 1 ) return true;
	return false;
}


/**
* ¸Å°³º¯¼ö·Î ¹ÞÀº ¹®ÀÚ¿­¿¡¼­ s1À» s2·Î ´ëÃ¼ÇÑ´Ù.
* @param String str
* @param String s1
* @param String s2
* @return String
*/
function replaceStr( str1, s1, s2 )
{
	var index;
	var len = s1.length;
	var str = str1;

	while( (index = str.indexOf(s1))!=-1 )
	{
//		alert( str + ':' +index );
		var d1 = str.substring(0, index);
		var d2 = str.substring(index+len, str.length);

		str = d1+s2+d2;
	}

	//alert( 'result : '+str);
	return str;
}

function goXurl(url, cert)
{
	var key ;

	if (cert == 'true')
	{
		key  = getSessionKey() ;
	//	alert(key);
	//	alert('/servlet' + url + '&q=' + key);

		document.location.href = '/servlet' + url + '&q=' + key ;
	}
	else
	{
		document.location.href=url ;
	}

}

function isFunction(a)
{
    return typeof a == 'function';
}

function isObject(a)
{
    return (a && typeof a == 'object') || isFunction(a);
}




function number_format(numstr)
{

	var numstr = String(numstr);

	var re0 = /(\d+)(\d{3})($|\..*)/;

	if(re0.test(numstr))
	{
		return numstr.replace(re0, function(str,p1,p2,p3) { return number_format(p1) + "," + p2 + p3; } );
	}
	else return numstr;

}


function getOBJ(objName){
	return document.getElementById(objName);
}



//[kes] table object ³»ÀÇ row ¸ðµÎ Áö¿ì±â
function removeTable(tbl)
{
	var cnt = tbl.rows.length;
	for(var i=cnt-1 ; i >= 0 ; --i) tbl.deleteRow(i);
}

function CMsgBox()
{
	this.win		= window;
	this.v_isYes	= false;
	this.v_type		= '';
	this.v_msgcd	= '';
	this.v_msg		= '';
	this.show		= fn_show;
	this.result		= fn_result;

	function fn_show ( _type, _msgcd, _msg )
	{
		this.v_type		= _type;
		this.v_msgcd	= _msgcd;
		this.v_msg		= _msg	;
		this.v_isYes	= false	;

//		window.showModalDialog(
//			'/common/modalwindow.html?/common/CMsgBox.html'
//			,this
//			,'dialogWidth:315px;dialogHeight:150px;center:yes;help:no;resizable:no;status:no;unadorned:no;dialogHide:no;scroll:no;');
		window.showModalDialog(
			'/common/modalwindow.html?/common/CMsgBox2.html'
			,this
			,'dialogWidth:381px;dialogHeight:149px;center:yes;help:no;resizable:no;status:no;unadorned:no;dialogHide:no;scroll:no;');

	}
	function fn_result()
	{
		return v_isYes;
	}
}

var _v_MsgBox = new CMsgBox();



//[KES] objNm ÀÇ display ¼Ó¼º º¯°æ
function styleDisplaySwitch(objNm, flag)
{
	var obj = document.getElementById(objNm);

	if(flag == undefined || flag == null || flag == "")
	{
		var display = obj.style.display;

		if(display == "block" || display == "") obj.style.display = "none";
		else if(display == "none") obj.style.display = "block";
	}
	else
	{
		if(flag == "Y")	obj.style.display = "block";
		else if(flag == "N") obj.style.display = "none";
	}
}



//[KES] objNm ÀÇ display ¼Ó¼º º¯°æ
function styleDisplayInlineSwitch(objNm, flag)
{
	var obj = document.getElementById(objNm);

	if(flag == undefined || flag == null || flag == "")
	{
		var display = obj.style.display;

		if(display == "inline" || display == "block" || display == "") obj.style.display = "none";
		else if(display == "none") obj.style.display = "inline";
	}
	else
	{
		if(flag == "Y")	obj.style.display = "inline";
		else if(flag == "N") obj.style.display = "none";
	}
}



//[KES] strÀÇ bytes Å©±â ¸®ÅÏ
function bytesLength(str)
{
	var str_len = str.length;
	var unicode_len = 0;

	var unicode = escape(str);
	if(unicode.indexOf("%u") != -1)
	{
		unicode_len = unicode.split("%u").length - 1; //split Æ¯¼º¶§¹®¿¡ -1 ÇØÁÜ
	}

	return str_len + unicode_len;

}


//[KES] reverse ¹®ÀÚ µÚÁý±â
String.prototype.reverse = function()
{
	return this.split("").reverse().join("");
}




//[KES] ¼ýÀÚ Æ÷¸ËÅÍ # 0 , . Á¶ÇÕ
//str :  Àº ¼ýÀÚ È¤Àº ¹®ÀÚµÑ´Ù °¡´É. (¹®ÀÚÀÇ °æ¿ì ¼ýÀÚ Å¸ÀÔÀ¸·Î Çüº¯È¯½Ã ¹®Á¦¾ø´Â ¹®ÀÚÀÌ¾î¾ß ÇÔ)
//format : ¼ýÀÚÇü Æ÷¸Ë #,##0.00 °ú °°Àº Çü½ÄÀ¸·Î # 0 , . ÀÇ Á¶ÇÕ ÀÌ¿ë.
function numFormat( str, format )
{


	if( typeof ( str ) == "number" ) str = "" + str;
	else if( typeof ( str ) == "string" );
	else return str;


	var oexp = new RegExp( "^(#|0)*((#|0),(#|0)+|(#|0)*)\.?(#|0)*$", "gi" );

	// format ¹× number Ã¼Å©
	if( !oexp.test( format ) ) return str;
	if( str == null || isNaN( str ) ) return str;


	var ifmt = format.split( "." )[ 0 ];
	var ffmt = ( format.split( "." )[ 1 ] == undefined ? "" : format.split( "." )[ 1 ] );


	var inum = str.split( "." )[ 0 ];
	var fnum = ( str.split( "." )[ 1 ] == undefined ? "" : str.split( "." )[ 1 ] );




	// Á¤¼ö ºÎºÐ Ã³¸®
	var tmpIfrm = ifmt.reverse( ).replace( ",", "" );

	var ifmtLen = tmpIfrm.length;
	var inumLen = inum.length;
	if( ifmtLen > inumLen )
	{
		var zero = new RegExp( "0", "gi" );
		var zeroLen = 0;
		try
		{
			zeroLen = tmpIfrm.substr( inumLen ).match( zero ).length;
		}
		catch(e)
		{
		}
		for ( var i = 0 ; i < zeroLen ; ++i, inum = "0" + inum );

	}


	var commaPosition = ifmt.reverse( ).indexOf( "," );
	if( commaPosition > -1 )
	{
		var num = new RegExp( "\\d{" + commaPosition + "}|\\d+", "gi" );
		inum = inum.reverse( ).match( num ).join( "," ).reverse( );
	}




	// ¼Ò¼ö ºÎºÐ Ã³¸®
	var ffmtLen = ffmt.length;
	fnum = fnum.substring( 0, ffmt.length );
	for ( ; ffmtLen > fnum.length ; fnum = "" + fnum + "0" );
	var shapFlag = true;

	var fbuf = "";

	for ( var i = ffmtLen ; i > 0 ; --i )
	{
		var fmtTmp = ffmt.charAt( i - 1 );
		var numTmp = fnum.charAt( i - 1 );

		if( fmtTmp == "#" && shapFlag )
		{
			if( numTmp != "0" )
			{
				fbuf = "" + numTmp + fbuf;
				shapFlag = false;
			}
		}
		else fbuf = "" + numTmp + fbuf;
	}

	var rtn = "";




	// °á°ú ¸®ÅÏ
	if( format.indexOf( "." ) > -1 ) rtn = inum + "." + fbuf;
	else rtn = inum;

	return rtn;




}// numFormat



//[KES] oSelect °´Ã¼ÀÇ option ¸ðµÎ Áö¿ì±â
function optionClear( oSelect )
{
	for( var i=oSelect.options.length-1; i>=0; i--)
	{
	   oSelect.options[i]=null;
	}
}


//[KES] _name ÀÌ¸§À¸·Î _value °ªÀ» °¡Áø option °´Ã¼¸¦ ¸®ÅÏÇØ ÁØ´Ù.
function createOption(_name, _value)
{
	var opt = new Option();
	opt.innerText = _name;
	opt.value = _value;

	return opt;
}



//[KES] ÃÖ±Ù ÀÔ·ÂµÈ keyÁß ´Ù½Ã, ¸¶Ä§Ç¥, ¼ýÀÚ¸¸ ÀÎÁ¤
//onKeyPress ÀÌº¥Æ®¸¦ ÅëÇØ¼­¸¸ »ç¿ë°¡´É
function floatKeyCheck(obj) //float
{
	var key = event.keyCode;

	if(key != 45 && key != 46 && !( key >= 48 && key <= 57 ) )
	{
		event.keyCode = null;
	}

}//floatKeyCheck




//[KES] ÃÖ±Ù ÀÔ·ÂµÈ keyÁß ¸¶Ä§Ç¥, ¼ýÀÚ¸¸ ÀÎÁ¤
//onKeyPress ÀÌº¥Æ®¸¦ ÅëÇØ¼­¸¸ »ç¿ë°¡´É
function ufloatKeyCheck(obj) //unsigned float
{
	var key = event.keyCode;

	if(key != 46 && !( key >= 48 && key <= 57 ) )
	{
		event.keyCode = null;
	}

}//ufloatKeyCheck




//[KES] ÃÖ±Ù ÀÔ·ÂµÈ keyÁß ´Ù½Ã, ¼ýÀÚ¸¸ ÀÎÁ¤
//onKeyPress ÀÌº¥Æ®¸¦ ÅëÇØ¼­¸¸ »ç¿ë°¡´É
function intKeyCheck(obj) //int
{
	var key = event.keyCode;

	if(key != 45 && !( key >= 48 && key <= 57 ) )
	{
		event.keyCode = null;
	}

}//intKeyCheck



//[KES] ÃÖ±Ù ÀÔ·ÂµÈ keyÁß ¼ýÀÚ¸¸ ÀÎÁ¤
//onKeyPress ÀÌº¥Æ®¸¦ ÅëÇØ¼­¸¸ »ç¿ë°¡´É
function uintKeyCheck(obj) //unsigned int
{
	var key = event.keyCode;

	if( !( key >= 48 && key <= 57 ) )
	{
		event.keyCode = null;
	}


}//uintKeyCheck

///** ÅõÀÚÀÚ À¯ÀÇ»çÇ× ¸Å¸Å ¾È³» ÆË¾÷ OBJ
// */
document.write ( '<script src=/common/invest_infrm/CTradeRule.js></script>' );



function fn_drawPageNumbers ( p_naviFunc, pageNo, pageCount )
{
	var targetHtml		= '';

	var steps			= 10;	// ÇÑ¹ø¿¡ º¸¿©ÁÙ ÆäÀÌÁöÀÇ °³¼ö
	var startPage		= (pageNo-1) - ((pageNo-1) % steps)+1; 	// ½ÃÀÛÆäÀÌÁö
	var endPage;										 	// ³¡ÆäÀÌÁö

	if (startPage+steps-1 > pageCount)	endPage = ( pageCount * 1 );
	else								endPage = ( startPage + steps - 1 ) * 1;

	var previousBlockNo	= 1;
	var previousNo		= startPage-steps;
	var nextNo			= endPage+1;
	var nextBlockNo		= (pageCount-1) - ((pageCount-1) % steps)+1;


	if ( endPage != 0 )
	{
		if ((startPage-steps) < 1)
		{
			targetHtml = targetHtml + '<img src="/imgs/finance/common/btn/btn_pre_block.gif" class="b">';
			targetHtml = targetHtml + '<img src="/imgs/finance/common/btn/btn_pre.gif" class="b">&nbsp;&nbsp;';
		} else
		{
			targetHtml = targetHtml + '<a href="javaScript:'+p_naviFunc+'(' + previousBlockNo +  ')"><img src="/imgs/finance/common/btn/btn_pre_block.gif" class="b"></a>';
			targetHtml = targetHtml + '<a href="javaScript:'+p_naviFunc+'(' + previousNo +  ')"><img src="/imgs/finance/common/btn/btn_pre.gif" class="b"></a>&nbsp;&nbsp;';
		}

		for(var i = startPage; i <= endPage; i++)
		{
			if (i == pageNo)
				targetHtml = targetHtml + '<b>' + i + '</b>&nbsp;&nbsp;';
			else
				targetHtml = targetHtml + '<a href="javaScript:'+p_naviFunc+'(' + i +  ')">' + i + '</a>&nbsp;&nbsp;';
		}

		if ((startPage+steps) >= pageCount)
		{
			targetHtml = targetHtml + '<img src="/imgs/finance/common/btn/btn_next.gif" class="b">';
			targetHtml = targetHtml + '<img src="/imgs/finance/common/btn/btn_next_block.gif" class="b">';
		} else
		{
			targetHtml = targetHtml + '<a href="javaScript:'+p_naviFunc+'(' + nextNo +  ')"><img src="/imgs/finance/common/btn/btn_next.gif" class="b"></a>';
			targetHtml = targetHtml + '<a href="javaScript:'+p_naviFunc+'(' + nextBlockNo +  ')"><img src="/imgs/finance/common/btn/btn_next_block.gif" class="b"></a>';
		}
	}
	return targetHtml;
}

function  initIBankAccount(iBankAccountNM) {
	var _iBankAcc = document.getElementById(iBankAccountNM);

	if (_iBankAcc == null ) return ;

	var _cookieAccount = getCookie('_i_account');


	if ( _cookieAccount != null && _cookieAccount.trim().length == 11 )
		_iBankAcc.value = _cookieAccount;

	if (_iBankAcc.value == "" )
		_iBankAcc.value = _iBankAcc.options[0].value;

}



//false : ¼ýÀÚ, true : ¼ýÀÚ¾Æ´Ô
function isNaNExt(argu)
{
	//null, ºó½ºÆ®¸µÀÌ isNaN¿¡¼­ false ¸®ÅÏµÇ´Â°ÍÀ» ¸·±âÀ§ÇØ
	if(argu == null || argu == "") return true;
	else return isNaN(argu);
}



//id ´Â select object ÀÇ id ¸¦ ÀÇ¹ÌÇÏ¸ç value ´Â option ÀÇ value Áß ÀÏÄ¡¸¦ ¿øÇÏ´Â value °ªÀ» ÀÇ¹ÌÇÑ´Ù.
// ex) id ÀÇ select ¿¡¼­ value °ªÀ» °¡Áø option °´Ã¼ ¸®ÅÏ
function getOptionObj(id, value)
{
	var obj = document.getElementById(id);

	var cnt = obj.length;

	for(var i=0 ; i<cnt ; ++i)
	{
		if( obj.options[i].value  == value) return obj.options[i];
	}

	return null;
}



function encode64(input) {
	var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

	var output = "";
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;
	do {
		chr1=input.charCodeAt(i++);
		chr2=input.charCodeAt(i++);
		chr3=input.charCodeAt(i++);
		
		enc1 = chr1 >> 2;
		enc2 = ((chr1 & 3)<<4) | (chr2 >> 4);
		enc3 = ((chr2 & 15)<<2) | (chr3 >> 6);
		enc4 = chr3 & 63;
		if (isNaN(chr2)){
			enc3 =  enc4 = 64;
		} else if (isNaN(chr3)){
			enc4 = 64;
		}
		
		output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
		
	}while(i < input.length);
	
	return output;
}


function decode64(input){
	var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
	var output = "";
	var chr1, chr2, chr3;
	var enc1, enc2, enc3, enc4;
	var i = 0;
	input = input.replace(/[^A-Za-z0-9\+\/\=]/g,"");
	
	do {
		enc1=keyStr.indexOf(input.charAt(i++));
		enc2=keyStr.indexOf(input.charAt(i++));
		enc3=keyStr.indexOf(input.charAt(i++));
		enc4=keyStr.indexOf(input.charAt(i++));
		
		chr1 = (enc1 << 2) | (enc2 >> 4);
		chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);		
		chr3 = ((enc3 & 3) << 6) |enc4;
		output = output + String.fromCharCode(chr1);
		if (enc3 != 64){
			output =  output + String.fromCharCode(chr2);
		}
		if (enc4 != 64){
			output =  output + String.fromCharCode(chr3);
		}		
	}while(i < input.length);
	
	return output;
}
 
function decode64Han(str){
	return unescape(decode64(str));
}


function accountDiv326(acnt)
{
	if(acnt.length == 11)
	{
		return acnt.substr(0,3) + "-" + acnt.substr(3,2) + "-" + acnt.substr(5);
	}
	else
	{
		return acnt;
	}
}