function new_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) 
{ 
  toolbar_str = toolbar ? 'yes' : 'no'; 
  menubar_str = menubar ? 'yes' : 'no'; 
  statusbar_str = statusbar ? 'yes' : 'no'; 
  scrollbar_str = scrollbar ? 'yes' : 'no'; 
  resizable_str = resizable ? 'yes' : 'no'; 
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str); 
} 

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


String.prototype.trim = function()
{
        //return this.replace(/^\s*(\b.*\b|)\s*$/, "$1"); // ¹®ÀåÀÇ ¾Õ°ú µÚÀÇ °ø¹é Á¦°Å
        a = this
        //alert(a)
        var search = 0
        while ( a.charAt(search) == " "){
                search = search + 1
        }

    a = a.substring(search, (a.length))
    search = a.length - 1
    while (a.charAt(search) ==" ") {
                search = search - 1
    }
    return a.substring(0, search + 1)
}

/**
 * ÇØ´ç ÄÃ·³¿¡ Ä¿¼­¸¦ À§Ä¡
 * ex) <body onLoad="initCursor(document.login.emp_id)">
 *     <form name="login">
 *     <input type="text" name="emp_id">
 */
function initCursor(ColName) // ColName - Column Name
{
	ColName.focus();	// Àü´Þ¹ÞÀº ColName¿¡ focus À§Ä¡
}

/**
 * ÇØ´ç FormÀ» SubmitÇÔ(post)
 */
function Submit(FormName,target) // SvName - Servlet Name
{
    FormName.action=target;
    FormName.method="post"; 
    FormName.submit(); 
}

/**
 * ÇØ´ç FormÀ» SubmitÇÔ(get)
 */
function SubmitGet(FormName,target) // SvName - Servlet Name
{
    FormName.action=target;
    FormName.method="get"; 
    FormName.submit(); 
}


/**
 * ÇØ´ç FormÀ» resetÇÔ
 */
function resetForm(FormName) {
	FormName.reset();
}


/**
 * ÇØ´ç ÄÃ·³¿¡ ÀÔ·ÂÇÑ µ¥ÀÌÅÍÀÇ À¯È¿ÇÑ ¾ÆÀÌµð Ã¼Å©
 */

