/*----------------------------------------------------------------------------*/
/*  NAME : IEÆÐÄ¡¿ë ÀÚ¹Ù½ºÅ©¸³Æ®È£Ãâ.                                          */
/*----------------------------------------------------------------------------*/
document.write("<SCRIPT language='JavaScript' src='/pos1/js/PCOMIEPatch.js'></SCRIPT>");

/*----------------------------------------------------------------------------*/
/*  NAME : URLÀ» Á÷Á¢ÀÔ·ÂÇßÀ»°æ¿ì¸¦ ÆÇ´ÜÇÑ´Ù.                                   */
/*  DESC :                                                                    */
/*  DATE : 2004.6.18                                                          */
/*  AUTH : ÀÌ½ÂÁØ                                                             */
/*----------------------------------------------------------------------------*/

var vCurrentUrl1 = "http://" + location.host +  "/";                     
var vCurrentUrl2 = "http://" + location.host +  "/pos1/";                
var vCurrentUrl3 = "http://" + location.host +  "/iris/";                
var vCurrentUrl4 = "http://" + location.host +  "/icis/";                
var vCurrentUrl5 = "http://" + location.host +  "/re1/";
var vCurrentUrl6 = "http://" + location.host +  "/";
var vCurrentUrl7 = vCurrentUrl2 + "pfrontservlet?cmd=PLETGetListLastLetterC";
var vCurrentUrl8 = vCurrentUrl2 + "pfrontservlet?cmd=PBOAGetNoticeC";
var vCurrentUrl9 = vCurrentUrl2 + "pfrontservlet?cmd=PFrmGetRegistryPrecedFormC";
var vCurrentUr20 = vCurrentUrl2 + "pfrontservlet?cmd=PFrmGetRegistryFormC";


if ( opener == null ){
    if( ( top.location.href != vCurrentUrl1 ) 
     && ( top.location.href != vCurrentUrl1 + "index.html") 
     && ( top.location.href != vCurrentUrl1 + "index.htm") 
     && ( top.location.href != vCurrentUrl1 + "index.jsp") 
     && ( location.href     != vCurrentUrl1 + "index.jsp") 
     && ( top.location.href != vCurrentUrl2 ) 
     && ( top.location.href != vCurrentUrl2 + "index.html")      
     && ( top.location.href != vCurrentUrl3 + "index.jsp") 
     && ( top.location.href != vCurrentUrl4 + "index.jsp")
     && ( top.location.href != vCurrentUrl5 + "eFormIndex.jsp")
     && ( top.location.href != vCurrentUrl6 + "efrontservlet?cmd=EURLoginEC")
     && ( top.location.href.indexOf(vCurrentUrl7) == -1)
     && ( top.location.href.indexOf(vCurrentUrl8) == -1)
     && ( top.location.href.indexOf(vCurrentUrl9) == -1)
     && ( top.location.href.indexOf(vCurrentUr20) == -1)



    ){
       
//        alert( '¸Þ´º¸¦ ÅëÇØ Á¢¼ÓÇÏÁö ¾Ê¾Ò½À´Ï´Ù. µî±â Æ÷Å» ÃÊ±â È­¸éÀ¸·Î ÀÌµ¿ÇÕ´Ï´Ù...');
//        top.document.location = vCurrentUrl1+"index.html";
    }
}else{
      
    if( ( opener.top.location.href != vCurrentUrl1 ) 
     && ( opener.top.location.href != vCurrentUrl1 + "index.html") 
     && ( opener.top.location.href != vCurrentUrl1 + "index.htm") 
     && ( opener.top.location.href != vCurrentUrl1 + "index.jsp")
     && ( location.href            != vCurrentUrl1 + "index.jsp") 
     && ( opener.top.location.href != vCurrentUrl2 ) 
     && ( opener.top.location.href != vCurrentUrl2 + "index.html")      
     && ( opener.top.location.href != vCurrentUrl3 + "index.jsp") 
     && ( opener.top.location.href != vCurrentUrl4 + "index.jsp")
     && ( opener.top.location.href != vCurrentUrl5 + "eFormIndex.jsp")
     && ( opener.top.location.href != vCurrentUrl6 + "efrontservlet?cmd=EURLoginEC")
    ){
        
//        alert( '¸Þ´º¸¦ ÅëÇØ Á¢¼ÓÇÏÁö ¾Ê¾Ò½À´Ï´Ù. ');
//        window.close()
    }

} 

