if (window.Event) // ³Ý½ºÄÉÀÌÇÁ¿¡¼­¸¸ ´ë¹®ÀÚ E.
  document.captureEvents(Event.MOUSEUP); // mouse up ÀÌº¥Æ®¸¦ ÀâÀ½

function nocontextmenu() // IE4¿¡¼­¸¸ Àû¿ë, ´Ù¸¥ ºê¶ó¿ìÀú´Â ¹«½Ã
{
   event.cancelBubble = true
   event.returnValue = false;

   return false;
}

function norightclick(e)   // ´Ù¸¥ ¸ðµç ºê¶ó¿ìÀú¿¡¼­ ÀÛµ¿
{
   if (window.Event)   // ´Ù½Ã, IE ¶Ç´Â NAV ?
   {
      if (e.which == 2 || e.which == 3)
         return false;
   }
   else
      if (event.button == 2 || event.button == 3)
      {
         event.cancelBubble = true
         event.returnValue = false;
         return false;
      }
   
}

//document.oncontextmenu = nocontextmenu;      // IE5+ ¿ë
//document.onmousedown = norightclick;      // ´Ù¸¥ ºê¶ó¿ìÀú ¿ë

function CheckObjResult( Obj, ObjSizeMin, ObjSizeMax, Rtn )
{

        if (!Obj.id)
        	stName = Obj.name ;
        else
        	stName = Obj.id;
        if ( Rtn == true) return true;

        switch ( Rtn )
        {
                case 10:
                        alert("ObjType ºÒÀÏÄ¡...");
                        break;
                case 11:
                        alert(stName+"´Â(Àº) ¼ýÀÚÇü¸¸ °¡´É ÇÕ´Ï´Ù.");
                        break;
                case 12:
                        alert(stName+"´Â(Àº) ¿µ¹®ÀÚÇü¸¸ °¡´É ÇÕ´Ï´Ù.");
                        break;
                case 13:
                        alert(stName+"´Â(Àº) ¿µ¹®ÀÚ°ú ¼ýÀÚ¸¸ »ç¿ë°¡´É ÇÕ´Ï´Ù.");
                        break;
                case 14:
                        alert(stName+"´Â(Àº) ÇÑ±Û¸¸ »ç¿ë°¡´É ÇÕ´Ï´Ù.");
                        break;
                case 15:
                        alert(stName+"´Â(Àº) ¼ýÀÚ¿Í '-' ¹®ÀÚ¸¸ »ç¿ë°¡´É ÇÕ´Ï´Ù.");
                        break;
                case 16:
                        alert(stName+"´Â(Àº) ÇÑ±Û,¿µ¹®,¼ýÀÚ¿Í '-' ¹®ÀÚ¸¸ »ç¿ë°¡´É ÇÕ´Ï´Ù.");
                        break;
				case 17:
                        alert(stName+"´Â(Àº) ¿µ¹®ÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
                        break;				
                case 20:
                        alert("ObjType ºÒÀÏÄ¡(" + stName + ")...");
                        break;
                case 21:
                        alert(stName+"´Â(Àº) ÀÔ·Â °¡´ÉÇÑ ¼ýÀÚ ¹üÀ§°¡ ¾Æ´Õ´Ï´Ù..\n " + ObjSizeMin +" ºÎÅÍ " + ObjSizeMax + "»çÀÌÀÇ ¼ýÀÚ·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä" );
                        break;
                case 22:
                        alert(stName+"´Â(Àº) ±æÀÌ°¡ Æ²¸³´Ï´Ù...\n " + ObjSizeMin +" ºÎÅÍ " + ObjSizeMax + "»çÀÌÀÇ ±æÀÌ·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä" );
                        break;
				case 23:
                        alert(stName+"´Â(Àº) ÀÔ·Â °¡´ÉÇÑ ÀÏÀÚ ¹üÀ§°¡ ¾Æ´Õ´Ï´Ù..\n " + ObjSizeMin +" ºÎÅÍ " + ObjSizeMax + "»çÀÌÀÇ ÀÏÀÚ·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä" );
                        break;
                case 31:
                        alert("ÁÖ¹Î¹øÈ£ Çü½ÄÀÌ Æ²¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä." );
                        ObjSizeMin.value = "";
                        ObjSizeMax.value = "";
                        ObjSizeMin.focus();
                        return Rtn;
                        break;
                case 32:
                        alert("Email Çü½ÄÀÌ Æ²¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä." );
                        break;
                case 33:
                        alert("¿ìÆí¹øÈ£ °Ë»öÀÌ  Á¦´ë·Î µÇÁö ¾Ê¾Ò½À´Ï´Ù.\n´Ù½Ã °Ë»öÇØÁÖ½Ê½Ã¿ä");
                        break;
				case 34:
                        alert("»ç¾÷ÀÚµî·Ï¹øÈ£ Çü½ÄÀÌ Æ²¸³´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä.");
                        break;
                case 9999:
                        alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ê½Ã¿ä.");
                        return Rtn;
                        break;
                default:
                        alert("°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ê½Ã¿ä.");
                        return Rtn;
                        break;
        }

        Obj.value = "";
        Obj.focus();
        return Rtn;


}

function isInserted(msg) {
	if(arguments.length > 1) {
		for(var i=1; i<arguments.length; i++) {
			if(arguments[i] && arguments[i].value.replace(/ /g, '') == '') {
				if(msg != '') {
					alert(msg + ' ÀÔ·ÂÇÏ¼¼¿ä');
				}
				arguments[i].focus();
				return false;
			}
		}
	}
	return true;
}

// Obj        : Check ÇÒ ÀÌ¸§
// ObjType    : °¢ Ç×¸ñÀÇ ÇÊµåÀÇ ¼º°Ý : NUM, ALPHA, ALPHANUM,HAN, NUMDASH, HANNUMALPHADASH
// ObjSizeMin : Ç×¸ñÀÇ ÃÖ¼Ò±æÀÌ
// ObjSizeMax : Ç×¸ñÀÇ ÃÖ´ë ±æÀÌ
// SpOption   : ¿É¼Ç : Jumin, Email
// ÁÖÀÇ ÁÖ¹Î ¹øÈ£ÀÏ°æ¿ì
//        rtn = CheckObjValue( frm.TM_JuminNo1,"NUM", frm.TM_JuminNo1, frm.TM_JuminNo2, "Jumin");
//        if ( CheckObjResult( frm.TM_JuminNo1 , frm.TM_JuminNo1, frm.TM_JuminNo2 , rtn ) != true ) return;
//  À§Ã³·³ ObjSizeMin¿¡ ÁÖ¹Î¹øÈ£ ¾ÕÀÚ¸® ObjSizeMax¿¡ ÁÖ¹Î¹øÈ£ µÞÀÚ¸®¸¦ ³Ö¾îÁØ´Ù.
// ÀÌÇÔ¼ö¸¦ ½ÇÇà ÈÄ CheckObjResult ÇÔ¼ö¸¦ ½ÇÇà ½ÃÄÑÁÖ¸é alert ¸Þ¼¼Áö¿Í ÇÔ²² ÀÚµ¿À¸·Î ºóÀÚ¸®¿¡ Focus°¡ ÀÌ·ç¾î Áø´Ù.
function CheckObjValue(Obj,ObjType, ObjSizeMin, ObjSizeMax, SpOption)
{

        if ( SpOption == "Jumin" ) {

                if ( isNumStr(ObjSizeMin.value) == false || isNumStr(ObjSizeMax.value) == false )
                        return 31;
                if ( ObjSizeMin.value.length != 6 || ObjSizeMax.value.length != 7 )
                        return 31;
                if ( isJumin( ObjSizeMin.value , ObjSizeMax.value ) == false )
                        return 31;
                return true;

        } else if ( SpOption == "Email" ) {
                if ( !(Obj.value.length >= ObjSizeMin && Obj.value.length <= ObjSizeMax) ){
                        return 22;
                }
                if ( isEmail(Obj.value) == false ) {
                        return 32;
                }
                return true;
		 } else if ( SpOption == "BusinessNo" ) {
				if ( isNumStr(Obj.value) == false || Obj.value.length != 10 )
                        return 34;
                if ( check_BusinessNo(Obj.value) == false )
                        return 34;
                return true;
        }

        if ( ObjType == "NUM" ) {
                if ( isNumStr( Obj.value, false ) == false ) {
                        return 11;
                }
        } else if (ObjType == "ALPHA" ) {
                if ( isAlphaStr( Obj.value, false ) == false ) {
                        return 12;
                }
        } else if (ObjType == "ALPHANUM" ) {
                if ( isAlphaNumStr( Obj.value , false) == false ) {
                        return 13;
                }
        } else if ( ObjType == "HAN" ) {
                if ( isHanStr(Obj.value,false) == false ) {
                        return 14;
                }
        } else if (ObjType == "NUMDASH" ) {
                if ( isNumDashString( Obj.value, false ) == false ) {
                        return 15;
                }
        } else if (ObjType == "HANNUMALPHADASH" ) {
                if ( isHanNumAlphaDash( Obj.value, true ) == false ) {
                        return 16;
                }
		} else if (ObjType == "NOALPHA" ) {
                if ( isNoAlpha( Obj.value) == false ) {
                        return 17;
                }
        } else {
                return 10;
        }

        if ( ObjType == "NUM" ) {
                if ( isNumSize ( Obj.value, ObjSizeMin, ObjSizeMax ) == false ) {
                        return 21;
                }
        } else {
                if ( !(Obj.value.length >= ObjSizeMin && Obj.value.length <= ObjSizeMax) ){
                        return 22;
                }
        }

        return true;
}

function checkValue(f)
{
    var j = f.elements.length
    var i,k;
    var re;
    var args;
    var result;

	for (i=0; i<j; i++) {
        if (typeof(f.elements[i].check) == "undefined") continue;

        args = f.elements[i].check.split("||", 3);
        if (args[0]=='C') {
            result = eval(args[1]+"(f.elements[i], f.elements[i].value);");
        }
        else if ((args[0]=='M') || ((args[0]=='O')&& (f.elements[i].value.length>0))) {
            re = new RegExp(args[1], "gi");
            result = re.test(f.elements[i].value);
        }
        else if (args[0]=='P') {//´Ù¸¥ input value(args[1]) ¿Í ºñ±³ (ÆÐ½º¿öµå)
            result = (f.all[args[1]].value==f.elements[i].value);
        }
		else if (args[0]=='R') {//ÇÊ¼ö ¶óµð¿À ¹Ú½º °Ë»ç(args[1] ÀÎÀÚ ÇÊ¿ä¾øÀ½)
			var radioElement = f.all(f.elements[i].name);
			result = false;
			for (k=0;k<radioElement.length;k++) {
				if (radioElement[k].checked==true) {
					result = true;
					break;
				}
			}
		}

        if (result == false) {
            alert(args[2]);
			if (f.elements[i].type.toUpperCase() != 'HIDDEN') {
				f.elements[i].focus();
				if (f.elements[i].tagName !='SELECT') f.elements[i].select();
			}
            return false;
        }
    }
	return true;
}

function checkValue2(f)
{
	 var j = f.elements.length
    var i,k;
    var re;
    var args;
    var result;

	for (i=0; i<j; i++) {
        if (typeof(f.elements[i].check) == "undefined") continue;

        args = f.elements[i].check.split("||", 3);
        if (args[0]=='C') {
            result = eval(args[1]+"(f.elements[i], f.elements[i].value);");
        }
        else if ((args[0]=='M') || ((args[0]=='O')&& (f.elements[i].value.length>0))) {
            re = new RegExp(args[1], "gi");
            result = re.test(f.elements[i].value);
        }
        else if (args[0]=='P') {//´Ù¸¥ input value(args[1]) ¿Í ºñ±³ (ÆÐ½º¿öµå)
            result = (f.all[args[1]].value==f.elements[i].value);
        }
		else if (args[0]=='R') {//ÇÊ¼ö ¶óµð¿À ¹Ú½º °Ë»ç(args[1] ÀÎÀÚ ÇÊ¿ä¾øÀ½)
			var radioElement = f.all(f.elements[i].name);
			result = false;
			for (k=0;k<radioElement.length;k++) {
				if (radioElement[k].checked==true) {
					result = true;
					break;
				}
			}
		}

        if (result == false) {
            alert(args[2]);
			if (f.elements[i].type.toUpperCase() != 'HIDDEN') {
				f.elements[i].focus();
				if (f.elements[i].tagName !='SELECT') f.elements[i].select();
			}
            return false;
        }
    }
	
	return true;
	
}


function isSpChr(ch)
{
        if ( ch == " " )
                return true
        else
                return false

}

function isHanNumAlphaDash(stValue, Spok)
{
  for(var i=0; i<stValue.length;i ++) {
    if ( isAlphaChr( stValue.charAt(i) ) == true ) continue;
    if ( isNumChr( stValue.charAt(i) ) == true ) continue;
    if ( stValue.charAt(i)  == "-" ) continue;
    if ( isHanChr( stValue.charCodeAt(i) ) == true ) continue;
    if ( Spok == true )
    {
            if ( isSpChr(stValue.charAt(i)) == true ) {
                    continue;
            }
    }
        return false;
  }
  return true;
}

function isAlphaNumStr(stValue, Spok)
{
  for(var i=0; i<stValue.length;i ++) {
    if ( isAlphaChr( stValue.charAt(i) ) == true ) continue;
    if ( isNumChr( stValue.charAt(i) ) == true ) continue;
    if ( Spok == true )
    {
            if ( isSpChr(stValue.charAt(i)) == true ) {
                    continue;
            }
    }

        return false;
  }
  return true;

}
function isHanStr(stValue)
{
	
  for(i=0;i<stValue.length;i++) {
          if (isHanChr( stValue.charCodeAt(i) ) == true) {continue;} else {return false;}
  }

}
function isHanChr(ch)
{
        if ( ch > 128 ) return true;
        else return false;
}
function isNumDashString(stValue, Spok)
{
  for(var i=0 ; i< stValue.length ; i ++) {
    if ( isNumDashChr(stValue.charAt(i)) == true ) continue;

    if ( Spok == true )
    {
            if ( isSpChr(stValue.charAt(i)) == true ) {continue;} else {return false;}
    }

        return false;
  }

  return true;
}
function isNumDashChr(ch)
{

        if ( isNumChr(ch) == true || ch == "-" ) {
                return true
        } else {
                return false
        }
}
function isNumSize(num, x, y )
{
        if ( num >= x && num <= y ) {
                return true;
        } else {
                return false;
        }

}
function isNoAlpha(stValue)
{
	var strAll = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	 for (i=0; i < stValue.length; i++)
    {
      if(strAll.indexOf(stValue.substring(i,i+1)) >= 0) return false;
    }
   return true;   
}
function isAlphaStr(stValue, Spok)
{
	   
  for(var i=0; i<stValue.length;i ++) {
    if ( isAlphaChr( stValue.charAt(i) ) == true ) continue;
    if ( Spok == true )
    {
            if ( isSpChr(stValue.charAt(i)) == true ) {
                    continue;
            }
    }

        return false;
  }
  return true;
}

function isAlphaChr(ch)
{
        if ( isUpperAlphaChr(ch) == true || isLowerAlphaChr(ch) == true )
                return true
        else
                return false
}

function isUpperAlphaChr(ch)
{
        if ( ch >= 'A' && ch <= 'Z' )
                return true
        else
                return false
}

function isLowerAlphaChr(ch)
{
        if ( ch >= 'a' && ch <= 'z' )
                return true
        else
                return false
}
function isEmail(str)
{
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
        if (filter.test(str)) { return true; }
        else { return false; }
}

function isJumin(str_jumin1,str_jumin2)
{
        return ChkJumin(str_jumin1,str_jumin2)
}
function Check_Jumin(obj,rrn){
	//var rrn = rrn1 + rrn2;
	var result = 0;

	for(var i=0; i<12; i++)
		result = result + ((i % 8) + 2) * rrn.substring(i, i+1);
	result = (11 - (result % 11)) % 10;

	if(rrn.length < 12 || result != rrn.substring(12, 13)){
		alert('¿Ã¹Ù¸¥ ÁÖ¹Îµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä');
		obj.focus();
		return false;
	}
	return true;
}

// »ç¾÷ÀÚ µî·Ï¹øÈ£ °Ë»ç (Çü½Ä : xxx , xx , xxxxx)
function isBusinessNo(strCk1,strCk2,strCk3) {
 arrCkValue = new Array(10);
 if ( (isLength(strCk1)==3) && (isLength(strCk2)==2) && (isLength(strCk3)==5) ) {
	 if ( (strCk1="111") && (strCk2="11") && (strCk3="11111") ) return true;
	 if ( (isNumStr(strCk1)) && (isNumStr(strCk2)) && (isNumStr(strCk3)) ) {
	   arrCkValue[0] = ( parseFloat(strCk1.substring(0 ,1))  * 1 ) % 10;
	   arrCkValue[1] = ( parseFloat(strCk1.substring(1 ,2))  * 3 ) % 10;
	   arrCkValue[2] = ( parseFloat(strCk1.substring(2 ,3))  * 7 ) % 10;
	   arrCkValue[3] = ( parseFloat(strCk2.substring(0 ,1))  * 1 ) % 10;
	   arrCkValue[4] = ( parseFloat(strCk2.substring(1 ,2))  * 3 ) % 10;
	   arrCkValue[5] = ( parseFloat(strCk3.substring(0 ,1))  * 7 ) % 10;
	   arrCkValue[6] = ( parseFloat(strCk3.substring(1 ,2))  * 1 ) % 10;
	   arrCkValue[7] = ( parseFloat(strCk3.substring(2 ,3))  * 3 ) % 10;
	   intCkTemp     = parseFloat(strCk3.substring(3 ,4))  * 5  + "0";
	   arrCkValue[8] = parseFloat(intCkTemp.substring(0,1)) + parseFloat(intCkTemp.substring(1,2));
	   arrCkValue[9] = parseFloat(strCk3.substring(4,5));
	   intCkLastid = ( 10 - ( ( arrCkValue[0]+arrCkValue[1]+arrCkValue[2]+arrCkValue[3]+arrCkValue[4]+arrCkValue[5]+arrCkValue[6]+arrCkValue[7]+arrCkValue[8] ) % 10 ) ) % 10;
	   if (arrCkValue[9] != intCkLastid) {
			alert ("Àß¸øµÈ »ç¾÷ÀÚµî·Ï¹øÈ£ÀÔ´Ï´Ù. ´Ù½Ã È®ÀÎÇØ ÁÖ½Ê½Ã¿À");
			return false;
		} else {
			 return true;
		 }
	 } else {
		 alert("»ç¾÷ÀÚµî·Ï¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		 return false;
	}
 } else {
	  alert("»ç¾÷ÀÚµî·Ï¹øÈ£ÀÇ ÀÚ¸´¼ö°¡ Àß¸ø ÀÔ·ÂµÇ¾ú½À´Ï´Ù.");
	  return false;
 }
}
//»ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å©
function check_BusinessNo(vencod) {
	var sum = 0;
	var getlist = new Array(10);
	var chkvalue = new Array("1","3","7","1","3","7","1","3","5");
	for (var i=0; i<10; i++) { getlist[i] = vencod.substring(i,i+1); }
	for (var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
	sum = sum + parseInt((getlist[8]*5)/10);
	sidliy = sum % 10 ;
	sidchk = 0;
	if (sidliy != 0) { sidchk = 10 - sidliy; }
	else { sidchk = 0; }
	if(sidchk != getlist[9]) { return false; }
	return true;
}

function ChkJumin(str_jumin1,str_jumin2) {
    errfound = false;
    var str_jumin1;
    var str_jumin2;
    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 )) {
        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 )) {
      return false;
    }
//                ¿¬µµ Á¦ÇÑ ¾øÀ½
//    if(str_jumin1.substring(0,1) < 4) {
//        return false;
//    }

    if(str_jumin2.substring(0,1) > 2) {
        return false;
    }

    if((str_jumin1.length > 7) || (str_jumin2.length > 8)) {
        return false;
    }

    if ((str_jumin1 == '72') || ( str_jumin2 == '18')) {
      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) {
      return false;
    }

    var i9=0;

    if (!errfound)
        return true;
}

