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.0
  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 && document.getElementById) x=document.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 CheckEmail(strEmail) {
  var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
  var check=/@[\w\-]+\./;
  var checkend=/\.[a-zA-Z]{2,3}$/;

  if(((strEmail.search(exclude) != -1)||(strEmail.search(check)) == -1)||(strEmail.search(checkend) == -1)){
      return false;
  }
  else {
      return true;
  }
}

// Ã¢À» ¿ÀÇÂ½ÃÅ²´Ù.
function URL_Open(v_url) {
  open(v_url,'¸µÅ©');
}

// Ã¢À» ¿ÀÇÂ½ÃÅ²´Ù.
function winopen(url,query,value,name,style) {
  if((query.length > 0) && (value.length > 0)) { url = url + "?" + query + "=" + value; }
  mod = open(url,name,style);
  mod.focus();
}
//Åë°èÃ¢ ¶ç¿ì±â
function win_open(url,name,opt) {
  window.open(url,name,opt);
}
// ¼ýÀÚ¸¸ ÀÔ·Â¹Þ´Â´Ù. Æ¯¼ö¹®ÀÚ('-','.',...)µµ Çã¿ëÇÑ´Ù.
function onlyNumber() {
  if((event.keyCode > 31) && (event.keyCode < 45) || (event.keyCode > 57)) {
    event.returnValue = false;
  }
}

// ¼ýÀÚ¸¸ ÀÔ·Â¹Þ´Â´Ù. "-"µµ ¹ÞÁö¾Ê´Â´Ù.
function onlyNumber2(loc) {
  if(/[^0123456789]/g.test(loc.value)) {
    alert("¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.\n\n0-9ÀÇ Á¤¼ö¸¸ Çã¿ëÇÕ´Ï´Ù.");
    loc.value = "";
    loc.focus();
  }
}

// ¼ýÀÚ¸¸ ÀÔ·Â¹Þ´Â´Ù. "-"µµ ¹Þ´Â´Ù.
function onlyNumber3(loc) {
  if(/[^0123456789-]/g.test(loc.value)) {
    alert("¼ýÀÚ°¡ ¾Æ´Õ´Ï´Ù.\n\n0-9ÀÇ Á¤¼ö¿Í -¸¸ Çã¿ëÇÕ´Ï´Ù.");
    loc.value = "";
    loc.focus();
  }
}


// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å©
function residentno_chk(RegNo1,RegNo2) {
  No1  = parseInt(RegNo1.substring(0,1))
  No2  = parseInt(RegNo1.substring(1,2))
  No3  = parseInt(RegNo1.substring(2,3))
  No4  = parseInt(RegNo1.substring(3,4))
  No5  = parseInt(RegNo1.substring(4,5))
  No6  = parseInt(RegNo1.substring(5,6))

  No7  = parseInt(RegNo2.substring(0,1))
  No8  = parseInt(RegNo2.substring(1,2))
  No9  = parseInt(RegNo2.substring(2,3))
  No10 = parseInt(RegNo2.substring(3,4))
  No11 = parseInt(RegNo2.substring(4,5))
  No12 = parseInt(RegNo2.substring(5,6))
  No13 = parseInt(RegNo2.substring(6,7))

  tot = (No1*2)+(No2*3)+(No3*4)+(No4*5)+(No5*6)+(No6*7)+(No7*8)+(No8*9)+(No9*2)+(No10*3)+(No11*4)+(No12*5);
  rst = ""+(11-(tot-(parseInt(""+(tot/11))*11)))

  if(parseInt(rst) >= 10) {
    rst = ""+(parseInt(rst)-10)
  }

  if(rst != No13) {
    return false;
  } else {
    return true;
  }
}

//ÅØ½ºÆ®¿¡¼­ ÀÏÁ¤ Å©±â ÀÌ»ó½Ã ´ÙÀ½À¸·Î ÀÌµ¿ÇÏ±â
function textjump(ct1,ct2,v) {
  if(ct1.value.length == v) 
  {
     ct2.focus();
  }
}

//»ý³â¿ùÀÏ ÀÚµ¿À¸·Î ÀÔ·ÂÇÏ±â
function resident_chk() {
       if(residentno_chk(regform.user_residentno1.value,regform.user_residentno2.value) != true) {
          alert("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
          regform.user_residentno1.value = "";
          regform.user_residentno2.value = "";
          regform.user_residentno1.focus();
          return false;
       } else {
          birthyy    = regform.user_residentno1.value.substr(0,2);
          birthmonth = regform.user_residentno1.value.substr(2,2);
          birthday   = regform.user_residentno1.value.substr(4,2);
          if((regform.user_residentno2.value.substr(0,1) == "3")||
             (regform.user_residentno2.value.substr(0,1) == "4")) {
             birthyear = "20" + birthyy;
          } else {
             birthyear = "19" + birthyy;
          }
          regform.birthyear.value  = birthyear;
          regform.birthmonth.value = birthmonth;
          regform.birthday.value   = birthday;
       }
}

//ÇÑ±ÛÀÎÁö ¿©ºÎÈ®ÀÎ
function ishangul (target){
        for ( var i=0; i<target.length; i++){
            if ( target.charCodeAt(i) > 256){
                return  true;
            }
        }
        return  false;
}


   
function openNewWindow(window) {
open (window,"NewWindow","left=0, top=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=501, height=470");
}