/*----------------------------------------------------------------------------*/
/* NAME : f_nextFocus                                                        */
/* DESC : ÅÇ¹öÆ°À» Å¬¸¯½Ã ´ÙÀ½ ÇÊµå·Î Æ÷Ä¿½ºÀÌµ¿                                */
/* DATE : 2004.04.03                                                          */
/* AUTH : ¾ç¹®ÁØ                                                               */
/*----------------------------------------------------------------------------*/
function f_nextFocus(  f, num ){
    var frm = f.form; 
    
    if( f.value.length < num)  return; 
    for(i=0;i< frm.elements.length;i++){
      if(   frm.elements[i] == f  ){
        frm.elements[i+1].focus();
        break;
      }
    }
}

function MM_openBrWindowTop1() {  
    //theURL    = "http://glaw.scourt.go.kr/glis/legal_r/SearchFrame.jsp";
    //º»ÆäÀÌÁö¿¡ Help File load    
    left_url = "/pos1/html/data/PINFPrecedH.html";  
    parent.contents.location.replace( left_url ); 
    //Help URL OPEN LINK    
    theURL   = "/pos1/html/inf/PINFPreceedH.html";
    winName  = "Reg";
    features = "top=20,left=20,width=970,height=612,resizable=yes"; 
    rgspopWin = window.open(theURL,winName,features);
    rgspopWin.focus();
}
/*----------------------------------------------------------------------------*/
/* NAME : f_popup                                                              */
/* DESC :  ÆË¾÷ È£Ãâ                                                          */
/* DATE : 2004.03.19                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function f_popup(param){

    f = document.frmMain;
    
    //½ÅÃ»»ç°Ç Ã³¸®ÇöÈ²Á¶È¸ link
    if( param == 10 ) {
       vUrl = "/iris/hom/RHOMViewEvtJ.jsp";
       f.isu_view.value  = "";
       f.frompotal.value = "";
       iwid = 829;  
       ihei = 650;   
       //iwid = screen.width-10;  
       //ihei = screen.height; 
       RHOMViewEvtWin = window.open( vUrl,"RHOMViewEvt","top=0,left=0,width="+iwid+",height="+ihei+",toolbar=no,scrollbars=yes,resizable=no,status=no,titlebar=yes,menubar=no,location=no");
       //RHOMViewEvtWin.focus();
    }
    // °æÁ¤¿äÃ» ¹Ù·Î°¡±â - link 
    else if( param == 0 ) {
       vUrl = "/iris/index.jsp";
       f.isu_view.value = "req";
       f.frompotal.value = "Y";
       f.action = vUrl;
       f.method ="post";
       f.target="_blank";
       f.submit(); 
    }
    // µî±âºÎ¹ß±ÞÈ®ÀÎ Á¶È¸ link
    else if( param == 20 ) {
       vUrl = "/iris/vin/RVINIsuChkNumShortcutJ.jsp";
       f.isu_view.value  = "";
       f.frompotal.value = "";
       iwid = 829;  
       ihei = 650;   
       //iwid = screen.width-10;  
       //ihei = screen.height; 
       wndIsuChkNum = window.open( vUrl,"RVINIsuChkNumShortcut","top=0,left=0,width="+iwid+",height="+ihei+",toolbar=no,scrollbars=yes,resizable=no,status=no,titlebar=yes,menubar=no,location=no");
    } 
} 

/*----------------------------------------------------------------------------*/
/* NAME : f_popup                                                              */
/* DESC :  ÆË¾÷ È£Ãâ                                                          */
/* DATE : 2004.03.19                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function f_corp_popup(param){

    f = document.frmMain;
    
    //½ÅÃ»»ç°Ç Ã³¸®ÇöÈ­Á¶È¸ link
    if( param == 10 ) {
       vUrl = "/icis/hom/IHOMViewEvtJ.jsp";
       f.gomenu.value  = "";
       f.frompotal.value = "";
       iwid = 829;  
       ihei = 650;   
       //iwid = screen.width-10;  
       //ihei = screen.height; 
       RHOMViewEvtWin = window.open( vUrl,"RHOMViewEvt","top=0,left=0,width="+iwid+",height="+ihei+",toolbar=no,scrollbars=yes,resizable=no,status=no,titlebar=yes,menubar=no,location=no");
       //RHOMViewEvtWin.focus();
    }
    // °æÁ¤¿äÃ» ¹Ù·Î°¡±â - link 
    if( param == 0 ) {
       vUrl = "/icis/index.jsp";
       f.gomenu.value = "req";
       f.frompotal.value = "Y";
       f.action = vUrl;
       f.method ="post";
       f.target="_blank";
       f.submit(); 
    }
 
} 
 
/*----------------------------------------------------------------------------*/
/* NAME : f_location()                                                        */
/* DESC : °¢È­¸éÀÇ À§Ä¡(location¸µÅ©)                                          */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */ 
/*----------------------------------------------------------------------------*/
function f_location( menu, submenu1, submenu2, menuNM1, menuNM2 ){
  
     if( !opener ) { 
    
         document.write("<a href='javascript:top.location.replace(\"/index.html\")'   class='local'>Home</a> &gt; ");
         document.write("<a href=\"javascript:f_class('loc','"+menu+"', '"+submenu1+"');\" class='local'>" + menuNM1 + "</a>");
         if( submenu2 != "") {
          document.write(" &gt; <a href=\"javascript:f_class('loc','"+menu+"', '"+submenu2+"');\" class='local'>" + menuNM2 + "</a> &gt;");
         } else {
           if(menu != "menu06")
          {
            document.write(" &gt; ");
          }
         }
         
     }
}  