function isNumStr(stValue)
{
  for(var i=0 ; i< stValue.length ; i ++) {
    if ( isNumChr(stValue.charAt(i)) == true ) continue;
	/*
    if ( Spok == true )
    {
            if ( isSpChr(stValue.charAt(i)) == true ) {
                    continue;
            }
    }
	*/
        return false
  }
  return true
}
function isNumChr(ch)
{
        if ( ch >= '0' && ch <= '9' ) {
                return true;
        } else {
                return false;
        }
}
function onlyNumber()
{
	//.Æ÷ÇÔµÊ / ¶ÇÇÑ Æ÷ÇÔµÊ
     if ( event.keyCode<46 || event.keyCode>57 )
        event.returnValue=false;
}
function Check_basic(Temp_Str,num)
{
	var s=Temp_Str;
	var n=num;
	var chkstr;
	chkstr = false;
	if (n==1){//¾ÆÀÌµð°Ë»ç
	if( s.match(/[a-zA-Z_]\w*/g)==s ) {
		  chkstr = true;
			}
		}
	if (n==2){//¼ýÀÚ°Ë»ç
	if( s.match(/\d+/g)==s ) {
		  chkstr = true;
			}
		}
	if (n==3){//ÀüÈ­¹øÈ£°Ë»ç
	if( s.match(/0[23456]\d+/g)==s ) {
		  chkstr = true;
			}
		}
	if (n==4){//ÇÚµåÆù¹øÈ£°Ë»ç
	if( s.match(/01[016789]\d+/g)==s ) {
		  chkstr = true;
			}
		}
	if (n==5){//°ø¹é°Ë»ç
	if( s.match(/\S/)!=null ) {
		chkstr = true;
			}
		}
	if (n==6){//¸ÞÀÏ°Ë»ç
	if( s.match(/[\w\-\~]+\@[\w\-\~]+(\.[\w\-\~]+)+/g)==s ) {
		  chkstr = true;
			}
		}
	if (n==7){//ÀüÈ­¹øÈ£°Ë»ç(-Æ÷ÇÔ)
	if( s.match(/0[23456]\d+[\-]+\d+[\-]+\d\d\d\d/g)==s ) {
		  chkstr = true;
			}
		}
	 return chkstr;
}