function chkId(ColName,ColLabel)
{
    if(isValidId(ColName) == true && ColName.value.length >= 4 && ColName.value.length <= 15
    )
    {
        return true;
    }
    else
    {
        alert("'" + ColLabel + "'´Â(Àº) À¯È¿ÇÑ ¾ÆÀÌµð°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
		if(!isDisabled(ColName))
	        ColName.focus();
		if(!isDisabled(ColName))
	        ColName.select();
        return false;
    }
}

function isValidId(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz0123456789_";
    return containsCharsOnly(input,chars);
}


/**
 * ÇØ´ç ÄÃ·³¿¡ ÀÔ·ÂÇÑ µ¥ÀÌÅÍÀÇ ±æÀÌ Ã¼Å©
 */
function chkLength(ColName,ColLabel,Length)	// ColLabe - column label, Length - column length
{
	if(ColName.value.length >= Length)	
	{
		return true;
	}		
	else
	{
		alert("'" + ColLabel + "'´Â ÃÖ¼Ò'" + Length + "'ÀÚ¸® ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
		ColName.focus();
		ColName.select();
		return false;
	}
}

/**
 * ÇØ´ç ÄÃ·³¿¡ ÀÔ·ÂÇÑ µ¥ÀÌÅÍÀÇ ±æÀÌ Ã¼Å©
 */
function chkMaxLength(ColName,ColLabel,Length)	// ColLabe - column label, Length - column length
{
	if(ColName.value.length < Length)	
	{
		return true;
	}		
	else
	{
		alert("'" + ColLabel + "'´Â ÃÖ´ë '" + Length + "'ÀÚ¸®ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
		ColName.focus();
		ColName.select();
		return false;
	}
}

/**
 * ÇØ´ç ÄÃ·³ÀÇ NullÃ¼Å©¸¦ ÇÔ
 */
function chkNull(ColName,ColLabel)	// ColLabe - column label
{
	if(ColName.value.length != "")	
	{
		return true;
	}		
	else
	{
		alert("'" + ColLabel + "'¿¡ °ªÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
		ColName.focus();
		return false;
	}
}

/**
 * ÀÔ·Â°ª¿¡ ½ºÆäÀÌ½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function chkSpace(ColName,ColLabel)
{
    if(space(ColName.value) == true)
    {
        return true;
    }      
    else
    {
        alert("'" + ColLabel + "'¿¡ °ø¹éÀÌ ÀÖ½À´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä!");
        ColName.focus();
        ColName.select();
        return false;
    }
}

function space(name) {
    var ch = '\0';
    for (var i = 0, ch = name.charAt(i);
        (i < name.length); ch = name.charAt(++i))
    {
        if (ch == ' ')
             return false;
    }
    return true;
}

/**
 * ¼ýÀÚÃ¼Å©
 */
function chkDigit(ColName,ColLabel)
{
    if(isNumber(ColName) == true)
    {
        return true;
    }
    else
    {
        alert("'" + ColLabel + "'´Â(Àº) ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
        ColName.focus();
        ColName.select();
        return false;
    }
}

function chkAmount(ColName, ColLabel, amount)
{
    if ( parseInt(ColName.value) >= parseInt(amount) )
    {
        return true;
    } else
    {
        alert(ColLabel+'Àº '+amount+' ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
        ColName.focus();
        ColName.select();
        return false;
    }
}

/**
 * ¼±ÅÃµÈ ¶óµð¿À¹öÆ°ÀÌ ÀÖ´ÂÁö Ã¼Å©
 */
function chkRadio(ColName, ColLabel)
{
    if( ColName.checked ){
    	return true;
    }
    for ( var i = 0 ; i < ColName.length ; i++ )
    {
        if ( ColName[i].checked )
        {
             return true;
        }
    }
    alert("'" + ColLabel + "'¿¡ °ªÀ» ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À!");
    return false;
}

/**
 * ¼±ÅÃµÈ Ã¼Å©¹Ú½º°¡ ÀÖ´ÂÁö Ã¼Å©
 */
function chkBox(ColName, ColLabel) {
    return chkRadio(ColName, ColLabel);
}

/**
 * ÀÌ¸ÞÀÏÁÖ¼Ò Ã¼Å©ÇÏ±â
 */
function chkEmail(ColName, ColLabel)
{
    if (isValidEmail(ColName) == true) {
        return true;
    }else
    {
        alert("\nÀûÇÕÇÑ " +ColLabel+ "ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
        ColName.focus();
        ColName.select();
        return false;
    }
}

/**
 * È¨ÆäÀÌÁöÁÖ¼Ò Ã¼Å©ÇÏ±â
 */
function chkHomepage(ColName, ColLabel)
{
    if (isValidHomepage(ColName) == true) {
        return true;
    }else
    {
        alert("\nÀûÇÕÇÑ " +ColLabel+ "HomepageÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù.");
        ColName.focus();
        ColName.select();
        return false;
    }
}

/**
 * ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©ÇÏ±â
 */
function chkJuminNo(ColName1, ColName2)
{
        if (ColName1.value == "" && ColName2.value == "") {
                alert("ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
                ColName1.focus();
                return false;
        }
        if (check_jumin(ColName1.value, ColName2.value)) {
                return true;
        } else {
        	alert("ÀûÇÕÇÑ ÁÖ¹Î¹øÈ£°¡ ¾Æ´Õ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
                ColName1.focus();
                ColName1.select();
                return false;
        }
}
 
function check_jumin(val1, val2)
{
        var tmp1,tmp2
        var t1, t2, t3, t4, t5, t6, t7, t11, t12, t13, t14, t15, t16, t17
        tmp1 = val1.substring(2,4);
        tmp2 = val1.substring(4);
        if ((tmp1 < "01") || (tmp1 > "12")) return false;
        if ((tmp2 < "01") || (tmp2 > "31")) return false;
        t1 = val1.substring(0,1);
        t2 = val1.substring(1,2);
        t3 = val1.substring(2,3);
        t4 = val1.substring(3,4);
        t5 = val1.substring(4,5);
        t6 = val1.substring(5,6);
        t11 = val2.substring(0,1);
        t12 = val2.substring(1,2);
        t13 = val2.substring(2,3);
        t14 = val2.substring(3,4);
        t15 = val2.substring(4,5);
        t16 = val2.substring(5,6);
        t17 = val2.substring(6,7);
        var tot = t1*2 + t2*3 + t3*4 + t4*5 + t5*6 + t6*7;
        tot += t11*8 + t12*9 + t13*2 + t14*3 + t15*4 + t16*5 ;
        var result = tot % 11;
        result = (11 - result) % 10;
        if (result != t17) return false;
        return true;
}



/**
 * ÇÑ±Û ÇÑ±ÛÀÚ¸¦ 2byte·Î ÀÎ½ÄÇÏ¿©, IEµç Netscapeµç 
 * Á¦´ë·Î byte±æÀÌ¸¦ ±¸ÇØ ÁÝ´Ï´Ù.
 */
function getByteLength(input) {
    var byteLength = 0;
    for (var inx = 0; inx < input.value.length; inx++) {
        var oneChar = escape(input.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}

function getChkCnt(ColName)
{
	var cnt = 0;
    if( ColName.checked ){
        cnt = 1;
    }
    for ( var i = 0 ; i < ColName.length ; i++ )
    {
        if ( ColName[i].checked )
        {
			cnt++;
        }
    }
    return cnt; 
}

/**
 * ¿£ÅÍÅ° ÀÎÁö Check
 */
function checkEnter(e)
{
    isNs4 = (document.layers)? true:false;
    isIe4 = (document.all)? true:false;

    if (isNs4){
        var key = e.which
        var el = e.target;
        var str = String(e.target);
        str = str.toLowerCase();
    } else {
        var key = event.keyCode;
        var el = event.srcElement;
    }
	//alert("Key"+key);

    /* 13 : Enter */
    if (key == 13) {
		return true;
    }
    return false;
}

/**
 * ÆûÀÌµ¿(ÀÚ¸®¼ö Ã¼Å©)
 * ex) <input type="password" name= "card_1" onkeyup="moveForm(this, document.form1.card_2, 4);">
 */
function moveForm(ColName1, ColName2, Length)
{
  if(ColName1.value.length == Length){
     ColName2.focus();
  }
}

/**
 * ÀÔ·Â°ª¿¡ Æ¯Á¤ ¹®ÀÚ(chars)°¡ ÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¦ Çã¿ëÇÏÁö ¾ÊÀ¸·Á ÇÒ ¶§ »ç¿ë
 * ex) if (containsChars(form.name,"!,*&^%$#@~;")) {
 *         alert("ÀÌ¸§ ÇÊµå¿¡´Â Æ¯¼ö ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
 *     }
 */
function containsChars(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) != -1)
           return true;
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ Æ¯Á¤ ¹®ÀÚ(chars)¸¸À¸·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 * Æ¯Á¤ ¹®ÀÚ¸¸ Çã¿ëÇÏ·Á ÇÒ ¶§ »ç¿ë
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("Ç÷¾×Çü ÇÊµå¿¡´Â A,B,O ¹®ÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
 *     }
 */
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºªÀÎÁö Ã¼Å©
 * ¾Æ·¡ isAlphabet() ºÎÅÍ isNumComma()±îÁöÀÇ ¸Þ¼Òµå°¡
 * ÀÚÁÖ ¾²ÀÌ´Â °æ¿ì¿¡´Â var chars º¯¼ö¸¦ 
 * global º¯¼ö·Î ¼±¾ðÇÏ°í »ç¿ëÇÏµµ·Ï ÇÑ´Ù.
 * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 *     var lowercase = "abcdefghijklmnopqrstuvwxyz"; 
 *     var number    = "0123456789";
 *     function isAlphaNum(input) {
 *         var chars = uppercase + lowercase + number;
 *         return containsCharsOnly(input,chars);
 *     }
 */
function isAlphabet(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ´ë¹®ÀÚÀÎÁö Ã¼Å©
 */
function isUpperCase(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª ¼Ò¹®ÀÚÀÎÁö Ã¼Å©
 */
function isLowerCase(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ª¿¡ ¼ýÀÚ¸¸ ÀÖ´ÂÁö Ã¼Å©
 */
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¾ËÆÄºª,¼ýÀÚ·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    return containsCharsOnly(input,chars);
}

function isAlphaNumSlash(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&*+-./=?@^_`{|}";
    return containsCharsOnly(input,chars);
}



/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,´ë½Ã(-)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumDash(input) {
    var chars = "-0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,ÄÞ¸¶(,)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumComma(input) {
    var chars = ",0123456789";
    return containsCharsOnly(input,chars);
}

/**
 * ÀÔ·Â°ªÀÌ ¼ýÀÚ,Á¡(.)·Î µÇ¾îÀÖ´ÂÁö Ã¼Å©
 */
function isNumPoint(input) {
    var chars = ".0123456789";
    return containsCharsOnly(input,chars);
}


/**
 * ÀÔ·Â°ª¿¡¼­ ÄÞ¸¶¸¦ ¾ø¾Ø´Ù.
 */
function removeComma(input) {
    return input.value.replace(/,/gi,"");
}


/**
 * ÀÔ·Â°ª¿¡¼­ Æ¯Á¤ Character¸¦ ´Ù¸¥ Character·Î ¹Ù²Û´Ù.
 * *original function   a -> z
 *function replaceChars(entry) {
 *	out = "a"; // replace this
 *	add = "z"; // with this
 *	temp = "" + entry; // temporary holder
 *
 *	while (temp.indexOf(out)>-1) {
 *		pos= temp.indexOf(out);
 *		temp = "" + (temp.substring(0, pos) + add + 
 *		temp.substring((pos + out.length), temp.length));
 *	}
 *	document.subform.text.value = temp;
 *}
 */
function replaceChars(entry, out, add) {
    temp = "" + entry.value; // temporary holder

    while (temp.indexOf(out)>-1) {
        pos= temp.indexOf(out);
        temp = "" + (temp.substring(0, pos) + add + 
        temp.substring((pos + out.length), temp.length));
    }
    return temp;
}

/**
 * ÀÔ·Â°ªÀÌ »ç¿ëÀÚ°¡ Á¤ÀÇÇÑ Æ÷¸Ë Çü½ÄÀÎÁö Ã¼Å©
 * ÀÚ¼¼ÇÑ format Çü½ÄÀº ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ 'regular expression'À» ÂüÁ¶
 */
function isValidFormat(input,format) {
	return isValidFormatText(input.value, format);
}

function isValidFormatText(str,format) {
    if (str.search(format) != -1) {
        return true; //¿Ã¹Ù¸¥ Æ÷¸Ë Çü½Ä
    }
    return false;
}

/**
 * ÀÔ·Â°ªÀÌ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å©
 */
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return isValidFormat(input,format);
}

/**
 * ÀÔ·Â°ªÀÌ È¨ÆäÀÌÁö Çü½ÄÀÎÁö Ã¼Å©
 */
function isValidHomepage(input) {
//	if(input.value.substring(0,7) != "http://") return false;
//	return true;
  var format = /^((\w|[\-\.])+).((\w|[\-\.])+)\.([A-Za-z]+)$/;
  return isValidFormatText(input.value ,format);
}

/**
 * ÀÔ·Â°ªÀÌ ÀüÈ­¹øÈ£ Çü½Ä(¼ýÀÚ-¼ýÀÚ-¼ýÀÚ)ÀÎÁö Ã¼Å©
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}

/**
 * µÎ ÀÔ·Â°ªÀÌ ¼­·Î °°ÀºÁö Ã¼Å©
 */
function chkValue(ColName, ColName2, ColLabel, ColLabel2)
{
    if ( ColName.value == ColName2.value ) {
        return true;
    } else {
        alert("'" + ColLabel + "'¿Í(°ú) '" + ColLabel2+"' ÀÌ(°¡) ¼­·Î ´Ù¸¨´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");
        ColName.value = "";
        ColName2.value = "";
        ColName.focus();
        return false;
    }
}

/**
 * Ã¹¹øÂ° ÀÔ·Â°ªÀÌ µÎ¹øÂ°°ªÀ¸·Î ½ÃÀÛÇÏ´ÂÁö Ã¼Å©ÇÑ´Ù.
 * startWith(FormName.call_nm1, "/tnctec/", 'URL')
 */
function startWith(input,chars,label) {
       if (input.value.indexOf(chars) != 0) {
           return false;
       } else return true;
}

/**
 * ÀÔ·Â°ªÀÇ byte ¼ö¸¦ Ã¼Å©ÇÑ´Ù.
 * chkByte(FormName.call_nm1, 50, 'URL')
 */
function chkByte(input, length, label)
{
    if ( getByteLength(input) > length ) {
        alert("'"+label+"' Àº(´Â) "+length+"Byte¸¦ ³ÑÀ»\n ¼ö ¾ø½À´Ï´Ù. ÇöÀç "+getByteLength(input) + " Byte");
        return false;
    } else
        return true;
}

/**
 * ÀÔ·Â°ªÀÇ Á¤È®ÇÑ ³¯Â¥¸¦ Ã¼Å©ÇÑ´Ù.
 * ÀÔ·ÂµÇ´Â value Çü½ÄÀº yyyymmdd 
 */
function chkDate(ColName, ColLabel){

    var datein = ColName.value;
    var sdate =new Array();

    sdate[2] = datein.substring(0,4);
    sdate[0] = datein.substring(4,6);
    sdate[1] = datein.substring(6,8);

    var indate = sdate[0] + "-" + sdate[1] + "-" + sdate[2];

    var chkDate=new Date(Date.parse(indate))

    var cmpDate=(chkDate.getMonth()+1)+"/"+(chkDate.getDate())+"/"+(chkDate.getYear())
    var indate2=(Math.abs(sdate[0]))+"/"+(Math.abs(sdate[1]))+"/"+(Math.abs(sdate[2]))
    if (indate2!=cmpDate){
        alert( ColLabel + " ÀÔ·ÂÇü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");

        ColName.focus();
        return false;
    }
    else {
        if (cmpDate=="NaN/NaN/NaN"){
            alert( ColLabel + " ÀÔ·ÂÇü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");

        	ColName.focus();
            return false;
        }
        else {
//          alert("ÀÔ·ÂÇÏ½Å ³¯Â¥´Â Á¤È®ÇÕ´Ï´Ù!");
            return true;
        }
    }
}

/**
 * ÀÔ·Â°ªÀÇ Á¤È®ÇÑ ³¯Â¥¸¦ Ã¼Å©ÇÑ´Ù.
 * ÀÔ·ÂµÇ´Â value Çü½ÄÀº yyyymmdd
 */
function dateCheck(input, ColLabel){

    var sdate =new Array();

    sdate[2] = input.substring(0,4);
    sdate[0] = input.substring(4,6);
    sdate[1] = input.substring(6,8);

	if (sdate[2] < 2000)
		sdate[2] = sdate[2].substring(2,4);
    var indate = sdate[0] + "-" + sdate[1] + "-" + sdate[2];

    var chkDate=new Date(Date.parse(indate))

    var cmpDate=(chkDate.getMonth()+1)+"/"+(chkDate.getDate())+"/"+(chkDate.getYear())
    var indate2=(Math.abs(sdate[0]))+"/"+(Math.abs(sdate[1]))+"/"+(sdate[2])
    if (indate2!=cmpDate){
        alert( ColLabel + " ÀÔ·ÂÇü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");

        ColName.focus();
        return false;
    }
    else {
        if (cmpDate=="NaN/NaN/NaN"){
            alert( ColLabel + " ÀÔ·ÂÇü½ÄÀÌ Àß¸øµÇ¾ú½À´Ï´Ù.");

            ColName.focus();
            return false;
        }
        else {
//          alert("ÀÔ·ÂÇÏ½Å ³¯Â¥´Â Á¤È®ÇÕ´Ï´Ù!");
            return true;
        }
    }
}

/**
 * ÇÑÀÚ¸®¼ö ÀÏÀÚ³ª ¿ùÀÏ°æ¿ì '0'À» Æ÷ÇÔÇÑ µÎÀÚ¸®·Î ¸¸µé¾îÁØ´Ù.*
 */
function addZero(ColName) 
{
	var dateValue = ColName.value;	
	if(dateValue.length <= 1)
    {
    	dateValue = "0"+dateValue; 	  
		return dateValue;
    }      
    else
    {
        return dateValue;
    }
}

/**
 * µÎ¹øÂ° °ªÀÌ null ÀÌ°Å³ª, Ã¹¹øÂ° °ªº¸´Ù Å¬ ¶§, true¸¦ ¸®ÅÏ - Mibok Park added 2002.03.13
 */
function chkTwoValue(ColName1, ColLabel1, ColName2, ColLabel2)
{
    if ( ColName2.value.length == "" )
        return true;
    else if ( parseInt(ColName1.value) < parseInt(ColName2.value) )
        return true;
    else
    {
        alert(ColLabel2 + 'Àº ' + ColName1.value + ' ÀÌ»ó ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.');
        ColName2.focus();
        ColName2.select();
        return false;
    }
}

/**
 * µÎ ÄÃ·³ Áß Àû¾îµµ ÇÏ³ª¿¡´Â °ªÀÌ ÀÖ¾î¾ß ÇÔ. - Mibok Park added 2002.03.13
 */
function chkNullTwo(ColName1, ColLabel1, ColName2, ColLabel2)
{
    if ( ColName1.value.length == "" && ColName2.value.length == "" )
    {
        alert("'" + ColLabel1 + "' È¤Àº '" + ColLabel2 + "' ¿¡ °ªÀ» ÀÔ·ÂÇØ¾ß ÇÕ´Ï´Ù.");
        ColName1.focus();
        return false;
    } else
        return true;
}

/**
 * ¼ýÀÚ¿Í Á¡À¸·Î¸¸ °ªÀÌ ±¸¼ºµÇ¾î¾ß ÇÔ. - Mibok Park added 2002.03.13
 */
function chkNumPoint(ColName, ColLabel)
{
    if ( isNumPoint(ColName) == true )
        return true;
    else {
        alert("'" + ColLabel + "'Àº ¼ýÀÚ¿Í Á¡(.)¸¸ Çã¿ëÇÕ´Ï´Ù.");
        ColName.focus();
        ColName.select();
        return false;
    }
}

/**
 * ÀÔ·ÂµÈ ¹®ÀÚ°¡ ¼ýÀÚÀÎÁö check    
 */
function checkDigit(input, ColLabel)
{
    var chars = "0123456789"; 
    for (var inx = 0; inx < input.length; inx++) {
       if (chars.indexOf(input.charAt(inx)) != -1)
           return true;
    }
	alert("'" + ColLabel + "'´Â(Àº) ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä!");	
    return false;
}

/**
 * ¹ÚÁ¤±Ù È¨ÇÇ¿ë    
 */
	function over(FormName, color)
	{
		FormName.style.background = color;
	}
	function out(FormName, color)
	{
		FormName.style.background = color;
	}

	function submitOneBoard(FormName, action_file)  // ColLabe - column label
	{
		if(FormName.writer.value.length != "" && FormName.content.value.length != "")
		{
			FormName.action=action_file;
			FormName.submit();
		}
		else
		{
			if(FormName.writer.value.length == "") {
				alert("ÀÌ¸§À» ÀÔ·ÂÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
				FormName.writer.focus();
				return;
			}

			if(FormName.content.value.length == "") {
				alert("³»¿ëÀ» ÀÔ·ÂÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
				FormName.content.focus();
				return;
			}
		}
	}

	function handleKeydown(FormName , action_file) {
		if (event.keyCode==13) {
			submitOneBoard(FormName ,action_file);
		}
	}

// open system information panel
function openSysInfo(file) {

	var opt = "width=300,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no"; 
	var pop_sysinfo = window.open(file,'sysinfo', opt);
}

// open system information panel
function openSkinPreview(file) {

	var opt = "width=800,height=600,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes"; 
	var win = window.open(file,'skinpreview', opt);
	win.focus();

}




//xml object »ý¼º
function loadXMLDoc(file) {
	var object = new ActiveXObject("Microsoft.XMLDOM");
	object.async="false";
	object.load(file);

	if(object.parseError.errorCode != "0") {
		var xmlErrDetail = "File: "+ file + "\n" + "Error Code: " + object.parseError.errorCode + "\n"+"Error Reason: " + object.parseError.reason + "\n" + "Error Line: " + object.parseError.line;
		alert("XML ÆÄÀÏÀ» LoadÇÏ´Â Áß¿¡ ¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù. \n" + xmlErrDetail);
	}
	return object;
}

function xmlSysConfigValue(object, name) {
	var value;
	var nodes = object.documentElement.childNodes;
	for (i = 0; i < nodes.length; i++) {
		if(nodes.item(i).getAttribute("name") == name) {
			value = nodes.item(i).text;				
		}
	}
	return value;
}



//º» »óÇ° Ç×»ó µû¶ó ´Ù´Ï±â.
/*	var stmnGAP1 = 10;
	var stmnGAP2 = 0;
	var stmnBASE = 10;
	var stmnActivateSpeed = 200;
	var stmnScrollSpeed = 10;
	var stmnTimer;

	function ReadCookie(name)	{
		var label = name + "=";
		var labelLen = label.length;
		var cLen = document.cookie.length;
		var i = 0;

		while (i < cLen) {
				var j = i + labelLen;

				if (document.cookie.substring(i, j) == label) {
						var cEnd = document.cookie.indexOf(";", j);
						if (cEnd == -1) cEnd = document.cookie.length;

						return unescape(document.cookie.substring(j, cEnd));
				}

				i++;
		}

		return "";
	}

	function SaveCookie(name, value, expire) {
		var eDate = new Date();
		eDate.setDate(eDate.getDate() + expire);
		document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
	}

	function RefreshSTATICMENU() {
		var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

		stmnStartPoint = parseInt(STATICMENU.style.top, 10);
		stmnEndPoint = document.body.scrollTop + stmnGAP2;
		if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

		stmnRefreshTimer = stmnActivateSpeed;

		if ( stmnStartPoint != stmnEndPoint ) {
				stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
				STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
				stmnRefreshTimer = stmnScrollSpeed;
		}

		stmnTimer = setTimeout ("RefreshSTATICMENU();", stmnRefreshTimer);
	}

	function ToggleAnimate()	{
		if (ANIMATE.checked) {
				RefreshSTATICMENU();
				SaveCookie("ANIMATE", "true", 300);
		}
		else {
				clearTimeout(stmnTimer);
				STATICMENU.style.top = stmnGAP1;
				SaveCookie("ANIMATE", "false", 300);
		}
	}

	function InitializeSTATICMENU() {
		if (ReadCookie("ANIMATE") == "false") {
				ANIMATE.checked = false;
				STATICMENU.style.top = document.body.scrollTop + stmnGAP1;
		}
		else {
				ANIMATE.checked = true;
				STATICMENU.style.top = document.body.scrollTop + stmnBASE;
				RefreshSTATICMENU();
		}
	}
*/

	var stmnLEFT = 10; // ½ºÅ©·Ñ¸Þ´ºÀÇ ÁÂÃø À§Ä¡
	var stmnGAP1 = 10; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
	var stmnGAP2 = 0; // ½ºÅ©·Ñ½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¾à°£ ¶ç¿ò. ÇÊ¿ä¾øÀ¸¸é 0À¸·Î ¼¼ÆÃ
	var stmnBASE = 10; // ½ºÅ©·Ñ¸Þ´º ÃÊ±â ½ÃÀÛÀ§Ä¡ (¾Æ¹«·¸°Ô³ª ÇØµµ »ó°üÀº ¾øÁö¸¸ stmnGAP1°ú ¾à°£ Â÷ÀÌ¸¦ ÁÖ´Â°Ô º¸±â ÁÁÀ½)
	var stmnActivateSpeed = 200; // ¿òÁ÷ÀÓÀ» °¨ÁöÇÏ´Â ¼Óµµ (¼ýÀÚ°¡ Å¬¼ö·Ï ´Ê°Ô ¾Ë¾ÆÂ÷¸²)
	var stmnScrollSpeed = 10; // ½ºÅ©·ÑµÇ´Â ¼Óµµ (Å¬¼ö·Ï ´Ê°Ô ¿òÁ÷ÀÓ)

	var stmnTimer;

	function ReadCookie(name) {
	var label = name + "=";
	var labelLen = label.length;
	var cLen = document.cookie.length;
	var i = 0;

	while (i < cLen) {
			var j = i + labelLen;

			if (document.cookie.substring(i, j) == label) {
					var cEnd = document.cookie.indexOf(";", j);
					if (cEnd == -1) cEnd = document.cookie.length;
			return unescape(document.cookie.substring(j, cEnd));
			}
			i++;
		}
	  return "";
	}

	function SaveCookie(name, value, expire) {
	var eDate = new Date();
	eDate.setDate(eDate.getDate() + expire);
	document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
	}

	function RefreshSTATICMENU() {
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

	stmnStartPoint = parseInt(STATICMENU.style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP2;
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

	stmnRefreshTimer = stmnActivateSpeed;

	if ( stmnStartPoint != stmnEndPoint ) {
			stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
			STATICMENU.style.top = parseInt(STATICMENU.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
			stmnRefreshTimer = stmnScrollSpeed;
			}
			stmnTimer = setTimeout ("RefreshSTATICMENU();", stmnRefreshTimer);
	}

	function ToggleAnimate() {
		try{
			if (!ANIMATE.checked) {
				RefreshSTATICMENU();
				SaveCookie("ANIMATE", "true", 300);
			} else {
				clearTimeout(stmnTimer);
				STATICMENU.style.top = stmnGAP1;
				SaveCookie("ANIMATE", "false", 300);
			}
		}catch(e){}
	}

	function InitializeStaticMenu() {
		STATICMENU.style.left = stmnLEFT;
		if (ReadCookie("ANIMATE") == "false") {
				try{
					ANIMATE.checked = true;
				}catch(e){}
				STATICMENU.style.top = document.body.scrollTop + stmnGAP1;
		} else {
				try{
					ANIMATE.checked = false;
				}catch(e){}
					STATICMENU.style.top = document.body.scrollTop + stmnBASE;
					RefreshSTATICMENU();
		}
	}



	// Çã´Ï¹® È£ÅÚ ±¸ºÐ
	var gnD_sHotel = new Array( "sHotel_01","sHotel_02","sHotel_03")
	var gnD_sMenu = new Array( gnD_sHotel.length );
	function gnD_sGet(){
		var nObjStep = gnD_sHotel.length;
		for( nCountStep = 0; nCountStep < nObjStep; nCountStep++ ){
			gnD_sMenu[nCountStep] = document.getElementById( gnD_sHotel[nCountStep] );
		}
	}

	// Çã´Ï¹® È£ÅÚ ±¸ºÐ
	function sHotelMenu( StepMenu ){
		// dLayer °´Ã¼µéÀ» ¾ò¾î¿È!
		gnD_sMenu[0] != null ? "" : gnD_sGet();

		if( StepMenu == gnD_sMenu[0].id ){
			gnD_sMenu[0].style.display = "";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[1].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "";
			gnD_sMenu[2].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[2].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "";
		} 
	}


	//¼­ºê ¸Þ´º·Î ÀÌµ¿ÇÏ±â
	var gnD_sOther = new Array( "sOther_01","sOther_02")
	var gnD_oMenu = new Array( gnD_sOther.length );
	function gnD_oGet(){
		var oObjStep = gnD_sOther.length;
		for( oCountStep = 0; oCountStep < oObjStep; oCountStep++ ){
			gnD_oMenu[oCountStep] = document.getElementById( gnD_sOther[oCountStep] );
		}
	}

	//¼­ºê ¸Þ´º·Î ÀÌµ¿ÇÏ±â
	function sOtherMenu( StepoMenu ){
		// dLayer °´Ã¼µéÀ» ¾ò¾î¿È!
		gnD_oMenu[0] != null ? "" : gnD_oGet();

		if( StepoMenu == gnD_oMenu[0].id ){
			gnD_oMenu[0].style.display = "";
			gnD_oMenu[1].style.display = "none";
		}
		else if( StepoMenu == gnD_oMenu[1].id ){
			gnD_oMenu[0].style.display = "none";
			gnD_oMenu[1].style.display = "";
		} 
	}


	// MySelf Travel ÄíÆù ±¸ºÐ
	var gnD_mCoupon = new Array( "mCoupon_01","mCoupon_02","mCoupon_03", "mCoupon_04", "mCoupon_05", "mCoupon_06", "mCoupon_07")
	var gnD_sMenu = new Array( gnD_mCoupon.length );
	function gnD_mGet(){
		var nObjStep = gnD_mCoupon.length;
		for( nCountStep = 0; nCountStep < nObjStep; nCountStep++ ){
			gnD_sMenu[nCountStep] = document.getElementById( gnD_mCoupon[nCountStep] );
		}
	}

	// MySelf Travel ÄíÆù ±¸ºÐ
	function mCouponMenu( StepMenu ){
		// dLayer °´Ã¼µéÀ» ¾ò¾î¿È!
		gnD_sMenu[0] != null ? "" : gnD_mGet();

		if( StepMenu == gnD_sMenu[0].id ){
			gnD_sMenu[0].style.display = "";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[1].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[2].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[3].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "none";
		} 
		else if( StepMenu == gnD_sMenu[4].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[5].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "";
			gnD_sMenu[6].style.display = "none";
		}
		else if( StepMenu == gnD_sMenu[6].id ){
			gnD_sMenu[0].style.display = "none";
			gnD_sMenu[1].style.display = "none";
			gnD_sMenu[2].style.display = "none";
			gnD_sMenu[3].style.display = "none";
			gnD_sMenu[4].style.display = "none";
			gnD_sMenu[5].style.display = "none";
			gnD_sMenu[6].style.display = "";

			if(document.getElementById("ifarm")){
				document.getElementById("ifarm").src = "http://coupon.tnuri.com/index.asp?company_id=nomad";
			}
		}
	}


	//À¯·´ Ç×°ø¼Ò°³ ¸Þ´º
	var gnD_AirLine = new Array( "AirLine_01","AirLine_02")
	var gnD_aMenu = new Array( gnD_AirLine.length );
	function gnD_aGet(){
		var aObjStep = gnD_AirLine.length;
		for( aCountStep = 0; aCountStep < aObjStep; aCountStep++ ){
			gnD_aMenu[aCountStep] = document.getElementById( gnD_AirLine[aCountStep] );
		}
	}

	function AirLineMenu( StepoMenu ){
		// dLayer °´Ã¼µéÀ» ¾ò¾î¿È!
		gnD_aMenu[0] != null ? "" : gnD_aGet();

		if( StepoMenu == gnD_aMenu[0].id ){
			gnD_aMenu[0].style.display = "";
			gnD_aMenu[1].style.display = "none";
		}
		else if( StepoMenu == gnD_aMenu[1].id ){
			gnD_aMenu[0].style.display = "none";
			gnD_aMenu[1].style.display = "";
		} 
	}


	// Å×¸¶°¡ ÀÖ´Â ³ë¸Åµå
	var gnD_NomadTema = new Array( "NomadTema_01","NomadTema_02","NomadTema_03")
	var gnD_TemaMenu = new Array( gnD_NomadTema.length );
	function gnD_TemaGet(){
		var ObjStepTema = gnD_NomadTema.length;
		for( tCountStep = 0; tCountStep < ObjStepTema; tCountStep++ ){
			gnD_TemaMenu[tCountStep] = document.getElementById( gnD_NomadTema[tCountStep] );
		}
	}

	// Çã´Ï¹® È£ÅÚ ±¸ºÐ
	function NomadTemaMenu( tStepMenu ){
		// dLayer °´Ã¼µéÀ» ¾ò¾î¿È!
		gnD_TemaMenu[0] != null ? "" : gnD_TemaGet();

		if( tStepMenu == gnD_TemaMenu[0].id ){
			gnD_TemaMenu[0].style.display = "";
			gnD_TemaMenu[1].style.display = "none";
			gnD_TemaMenu[2].style.display = "none";
		}
		else if( tStepMenu == gnD_TemaMenu[1].id ){
			gnD_TemaMenu[0].style.display = "none";
			gnD_TemaMenu[1].style.display = "";
			gnD_TemaMenu[2].style.display = "none";
		}
		else if( tStepMenu == gnD_TemaMenu[2].id ){
			gnD_TemaMenu[0].style.display = "none";
			gnD_TemaMenu[1].style.display = "none";
			gnD_TemaMenu[2].style.display = "";
		} 
	}



	function FlashPlay(file,width,height){
	document.open()
	document.write('<object classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 codebase=https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 width=' + width + ' height=' + height + ' align=middle VIEWASTEXT>');
	document.write('<param name=allowScriptAccess value=sameDomain />');
	document.write('<param name=quality VALUE=high />');
	document.write('<param name=movie value=' + file + ' />');
	document.write('<param name=WMODE  VALUE=Transparent>');
	document.write('<embed swLiveConnect=true quality=high src=' + file + ' width=' + width + ' height=' + height + ' name=worldtime_digital align=middle allowScriptAccess=sameDomain type=application/x-shockwave-flash pluginspage=http://www.macromedia.com/go/getflashplayer />');
	document.write('</object>');
	document.close()
}