/*----------------------------------------------------------------------------*/
/* NAME : f_home()                                                        */
/* DESC : °¢È­¸éÀÇ À§Ä¡(location¸µÅ©)                                          */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¼­µ¿±¹                                                              */ 
/*----------------------------------------------------------------------------*/
function f_home(){
 document.write("<a href=\"javascript:top.location.replace('/index.html');\"   class='local'>Home</a> &gt; ");
}  

/*----------------------------------------------------------------------------*/
/* NAME : f_homemypage()                                                        */
/* DESC : °¢È­¸éÀÇ À§Ä¡(location¸µÅ©)                                          */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¼­µ¿±¹                                                              */ 
/*----------------------------------------------------------------------------*/
function f_homemypage(){
}  



/*----------------------------------------------------------------------------*/
/* NAME : f_location()                                                        */
/* DESC : Å¾¸Þ´º,¸µÅ©»ç¿ë½Ã                                                    */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */ 
/*----------------------------------------------------------------------------*/ 
function f_class( obj, menu , submenu ) {  

}

/*----------------------------------------------------------------------------*/
/* NAME : onTooltip()                                                         */
/* DESC : ±Ý¾× ÀÔ·Â½Ã ÀÔ·ÂÇÊµå »ó´Ü¿¡ ÇÑ±Û·Î ±Ý¾×À» Ç¥½ÃÇÑ´Ù.                    */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function onTooltip(target,revtooltip) {
  var E = window.event;
  var temp = target.value;
  temp = temp.replace(/,/gi, "");
  var tag="¿ø½Ê¹éÃµ¸¸½Ê¹éÃµ¾ï½Ê¹éÃµÁ¶½Ê¹éÃµ°æ";
  var result="";
  var i,j;
  var tempSub;
  for(i=0;i<temp.length;i++)  {
    tempSub = temp.substring(temp.length - 1 - i, temp.length - i);
    if (tempSub != "0") result = tempSub + tag.substring(i,i+1) + result;
    else if (i == 0)  {
      result = tag.substring(i,i+1) + result;
    }  else if ( ((i%4) == "0") && ((i+1) != temp.length) ){
      for (j=1;j<4;j++)  {
        if (temp.length - 1 - i - j >= 0){
          if ( temp.substring(temp.length - 1 - i - j, temp.length - i - j) != "0" )  {
            result = tag.substring(i,i+1) + result;
            j=4;
          }
        }
      }
    }
  }
  document.getElementById(revtooltip).style.pixelLeft = E.clientX - document.body.scrollLeft - E.offsetX + 80 - result.length * 9;
  document.getElementById(revtooltip).style.pixelTop =  E.clientY + document.body.scrollTop - E.offsetY - 25;
  document.getElementById(revtooltip).style.width = result.length * 10 + 20;
  document.getElementById(revtooltip).style.color = "white";
  document.getElementById(revtooltip).style.visibility = "visible";  // ÅøÆÁ º¸ÀÌ±â
  document.getElementById(revtooltip).innerHTML = result;
}