function fnSizeCheck(obj,nextobj)
{
        if (obj.value.length == obj.maxLength ) {
                nextobj.focus();
        }

}
/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor, font_Color, font_weight)
{
    if ( thePointerColor == ''  || font_Color == '' || font_weight == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    
    theRow.style.backgroundColor=thePointerColor;
    

	return true;

}



// Rollover Script // by Dreamweaver
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 fnPopupNoScroll(URL, width, Height)
{
	var win=window.open(URL,"popup","width="+width+",height="+Height+",status=no,scrollbars=no");
	win.focus();
}

// ½ºÅ©·Ñ ÀÖ´Â ÆË¾÷
function fnPopupScroll(URL, width, Height)
{
	var win=window.open(URL,"popup","width="+width+",height="+Height+",status=no,scrollbars=yes");
	win.focus();
}

// ½ºÅ©·Ñ ÀÖ´Â ÆË¾÷
function fnPopupAutoScroll(URL, width, Height)
{
	var win=window.open(URL,"popup","width="+width+",height="+Height+",status=no,scrollbars=auto");
	win.focus();
}

// ÇöÀç ÆäÀÌÁö ÀÌµ¿
function fnOpenSelf(URL)
{
	var win=window.open(URL,"_self");
	win.focus();
}

function fullwin(URL)
{
	var win = window.open(URL,"movie","fullscreen=1,scrollbars=yes");
	win.focus();
}

function jsfullwin(URL)
{
	inWidth = screen.width;
	inHeight = screen.height;
	var win = window.open(URL,"movie","left=0,top=0,width="+inWidth+",height="+inHeight+",scrollbars=no,toolbars=no");
	win.focus();
}

// ¸ðµç ¿É¼ÇÀ» ¹Þ´Â  ÆË¾÷
function fnOpenWin(URL,stname, par)
{
	var win=window.open(URL, stname, par);
	win.focus();
}



//select radio ¼±ÅÃÃ¤¿ì±â  
function setselect(obj,value){
	if ( obj == "[object]") {
		obObject = obj;
  	} else {
  		obObject = document.all[obj];
  	}
	for (var i = 0 ; i < obObject.length; i ++)
	{
		if ( obObject.options[i].value == value )
		{
			obObject.selectedIndex = i;
			return;	
		}
	}
}


function setobject(obj,value){
    if(value&&value!='0'){
      var str = "document.all['"+obj+"'].checked = true;";
      eval(str);
    }
    else if(value){
      var str = "document.all['"+obj+"'].checked = false;";
      eval(str);
    }
}

function setradio(obj,value) {
	// Æû ÀÌ¸§ ¼³Á¤
	var form = eval("document.all['"+obj+"']");	
	for(var y=0; y < form.length ; y++) {
		if (form[y].value==value) {
			form[y].checked=true;
		}
	}
}
//¸ðµç ÀÎÀÚ °ª Ã¤¿ì±â
function SetObjectValue(frmname,objname,val) {
	obObject = eval(frmname+"."+objname); 	
	if ( obObject == "[object]" && val != "") { 
		if ( obObject.type == 'select-one' ) {
			setselect(obObject,val);
		} else if ( obObject.type == 'text' || obObject.type == 'hidden' || obObject.type == 'password' ||  obObject.type == 'textarea' ) { 
			obObject.value = val ;
		} else if ( obObject.type == 'checkbox' ) { 
			setobject(objname,val);
		} else { 
			setradio(objname,val);
		}
	} 	
}

function setvalue(getobj,setobj) {

	if(getobj.length > 0) {
		for(var i=0; i<arguments.length; i++) {
			setobj[i].value = getobj[i].value;
		}
	} else {
		setobj.value = getobj.value;
	}
}
// Toggle Menu Display
var objBefore= new Object();
var objHaveBefore = false;
function fnShowMenu (obj)
{
	var objMenuDescText = eval("document.all." + obj.id +"Desc.style");

	if(objMenuDescText.display == "") {
		objMenuDescText.display = "none";
	}
	else
	{
		if ( objHaveBefore == true )
		{
			var objBeforeMenuDescText = eval("document.all." + objBefore.id +"Desc.style");
			objBeforeMenuDescText.display = "none";
		}
		objMenuDescText.display = "";

		objBefore = obj;
		objHaveBefore = true;
	}
}
function fnShowDiv(obj) {
	var objMenuDescText = eval("document.all." + obj.id +".style");
	if(objMenuDescText.display == "") {
		objMenuDescText.display = "none";
	}
}
function premier(n) {
	obj1 = document.getElementById('premier1');
	obj2 = document.getElementById('premier2');
	obj3 = document.getElementById('premier3');
	if ( n == 1 ) {
		obj1.style.display = "block"; 
		obj2.style.display = "none";
		obj3.style.display = "none";
	} else {
		obj1.style.display = "none"; 
		obj2.style.display = "block";
		obj3.style.display = "none";
	}
}

var key = new Array();
key['5'] = "/index.asp";
key['<'] = "/member/member.asp";
function getKey(keyStroke)
{
  if (event.shiftKey || event.ctrlKey) return false;

  if ( (event.srcElement.tagName != 'INPUT') && (event.srcElement.tagName != 'TEXTAREA') )
  {

      isNetscape=(document.layers);
      eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
      which = String.fromCharCode(eventChooser).toLowerCase();
      for (var i in key)
      {
          if (which == i)
          {
              window.location = key[i];
          }
      }
  }
}

function gotKey(){


  if ( (event.srcElement.tagName != 'INPUT') && (event.srcElement.tagName != 'TEXTAREA') )
  {

      if (event.keyCode == 17 || event.keyCode==82 || event.keyCode==93)
      {
          document.body.focus();
          return false;
      }

    if (  event.keyCode == 34
          || event.keyCode == 116 // F5¹øÅ°
          || event.keyCode == 33 // altÅ°
          || event.keyCode == 17 // R (CTRL+R)
          ) {
      event.keyCode = 86;
      return false;
    }
  } else {
      if ( event.ctrlKey || event.shiftKey  ) {

            if (  event.keyCode == 34
                  || event.keyCode == 116 // F5¹øÅ°
                  || event.keyCode == 33 // altÅ°
                  ) {
              event.keyCode = 86;
              return false;
            }

          document.title = document.title ;
          return false;
      } else {
        if (  event.keyCode == 34
              || event.keyCode == 116 // F5¹øÅ°
              || event.keyCode == 33 // altÅ°
              ) {
          event.keyCode = 86;
          return false;
        }
      }


  }

  return;
}

function statusFix()
{
  return;
  status = document.title;
  setTimeout(statusFix,1);

}


//ÀÚ¹ÙÇÔ¼ö ¶óÀÌºê·¯¸®¿¡ Ãß°¡ÇßÀ¸¸é ÇÏ´Â ÇÔ¼ö´ú..
function lpad(str,fill,leng)
{
    var n = leng - str.length;
    var out ="";
    for (i =0; i < n; i++)  out = out + fill;
    out=out+str;
    return out;
}
//parseInt¿¡¼­´Â '08'À» 8Áø¼ö·Î ÀÎ½ÄÇØ¼­ 0ÀÌ³ª NaNÀ» µ¹·ÁÁØ´Ù
function toInt(str)
{
    i=0;
    while(1)
    {
        if(str.substr(0,1)=='0') {str=str.substr(1,str.length)};
        else break;
        i++;
    }
    return parseInt(str);
}

function nextfocus(frm,thisobjname, prefix)
{
	for (var i = 0 ; i < frm.length; i ++)
	{
		// ÇÁ¸®ÇÈ½º°¡ ÀÖÀ» °æ¿ì ÇÁ¸®ÇÈ½º°¡ Á¸Àç ÇÏ´Â°Í¸¸ Ã³¸®
		if (prefix != undefined && frm[i].name.indexOf(prefix) != 0 )  continue;

		if ( frm[i].name == thisobjname )
		{
			
			// ´ÙÀ½ Æ÷Ä¿½º À§Ä¡°¡ ÆûÀÇ ÀüÃ¼ °¹¼öº¸´Ù Å¬°æ¿ì 0¹øÂ° ¿ÀºêÁ§Æ®¿¡ Æ÷Ä¿½º
			if ( ( i + 1) >= frm.length )
			{
				frm[0].focus();	
				return;
			} else {
				frm[i+1].focus();	
				return;
			}
		}
	}
	
}


function show_cal(selectDate,calDivObj,flag,frmname,objname) //selectDateÀÌ½´°¡ µÇ´Â ³¯Â¥, calDivObj´Þ·ÂÀ» »Ñ¸± DIVÅÂ±× ¾ÆÀÌµð
{
    //Àü¿ªº¯¼öµé ¼¼ÆÃ
	
    var selectDate = ''+selectDate.replace(/\-/g, ''); //Àü¿ªº¯¼ö1 - ÀÌ½´°¡ µÇ´Â ³¯Â¥ ÁöÁ¤
    today = new Date();
    toDate = today.getYear() + lpad(''+(today.getMonth()+1),'0',2) + lpad(''+today.getDate(),'0',2); // ¿À´Ã³¯Â¥ ÁöÁ¤
 //   alert(selectDate);
    if (selectDate == '')
    {
        selectDate=toDate;
    }
	var objMenuDescText = eval("document.all." + calDivObj.id +".style");
	objMenuDescText.display = "";
    var preMonDate;
    var nextMonDate;
	var selectYear = selectDate.substr(0,4);
    var selectMonth = selectDate.substr(4,2);
	var selectDay = selectDate.substr(6,2);
    preMonDate= selectYear+lpad(''+(toInt(selectMonth)-1),'0',2)+selectDay;
    nextMonDate= selectYear+lpad(''+(toInt(selectMonth)+1),'0',2)+selectDay;
    //alert(selectDate+":"+ preMonDate +":"+ nextMonDate);
    if(selectMonth=='01') preMonDate= (toInt(selectYear)-1) + '12' + selectDay;
    if(selectMonth=='12') nextMonDate= (toInt(selectYear)+1) + '01' + selectDay;

    //alert(selectDate+":"+ preMonDate +":"+ nextMonDate);

    var firstDay = getFirstDay(selectYear, selectMonth);            // Ã¹¹øÂ° ¿äÀÏÀÇ ¼ýÀÚ°ª
    var lastDay = getLastDay(selectYear, selectMonth);            // ¸¶Áö¸· ¿äÀÏÀÇ ¼ýÀÚ°ª
    var daysOfMonth = getDaysOfMonth(selectYear, selectMonth);    // 28, 29, 30, 31 Áß ÇÏ³ª
    //alert(firstDay+":"+ lastDay +":"+ daysOfMonth);
    var calString;//´Þ·Â HTMLÀ» ÀúÀåÇÏ±â À§ÇÑ º¯¼ö´Ù.
    calString="<table bgcolor=#ffffff border='0' cellspacing='0' cellpadding='0' align='center' style='font-size:11px'>";

    calString+="<tr style='color=#0000C6'><td colspan='7' align='center'>";
    calString+="<a href=\"javascript:show_cal('"+ (parseInt(selectYear)-1)+ selectDate.substr(4,4) +"',"+ calDivObj.id +",'"+ flag +"','"+frmname+"','"+objname+"');\">¢¸¢¸</a> ";
    calString+="<a href=\"javascript:show_cal('"+ preMonDate +"',"+ calDivObj.id +",'"+ flag +"','"+frmname+"','"+objname+"');\">¢¸</a> ";
    calString+="<font size='2'><b>"+selectYear+" / <font color='#FF6600'>"+selectMonth+"</font></b></font> ";
    calString+="<a href=\"javascript:show_cal('"+ nextMonDate +"',"+ calDivObj.id +",'"+ flag +"','"+frmname+"','"+objname+"');\">¢º</a> ";
    calString+="<a href=\"javascript:show_cal('"+ (parseInt(selectYear)+1)+ selectDate.substr(4,4) +"',"+ calDivObj.id +",'"+ flag +"','"+frmname+"','"+objname+"');\">¢º¢º</a>";
    calString+="</td></tr>";

    calString+="<tr height='5'><td colspan='7'></td></tr>";
    calString+="<tr height=19>";
    calString+="<td width='19' align=center style='color=#C60000'>ÀÏ</td>";
    calString+="<td width='19' align=center>¿ù</td>";
    calString+="<td width='19' align=center>È­</td>";
    calString+="<td width='19' align=center>¼ö</td>";
    calString+="<td width='19' align=center>¸ñ</td>";
    calString+="<td width='19' align=center>±Ý</td>";
    calString+="<td width='19' align=center style='color=#0000C6'>Åä</td>";
    calString+="</tr>";

    // ´Þ·Â textfield Ãâ·Â
    for (var i=0; i < Math.ceil( (firstDay+daysOfMonth)/7 ); i++) {
        calString+="<tr valign='middle' height='19'>";
        for (var j=1; j <= 7; j++) {
            colNum=i*7+j; //´Þ·ÂÀÇ °¢ Ä­ÀÇ Ä®·³À» ¹øÈ£·Î ÁöÁ¤

            if (colNum>firstDay && colNum<firstDay+daysOfMonth+1) //´Þ·Â¿¡ ³¯Â¥°¡ ³ª¿Í¾ß µÇ´Â Á¶°Ç
            {
                thisDay=colNum-firstDay; //ÀÌ³¯ÀÇ ³¯Â¥(¼ýÀÚ)

                //¿äÀÏÀÇ »ö±òÀ» °áÁ¤ÇÏÀÚ ¤»¤»
                if(colNum%7==1) {tdColor="C60000";}
                else if(colNum%7==0) {tdColor="0000C6";}				
                else {tdColor="333333";}

				/*
				³âµµ : selectDate.substr(0,4)
				´Þ : selectDate.substr(4,2)
				³¯Â¥ : thisDay
				*/
				if(toDate==selectYear+selectMonth+lpad(''+(parseInt(thisDay)),'0',2)) {tdColor="EFEFEF";}
				if (flag == '0') {
					calString+="<td align='center' style='color=#"+tdColor+"' onMouseOver=this.style.background='#e4e4e4'; onMouseOut=this.style.background='#ffffff';><a style='cursor:hand' onclick=\"SetObjectValue('"+frmname+"','"+objname+"','"+selectYear+selectMonth+lpad(''+(parseInt(thisDay)),'0',2)+"');fnShowDiv("+calDivObj.id+");\">"+thisDay+"</a></td>";
				} else if (flag == '1') {
					calString+="<td align='center' style='color=#"+tdColor+"' onMouseOver=this.style.background='#e4e4e4'; onMouseOut=this.style.background='#ffffff';><a style='cursor:hand' onclick=\"SetObjectValue('"+frmname+"','"+objname+"','"+selectYear+'-'+selectMonth+'-'+lpad(''+(parseInt(thisDay)),'0',2)+"');fnShowDiv("+calDivObj.id+");\">"+thisDay+"</a></td>";					
				} else if (flag == '2') {
					calString+="<td align='center' style='color=#"+tdColor+"' onMouseOver=this.style.background='#e4e4e4'; onMouseOut=this.style.background='#ffffff';><a style='cursor:hand' onclick=\"SetObjectValue('"+frmname+"','"+objname+"','"+selectYear.substr(2,2)+selectMonth+lpad(''+(parseInt(thisDay)),'0',2)+"');fnShowDiv("+calDivObj.id+");\">"+thisDay+"</a></td>";					
				} else {
					calString+="<td align='center' style='color=#"+tdColor+"' onMouseOver=this.style.background='#e4e4e4'; onMouseOut=this.style.background='#ffffff';>"+"<a href="+flag+"?start_year="+selectYear+"&start_month="+selectMonth+"&start_day="+thisDay+">"+thisDay+"</a></td>";
                }
            }
            else
            {
                calString+="<td></td>";
            }
            
        }
        calString+="</tr>";
    }
    calString+="</table>";

    //ÀúÀåµÈ ½ºÆ®¸µº¯¼ö¸¦ DIV·¹ÀÌ¾î¿¡ ¿Ã¸®ÀÚ..
    calDivObj.innerHTML=calString;
}

/////////////////////////³¯Â¥ °ü·ÃµÈ ¿¬»ê ÇÔ¼öµé////////////////////////////
function getDaysOfMonth(year, month) {
    var DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];        // Non-Leap year Month days..
    var lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];    // Leap year Month days..
    /*
    Check for leap year ..
    1.Years evenly divisible by four are normally leap years, except for...
    2.Years also evenly divisible by 100 are not leap years, except for...
    3.Years also evenly divisible by 400 are leap years.
    */
    if ((year % 4) == 0) {
        if ((year % 100) == 0 && (year % 400) != 0) {

            return DOMonth[toInt(month)-1];
      	}
        return lDOMonth[toInt(month)-1];
    } else  {
        return DOMonth[toInt(month)-1];
    }

}

