function idcheck() {
   var member_id = document.joinform.member_id.value;
	
   if (member_id.length < 4) {
      alert("아이디는 4글자이상만 가능합니다.");
      document.joinform.member_id.focus();
      return false; }
	   
   if (member_id.search(/^(\w[\w-]*\w$)/) == -1) {
      alert("아이디에 특수문자나 한글은 불가능합니다.");
      document.joinform.member_id.focus();
      return false; }

   window.open("navigator.php?contents=member&usemode=idcheck&member_id=" + member_id, "idcheck", "width=300, height=160");
}

function zipcode(gubun) {
   window.open("navigator.php?contents=member&usemode=zipcode&gubun=" + gubun, "zipcode", "width=370, height=300, scrollbars=yes");
}

function zipcode2(gubun) {
   window.open("navigator.php?contents=admin&usemode=zipcode&gubun=" + gubun, "zipcode", "width=370, height=300, scrollbars=yes");
}

function jumincheck(jumin1, jumin2) {
   var str1 = jumin1;
   var str2 = jumin2;
   var li_lastid,li_mod,li_minus,li_last;
   var value0,value1,value2,value3,value4,value5,value6;
   var value7,value8,value9,value10,value11,value12;
   
   if (IsInteger(str1) && IsInteger(str2)) {
      li_lastid  = parseFloat(str2.substring(6,7));
      value0  = parseFloat(str1.substring(0,1))  * 2;
      value1  = parseFloat(str1.substring(1,2))  * 3;
      value2  = parseFloat(str1.substring(2,3))  * 4;
      value3  = parseFloat(str1.substring(3,4))  * 5;
      value4  = parseFloat(str1.substring(4,5))  * 6;
      value5  = parseFloat(str1.substring(5,6))  * 7;
      value6  = parseFloat(str2.substring(0,1))  * 8;
      value7  = parseFloat(str2.substring(1,2))  * 9;
      value8  = parseFloat(str2.substring(2,3))  * 2;
      value9  = parseFloat(str2.substring(3,4))  * 3;
      value10 = parseFloat(str2.substring(4,5))  * 4;
      value11 = parseFloat(str2.substring(5,6))  * 5;
      value12 = 0;
      
      value12 = value0+value1+value2+value3+value4+value5+value6+value7+value8+value9+value10+value11+value12 ;

      li_mod = value12 %11;
      li_minus = 11 - li_mod;
      li_last = li_minus % 10;
     	
      if (li_last != li_lastid) {
         return false; }
      else {
         return true; }
   } 
   else {
      return false; }
}

function IsInteger(st) {
   if (!IsEmpty(st)) {
      for (j=0; j<st.length; j++){
         if (((st.substring(j, j+1) < "0") || (st.substring(j, j+1) > "9")))
         return false;
      }
   }
   else { return false; }

   return true ;
}

function IsEmpty(toCheck) {
   var chkstr = toCheck + "";
   var is_Space = true ;
   if ( ( chkstr == "") || ( chkstr == null ) )
   return false ;
   for ( j = 0 ; is_Space &&  ( j < chkstr.length ) ; j++){
      if( chkstr.substring( j , j+1 ) != " " )
      is_Space = false ;
   }
   return ( is_Space );
}

function IsSpace(toCheck) {
   var chkstr = toCheck + "";
   if ( ( chkstr == "") || ( chkstr == null ) ) { return true ; }
   strlen = chkstr.length;
   for(i = 0 ; i < strlen ; i++) {
      if (chkstr.substring(i, i+1) == ' ') { return true; }
   }
   return false;
}