/*----------------------------------------------------------------------------*/
/* NAME : onTooltip()                                                         */
/* DESC : ±Ý¾× ÀÔ·Â½Ã ÀÔ·ÂÇÊµå »ó´Ü¿¡ ÇÑ±Û·Î ±Ý¾×À» Ç¥½ÃÇÑ´Ù.                    */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function onTooltip1(target,revtooltip, event) {
  var E = event;
  var temp = target.value;
  temp = temp.replace(/,/gi, "");
  var tag="¿ø½Ê¹éÃµ¸¸½Ê¹éÃµ¾ï½Ê¹éÃµÁ¶½Ê¹éÃµ°æ";
  var result="";
  var i,j;
  var tempSub;
  for(i=0;i<temp.length;i++)  {
    tempSub = temp.substring(temp.length - 1 - i, temp.length - i);
    if (tempSub != "0") result = tempSub + tag.substring(i,i+1) + result;
    else if (i == 0)  {
      result = tag.substring(i,i+1) + result;
    }  else if ( ((i%4) == "0") && ((i+1) != temp.length) ){
      for (j=1;j<4;j++)  {
        if (temp.length - 1 - i - j >= 0){
          if ( temp.substring(temp.length - 1 - i - j, temp.length - i - j) != "0" )  {
            result = tag.substring(i,i+1) + result;
            j=4;
          }
        }
      }
    }
  }
  document.getElementById(revtooltip).style.pixelLeft = E.clientX - document.body.scrollLeft - E.offsetX - 150 - result.length * 9;
  document.getElementById(revtooltip).style.pixelTop =  E.clientY + document.body.scrollTop - E.offsetY - 100;
  document.getElementById(revtooltip).style.width = result.length * 10 + 20;
  document.getElementById(revtooltip).style.color = "white";  
  document.getElementById(revtooltip).style.display = "";	  // ÅøÆÁ º¸ÀÌ±â
  document.getElementById(revtooltip).innerHTML = result;
}

/*----------------------------------------------------------------------------*/
/* NAME : offTooltip()                                                        */
/* DESC : ÇÑ±Û·Î Ç¥½ÃµÈ ±Ý¾×À» °¨Ãá´Ù.                                         */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function offTooltip(revtooltip) {
  document.getElementById(revtooltip).style.visibility = "hidden";  // ÅøÆÁ °¨Ãß±â
}

function offTooltip1(revtooltip) {
  document.getElementById(revtooltip).style.display = "none";  // ÅøÆÁ °¨Ãß±â
}
/*----------------------------------------------------------------------------*/
/* NAME : num_check()                                                         */
/* DESC : ÀÔ·ÂµÈ ±Ý¾×¿¡ Ãµ´ÜÀ§·Î ÄÞ¸¶¸¦ Âï¾îÁØ´Ù.                               */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function num_check(a){
  var src = a.value;
  src = src.replace(/,/gi, "");
  var lenOfnum = src.length;
  var str="";
  if ( lenOfnum > 3){
      for ( var i=0; i <= lenOfnum; i++ ){
        if ( i % 3 == 0 && i >= 3  && i != lenOfnum){
          str = "," + str;
        }
        str =  src.charAt((lenOfnum - 1 ) - i) + str;
      }
      a.value = str;
  }
}
/*----------------------------------------------------------------------------*/
/* NAME : numberCheck()                                                       */
/* DESC : ÀÔ·ÂµÈ ±Ý¾×ÀÌ ¼ýÀÚÀÎÁö Ã¼Å©ÇÑ´Ù.                                      */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                              */
/*----------------------------------------------------------------------------*/
function numberCheck(target){
  if (target.value.length == 0) {  return true;}
  var digit="1234567890,";
  var i;
  var j;
  var k=0;
  var t=target.value;
  for(i=0;i<t.length;i++){
    if(digit.indexOf(t.substring(i,i+1))<0) {
      alert("¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä.");
      var temp="";
      target.value = temp;
      target.focus();
      return false;
    }
  }
  return true;
}