// Ã¹¹øÂ° ¿äÀÏ ±¸ÇÏ±â
function getFirstDay(year, month) {
    var tmpDate = new Date();
    tmpDate.setDate(1);
    tmpDate.setMonth(toInt(month)-1);
    tmpDate.setFullYear(year);
    return tmpDate.getDay();
}

// ¸¶Áö¸· ¿äÀÏ ±¸ÇÏ±â
function getLastDay(year, month) {
    var tmpDate = new Date();
    tmpDate.setDate( getDaysOfMonth(year,month) );
    tmpDate.setMonth(toInt(month)-1);
    tmpDate.setFullYear(year);
    return tmpDate.getDay();
}

function isdate(year, month, day) {
	if(arguments.length == 1) {		// 2002-02-02 ÇüÅÂ, ±¸ºÐ¹®ÀÚ(-)ºÒÇÊ¿ä
		var dt = year.replace(/\./g, '-');
		if (dt.length == 8)
		{
			year = dt.substring(0,4);
			month = dt.substring(4,6);
			day = dt.substring(6,8);

		} else {
			dt = dt.replace(/\//g, '-');			
			var arr_dt = dt.split('-');			
			year = arr_dt[0];
			month = arr_dt[1];
			day = arr_dt[2];
		}
	}
	
	var t_Date = new Date(year + '/' + month + '/' + day);
	if(isNaN(t_Date) == true ||
	   month != t_Date.getMonth() + 1 || day != t_Date.getDate()) {
		return false;
	}
	
	return true;
}
function goTimeOut(msg)
{
	if (msg) alert(msg);
	if ( opener) {
		window.close();
	} else {
		top.location.replace('/member/logout.asp');
	}
}

// scroll border¸¦ ¾ø¾Ö´Â ¼Ò½º
function get_IEscroll(choice) { 
	if (document.all) { 
		document.body.scroll = choice; 
	} 
} 

function form_disable(formname,isdisable)
{
	
	var frm=document[formname];
	for ( var i = 0 ; i < frm.length; i ++)
	{
		frm[i].disabled = isdisable;	
		
	}
	
}

// ÀüÃ¼¼±ÅÃ,¹ÝÀü,¼±ÅÃ°ª °ª °¡Á®¿À±â
function getselectnum(frm,obj,sep) {
	var nCheckedCnt = 0;
	var select_num='';
	if (sep == "") sep=":";
	for (var nIdx=0; nIdx < frm.elements.length; nIdx++) {
		var objElement = frm.elements[nIdx];
		if (objElement.name == obj) {
			if (objElement.checked) {
				nCheckedCnt++;
				select_num+=objElement.value;
				select_num+=sep;
			}
		}
	}
	if (nCheckedCnt == 0) {
		alert("¼±ÅÃÇÑ ¹øÈ£°¡ ¾ø½À´Ï´Ù.");
		return false;
	}
	return select_num;
}
function selectall(frm,obj) {
	for (var nIdx=0; nIdx < frm.elements.length; nIdx++) {
		var objElement = frm.elements[nIdx];
		if (objElement.name == obj) {
			objElement.checked = true;
		}
	}
}
function reverseall(frm,obj)
{
	for (var nIdx=0; nIdx < frm.elements.length; nIdx++) {
		var objElement = frm.elements[nIdx];
		if (objElement.name == obj) {
			if (objElement.checked == true) {
				objElement.checked = false;
			} else {
				objElement.checked = true;
			}
			
		}
	}
}

function change_start_year() {
var frm = document.frm;

	if(frm.start_year.selectedIndex == 0) {
		frm.start_month.selectedIndex = 0;
		frm.start_day.selectedIndex = 0;
	}
}
function ischange_start(obj) {
var frm = document.frm;

	if(frm.start_year.selectedIndex == 0) {
		alert('³âµµ¸¦ ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.start_year.focus();
		return;
	}
	if(obj == frm.start_month && frm.start_month.selectedIndex == 0) {
		alert('¿ùÀ» ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.start_month.focus();
	}
	if(obj == frm.start_day && frm.start_day.selectedIndex == 0) {
		alert('ÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.start_day.focus();
	}
	if(obj == frm.start_day && frm.start_day.selectedIndex != 0) {
		if (isdate(frm.start_year.value, frm.start_month.value, frm.start_day.value) == false)
		{
			alert('ÇØ´ç ÀÏÀÚ´Â Àß¸øµÈ ÀÏÀÚ ÀÔ´Ï´Ù.\nÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä');
			obj.selectedIndex = 0;
			frm.start_day.focus();
		}	
	}

}

function change_end_year() {
var frm = document.frm;

	if(frm.end_year.selectedIndex == 0) {
		frm.end_month.selectedIndex = 0;
		frm.end_day.selectedIndex = 0;
	}
}
function ischange_end(obj) {
var frm = document.frm;

	if(frm.end_year.selectedIndex == 0) {
		alert('³âµµ¸¦ ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.end_year.focus();
		return;
	}
	if(obj == frm.end_month && frm.end_month.selectedIndex == 0) {
		alert('¿ùÀ» ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.end_month.focus();
	}
	if(obj == frm.end_day && frm.end_day.selectedIndex == 0) {
		alert('ÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.end_day.focus();
	}	
	if (obj == frm.end_day && isdate(frm.end_year.value, frm.end_month.value, frm.end_day.value) == false)
	{
		alert('ÇØ´ç ÀÏÀÚ´Â Àß¸øµÈ ÀÏÀÚ ÀÔ´Ï´Ù.\nÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä');
		obj.selectedIndex = 0;
		frm.end_day.focus();
	}		

}

function intsize_frame(){

	var hsize = document.body.scrollHeight;
	parent.intsize(hsize);
	
}
function intsize(){
	document.body.scrollIntoView(false);
	if (parent.document.all.iframe) {
		document.all.iframe.height = iframe.document.body.scrollHeight;
	}
	if (document.all.iframe) {
		document.all.iframe.height = iframe.document.body.scrollHeight;
	}
	
}
function selectAll(mode) {
var i, form=document.FormX;
  if (mode == 't') {
	select_all.style.display='none';
	cancel_all.style.display='block';
		for(i=0;i<form.length;i++) {
			if(form[i].type!='checkbox') continue;
			form[i].checked=true;
		}
   } else if (mode == 'f') {
	select_all.style.display='block';
	cancel_all.style.display='none';
	   for(i=0;i<form.length;i++) {
			if(form[i].type!='checkbox') continue;
			form[i].checked=false;
		 }
   }	
}

function  check_sms(mode) {
  var f=document.FormX;
	var	select_hp = getselectnum(f,"hp",":");
   if(select_hp == false) {
	  return;
   } else {
	f.send_hp.value = select_hp;
	  if (mode == 'url') {
		 f.action="/admin/sms/select_url.php"; 
	  } else if (mode == 'text') {
		 f.action="/admin/sms/select_sms.php"; 
	  } else {
		f.action="url_sms.php";
	  }
	  f.submit();
   }
}
function addchecksms(frm,obj,hp) {
	index=frm.obj.options.length;

	if ( index==0) {
		index = index+1;
	}
	phoneRe = /(01[016789])-?([0-9]{3,4})-?([0-9]{4})/ ;
	var checkhp = phoneRe.exec(hp);
    if(checkhp == null) {
		return false;
	}
	hp = RegExp.$1 + RegExp.$2 + RegExp.$3;

	for (i=0; i < index ; i++) {
		if (frm.obj.options[i].text ==  hp + ";") {
			return false;
		}
	}
	return true;
} 

//ÄíÅ° Á¤º¸ °¡Àú¿À±â
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 iframe_print() {
		parent.iframe.focus();
		parent.iframe.print();
	}


//document.onkeydown = gotKey;
//window.onload=function(){document.body.focus();allblur();statusFix();}
//document.ondragstart=function(){return false}
//document.onselectstart=function(){return false}
//document.oncontextmenu=function(){return false}


function trim(str){
	if (str == null) {return 0;}
	var count=str.length,len=count,st=0;
	while(st<len&&str.charAt(st)<=' ')st++;
	while(st<len&&str.charAt(len-1)<=' ')len--;
	return (st>0||len<count) ? str.substring(st,len) : str ;
}

function bytelen(s){ 
	var len = 0; 
	if ( s == null ) {return 0;}
	for( i = 0; i < s.length; i++) {
		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; 
}

// Flash 
var EMBED =
{
	timer : null,

	activateObjects : function(tagname)
	{
		var objects = document.getElementsByTagName(tagname);

		

		for (var i = 0; i < objects.length; i++)
		{
			if (!objects[i].done)
			{
				objects[i].outerHTML = objects[i].outerHTML;
				objects[i].done = true;

			}
		}
	},

	activateAllObjects : function()
	{
		EMBED.activateObjects("OBJECT");
		EMBED.activateObjects("EMBED");
	}
}

EMBED.timer = setInterval(EMBED.activateAllObjects, 200);
window.attachEvent("onload", function() { clearInterval(EMBED.timer); EMBED.timer = null; EMBED.activateAllObjects(); });



function fFlash_Activate(argSRC, argWIDTH, argHEIGHT, argID, argWMODE) {
	var contents = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + argID  + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0 " width="' + argWIDTH + '" height="' +argHEIGHT +'">';
	contents += '<param name="menu" value="false">';
	if (typeof(argWMODE) == "undefined") {
		contents += '<param name="wmode" value="transparent">';
	} else {
		contents += '<param name="wmode" value="' + argWMODE + '">';
	}
	contents += '<param name="movie" value="' + argSRC + '">';
    contents += '<param name="quality" value="high">';
    contents += '<embed src="' + argSRC + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" ';
	if (typeof(argWMODE) == "undefined") {
		contents += ' wmode="transparent" ';
	} else {
		contents += ' wmode="' + argWMODE + '" ';
	}
	contents += ' type="application/x-shockwave-flash" width="' + argWIDTH + '" height="' + argHEIGHT +'"></embed></object>';
	document.write(contents);
}

//Á¡ÇÁ ¸Þ´º
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  window.open(selObj.options[selObj.selectedIndex].value, "Family");
  //eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//°ü·ÃÀÌ¹ÌÁö ¿Ã¸®±â »õÃ¢
function inputImg(Part,Code)
{
	window.open("input_img.asp?part="+Part+"&code="+Code,"","scrollbars=yes,left=200,top=200,width=467,height=500");
}