//¼ýÀÚ¸¸À» ±âÀÔ¹Þ°Ô ÇÏ´Â ¹æ¹ý
function onlyNumber(obj) {

	var instr = obj.value;
	var cstr = "";
	var tempstr = "";

	cstr="0123456789-";             //Á¤¼ö

	//°Å²Ù·Î µ¹·Á¾ß ÇÔ
	if(instr.length) {
		var len = instr.length;
	for(var i=len-1; i>=0; i--) {
		if(cstr.lastIndexOf(instr.charAt(i)) == -1) {
				instr = instr.substring(0, i)+ instr.substring(i+1);
		obj.value = instr;
		}
	}
	}
}
/*----------------------------------------------------------------------------*/
/* NAME : PCOMGetByteLength                                                   */
/* DESC : KEY Á¤ÀÇ                                                            */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                               */
/*----------------------------------------------------------------------------*/  
function PCOMGetByteLength(str) {
  var byteLength = 0;

  str = String(str);
  for (var i = 0; i < str.length; i++) {
    var oneChar = escape(str.charAt(i));
    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 PCOMIsValidStrLength(str,limit) {
  if ( PCOMGetByteLength(str) > limit )
    return false;
  else
    return true;
}
/*----------------------------------------------------------------------------*/
/* NAME : PCOMFuncKey                                                         */
/* DESC : KEY Á¤ÀÇ                                                            */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                               */
/*----------------------------------------------------------------------------*/  
function KeyPress_Filter(sFilter, event){ 
  var keycode= event.keyCode; 
  var sKey= String.fromCharCode(event.keyCode);
  var re  =new RegExp(sFilter);
  if( keycode != "35"  && keycode != "36" &&
      keycode != "37"  && keycode != "38" &&
      keycode != "39"  && keycode != "40" &&
      keycode != "46"  && keycode != "8"  &&
      keycode != "9"   && keycode != "13" &&
      keycode != "189" && keycode != "109" &&
      !( keycode >= "96"  &&  keycode  <= "105") &&!re.test(sKey) ) {
    event.returnValue = false;
  }
}  

/*----------------------------------------------------------------------------*/
/* NAME : PCOMFuncKey                                                         */
/* DESC : KEY Á¤ÀÇ                                                            */
/* DATE : 2004.04.07                                                          */
/* AUTH : ¿ÕÁ¾È£                                                               */
/*----------------------------------------------------------------------------*/  
function KeyPress_Filter1(sFilter, event){ 
  var keycode= event.keyCode; 
  var sKey= String.fromCharCode(event.keyCode);
  var re  =new RegExp(sFilter);
  if( keycode != "35"  && keycode != "36" &&
      keycode != "37"  && keycode != "38" &&
      keycode != "39"  && keycode != "40" &&
      keycode != "46"  && keycode != "8"  &&
      keycode != "9"   && keycode != "13" &&
      keycode != "189" && keycode != "109" &&
      !( keycode >= "96"  &&  keycode  <= "105") &&!re.test(sKey) ) {
    event.returnValue = false;
  }
} 
// ------------------------ Æ÷Ä¿½º Ã³¸® °ü·Ã -----------------------------------
// Enter Key°¡ ÀÔ·ÂµÇ¸é focus ÀÌµ¿
function PCOMNextControl(target) {
  if(event.keyCode != 13 ) return false;
  alert( String(target.type) );
  target.focus();
  if (String(target.type) == "text") target.select();
  return true;
}
function isNumber(a,MinValue,MaxValue){
  //comma format ¼ýÀÚ ¶Ç´Â ±×³É ¼ýÀÚ
  a = a + "";
  a = delChar(a, ',');
  if (isEmpty(a)) return false;
  a = Trim(a);
  for (i=0;i< a.length; i++) {
      if (a.substring(i,i+1) < '0' || a.substring(i,i+1) > '9')
      return false;
  }
  if (MinValue != null && a < MinValue) return false;
  if (MaxValue != null && a > MaxValue) return false;
  return true;
} 
function LTrim(a){
 var i;
 i = 0;
 while (a.substring(i,i+1) == ' ' || a.substring(i,i+1) == '¡¡')  i = i + 1;
 return a.substring(i);
}
function RTrim(a){
 var b;
 var i = a.length - 1;
 while (i >= 0 && (a.substring(i,i+1) == ' ' || a.substring(i,i+1) == '¡¡')) i = i - 1;
 return a.substring(0,i+1);
}
function Trim(a){
  return(LTrim(RTrim(a)));
}
function isEmpty(a){
  if (Trim(a) == '') return true;
  return false;
}
//¿À¸¥ÂÊ¿¡ ch ¹®ÀÚ Ã¤¿ì±â
function RPadString(newValue, ch, len){
  var strlen = Trim(newValue).length;
  var ret = "";
  var alen = len - strlen;
  var astr = "";
  for (i=0; i<alen; ++i)  {
    astr = astr + ch;
  }
  ret = Trim(newValue) + astr;
  return ret;
}
//¿ÞÂÊ¿¡ ch ¹®ÀÚ Ã¤¿ì±â
function LPadString(newValue, ch, len){
    var strlen = Trim(newValue).length;
    var ret = "";
    var alen = len - strlen;
    var astr = "";
    for (i=0; i<alen; ++i)  {
      astr = astr + ch;
    }
    ret = astr + Trim(newValue);
    return ret;
}
function Format_Comma(newValue_1){
  var newValue = newValue_1 + "";
  var len = newValue.length;
  var ch = "";
  var j = 1;
  var formatValue = "";
  newValue = delChar(newValue, ',');
  len = newValue.length;
  for (i = len; i > 0; i--){
    ch = newValue.substring(i - 1, i);
    formatValue = ch + formatValue;
    if ((j % 3) == 0 && i > 1){
      formatValue = "," + formatValue;
    }
    j++;
  }
  return formatValue;
}
function delChar(newValue, ch){
  var len = newValue.length;
  var ret = "";
  for (i=0; i<len; ++i){
    if (newValue.substring(i,i+1) != ch)
      ret = ret + newValue.substring(i,i+1);
  }
  return ret;
}
function parseIntComma(newValue){
    var ret = "";
    return parseInt(delChar(newValue, ','), 10);
}

/******* ³¯Â¥ÀÎÁö Ã¼Å© ********/
function isDate(y,m,d){
  var yy,mm,dd;
  if (!isNumber(y) || !isNumber(m) || !isNumber(d)) return false;
  yy = parseInt(y, 10);
  mm = parseInt(m, 10);
  dd = parseInt(d, 10);
  if (yy < 1900 || yy > 2200 ) return false;
  if (mm < 1 || mm > 12) return false;
  if (dd < 1) return false;
  if (mm == 1 || mm == 3 || mm == 5 || mm == 7 || mm == 8 || mm==10 || mm==12)  {
          if (dd > 31) return false;
  } else if (mm==2) {
          if (isYunNyun(yy)){
            if (dd > 29) return false;
          } else {
            if (dd > 28) return false;
          }
  } else if (dd > 30) return false;
  return true;
}
// ³â ¿ùÀÇ ³¯Â¥ Ã¼Å©
/******* ³¯Â¥ÀÎÁö Ã¼Å© ********/
function isYM(y,m){
  var yy,mm;
  if (!isNumber(y) || !isNumber(m)) return false;
  yy = parseInt(y, 10);
  mm = parseInt(m, 10);
  if (yy < 1900 ) return false;
  if (mm < 1 || mm > 12) return false;
  return true;
}
function date_FormatYM(ym, formatmask){
  var fcount = formatmask.length;
  var len = Trim(ym).length;
  var rv = "";
  ym = Trim(ym);
  if (len == 6){
    if (ym.substring(4, 5) == "-")  {
            return  ym;
    }
    y = ym.substring(0, 4);
    m = ym.substring(4, 6);
  }else if (len == 7){
    if (ym.substring(4, 5) != "-")  {
            return  -1;
    }
    y = ym.substring(0, 4);
    m = ym.substring(5, 7);
  } else {
    return ym;
  }
  var ym_concat = y + m;
  var ret_value = -1;

  if((fcount == 7) && (formatmask == "????-??")){
    if (isDateYM(ym_concat)){
            ret_value = y + "-" + m;
    }else{
            ret_value = -1;
    }
  }else{
    alert('Format["????-??"] Çü½ÄÀ» ¹Ù¸£°Ô ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
    ret_value = -1;
  }
  return ret_value;
}
function isDateYM(ym){
  var yy,mm;
  var y = "";
  var m = "";
  ym = Trim(ym);
  y = ym.substring(0, 4);
  m = ym.substring(4, 6);

  if ( isYM(y, m) == true )  {
    return true;
  } else {
    return false;
  }
}
function isYunNyun(y){
  if ( (y % 4) == 0 ){
    if ((y % 100) != 0) return true;
    if ((y % 400) == 0) return true;
  }
  return false;
}
 
function isDateYMD(ymd){
  var yy,mm,dd;
  var y = "";
  var m = "";
  var d = "";
  ymd = Trim(ymd);
  y = ymd.substring(0, 4);
  m = ymd.substring(4, 6);
  d = ymd.substring(6, 8);
  if ( isDate(y, m, d) == true ) return true;
  else return false;
}

//³âµµ Ã¼Å©
function isDateYYYY(yyyy){
  var yyyymmdd = yyyy + "0101";
  return isDateYMD(yyyymmdd);
}
//³â-¿ù Ã¼Å©
function isDateYYYYMM( yyyymm ){
  var returnValue = false;
  var len = Trim(yyyymm).length;
  yyyymm = Trim(yyyymm);

  if( len == 7 )  {
    if( yyyymm.substring(4, 5) == "-" )    {
      returnValue = isYM( yyyymm.substring(0, 4), yyyymm.substring(5, 7) );
    }
  }else if( len == 6 )  {
    returnValue = isYM( yyyymm.substring(0, 4), yyyymm.substring(4, 6) );
  }
  return returnValue;
}
 
//³¯ÀÚ Å©±â ºñ±³ ÀÔ·ÂÇü½Ä yyyy-mm-dd ¶Ç´Â yyyymmdd
function DateCmp(date1, date2){
  var s_date1 = delChar(date1,'-') + "";
  var s_date2 = delChar(date2,'-') + "";
  var ret = -2;
  if (s_date1 == s_date2) ret = 0;
  else if (s_date1 > s_date2) ret = 1;
  else if (s_date1 < s_date2) ret = -1;
  if (ret == -2)  alert("³¯ÀÚ ºñ±³°¡ Àß¸ø µÇ¾ú½À´Ï´Ù.");
  return ret;
}
/**
 *  ±æÀÌ ±¸ÇÏ´Â Function
 *
 * @param String data
 * @return boolean
*/
function Length_Check(data) {
    var numstr = "~!@#$%^&*()_+|\=-<>?/.,`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var thischar;
    var count = 0;
    data = data.toUpperCase( data )

    for ( var i=0; i < data.length; i++ ) {
      thischar = data.substring(i, i+1 );
          if ( numstr.indexOf( thischar ) != -1 )
              count++;
          else
              count = count + 2;
    }
    return  count;
}
// Æ¯¼ö¹®ÀÚµÇµ¹¸®±â(',")
function repCharHidden( val ){   
    valTemp   =  val.replace(/\\'/gi, "\'");
    retTemp   =  valTemp.replace( /\\"/gi, "\"");  
   return retTemp;
}



/*----------------------------------------------------------------------------*/
/* NAME : payNumberCheck()                                                       */
/* DESC : ÀÔ·ÂµÈ ±Ý¾×ÀÌ ¼ýÀÚÀÎÁö Ã¼Å©ÇÑ´Ù.                                      */
/* DATE : 2011.06.10                                                          */
/* AUTH : ±è»óÇö                                                              */
/*----------------------------------------------------------------------------*/
function payNumberCheck(target){
  if (target.value.length == 0) {  return true;}
  var digit="1234567890,-";
  var i;
  var t=target.value;
  for(i=0;i<t.length;i++){
    if(digit.indexOf(t.substring(i,i+1))<0) {
      alert("Á¤ÇØÁø ¹®ÀÚ¿Ü¿¡´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.\n Á¤ÇØÁø ¹®ÀÚ : ¼ýÀÚ/ÇÏÀÌÇÂ/½°Ç¥.");
      var temp="";
      target.value = temp;
      target.focus();
      return false;
    }
  }
  return true;
}
