function ZipWindow(ref) 
{
    var window_left = (screen.width-640)/2;
    var window_top = (screen.height-480)/2;
    window.open(ref,"zipWin",'width=550,height=140,status=no,top=' + window_top + ',left=' + window_left );
}

function idchk(x,y)
  {
	var window_left = x - 350;
	var window_top = y - 150;
	var winur1 = "../login/idok.php?idd=" +  document.forms[0].idd.value;
       window.open(winur1,"","width=300,height=100,top=" + window_top + ",left=" + window_left);
  }

function Age(str)
{
	var form = document.forms[0];
	var newly =0;
	var doo =0;
	var birthmon =0;
	var birthday =0;
	var age=0;
	var age2=0;

	 mydate = new Date();
	 myYear = mydate.getYear();
	 mymonth = mydate.getMonth();
	 myday = mydate.getDate();

   Year = parseInt(myYear,10);//³â
   month = parseInt(mymonth,10);//¿ù
	 month = month +1;//¿ù
	 day = parseInt(myday,10);//ÀÏ
	 

   newly = parseInt(str.substring(6,7),10);//2000,1900³â´ë ±¸ºÐ
	 birthyear = parseInt(str.substring(0,2),10);//ÁÖ¹Î¹øÈ£¾ÕµÎÀÚ¸®»ý³â
	 birthmon= parseInt(str.substring(2,4),10);//»ý¿ù
 	 birthday= parseInt(str.substring(4,6),10);//»ýÀÏ
	
	if((newly == 3) || (newly == 4)){
		age = birthyear + 2000;
		age2 = Year - age;
		if((age2 == 14) && (birthmon == month) && (birthday > day)){return false;}
		else if((age2 == 14) && (birthmon > month)){return false;}
		else if(age2 < 14){return false;}
		else{return true;}
	 }else{
		age = birthyear + 1900;
		age2 = Year - age;
		if((age2 == 14) && (birthmon == month) && (birthday > day)){return false;}
		else if((age2 == 14) && (birthmon > month)){;return false;}
		else if(age2 < 14){return false;}
		else{return true;}
	 }
	 return true;
}


function checkresno(form)
{
     str = form.ju1.value + form.ju2.value;
     num = 0;
     num7 = 0;
     num13 = 0;
     totalnum = 0;
     chknum = 0;
     num7 = parseInt(str.substring(6,7),10) ;
     num  = parseInt(str.substring(0,1),10)   * 2 +
            parseInt(str.substring(1,2),10)   * 3 +
            parseInt(str.substring(2,3),10)   * 4 +
            parseInt(str.substring(3,4),10)   * 5 +
            parseInt(str.substring(4,5),10)   * 6 +
            parseInt(str.substring(5,6),10)   * 7 +
            parseInt(str.substring(6,7),10)   * 8 +
            parseInt(str.substring(7,8),10)   * 9 +
            parseInt(str.substring(8,9),10)   * 2 +
            parseInt(str.substring(9,10),10)  * 3 +
            parseInt(str.substring(10,11),10) * 4 +
            parseInt(str.substring(11,12),10) * 5;
    num13 = parseInt(str.substring(12,13),10);
    totalnum = num%11;
    chknum   = 11 - totalnum;
    if(chknum >= 10 ) chknum = chknum - 10;
                if((num13 == chknum) && ( num7 == 1 || num7 == 2 ))
                        return true;
                else
                        return false;
 }

 function inCheck(form)
{
if (!(form.agree.checked))
{alert("¾à°ü¿¡ Ã¼Å© ÇÏ¼¼¿ä");form.agree.focus();return (false);}
if (!(form.name.value))
{alert("ÀÌ¸§ ÀÔ·ÂÇÏ¼¼¿ä");form.name.focus();return (false);}
if (!(form.idd.value))
{alert("ID¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.idd.focus();return (false);}
if (!(form.pwd1.value))
{alert("ºñ¹Ð¹øÈ£ ÀÔ·ÂÇÏ¼¼¿ä");form.pwd1.focus();return (false);}
if (!(form.pwd2.value))
{alert("È®ÀÎ ÀÔ·ÂÇÏ¼¼¿ä");form.pwd2.focus();return (false);}
if (!(form.pwd1.value==form.pwd2.value ))
{alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö¾Ê½À´Ï´Ù.");form.pwd1.focus();return (false);}
if (form.pwhintqst.value=='')
{alert("ºñ¹Ð¹øÈ£ ÈùÆ® Áú¹®À» ¼±ÅÃÇÏ¼¼¿ä.");form.pwhintqst.focus();return (false);}
if (!(form.pwhintans.value))
{alert("ºñ¹Ð¹øÈ£ ÈùÆ® Áú¹® ´äÀ» ÀÔ·ÂÇÏ¼¼¿ä.");form.pwhintans.focus();return (false);}
if (!checkresno(form))
{alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù..\n´Ù½Ã È®ÀÎÇØ ÁÖ¼¼¿ä.");form.ju1.focus(); return(false);}
if(!Age(form.ju1.value+form.ju2.value))
{alert(" ¸¸14¼¼ ÀÌÇÏ´Â È¸¿ø °¡ÀÔÀ» ÇÒ¼ö ¾ø½À´Ï´Ù.");form.ju1.focus();return(false);}
if (!(form.tel1.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel1.focus();return (false);}
if (!(form.tel2.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel2.focus();return (false);}
if (!(form.tel3.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel3.focus();return (false);}
if ((form.email.value=='') || (form.email.value.search(/(\S+)@(\S+)\.(\S+)/) == -1))
{alert('E-mailÀ» ¹Ù¸£°Ô ÀÔ·ÂÇÏ¼¼¿ä.'); form.email.focus(); return (false);}

return (true);
}



 function editCheck(form)
{
if (!(form.pwd2.value))
{alert("ºñ¹Ð¹øÈ£ È®ÀÎÀ» ÀÔ·ÂÇÏ¼¼¿ä");form.pwd2.focus();return (false);}
if (!(form.pwd1.value==form.pwd2.value ))
{alert("ÆÐ½º¿öµå°¡ ÀÏÄ¡ÇÏÁö¾Ê½À´Ï´Ù.");form.pwd1.focus();return (false);}
if (form.pwhintqst.value=='')
{alert(" ºñ¹Ð¹øÈ£ ÈùÆ® Áú¹®À» ¼±ÅÃÇÏ¼¼¿ä.");form.pwhintqst.focus();return (false);}
if (!(form.pwhintans.value))
{alert("ºñ¹Ð¹øÈ£ ÈùÆ® Áú¹® ´äÀ» ÀÔ·ÂÇÏ¼¼¿ä.");form.pwhintans.focus();return (false);}
if (!(form.tel1.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel1.focus();return (false);}
if (!(form.tel2.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel2.focus();return (false);}
if (!(form.tel3.value))
{alert("¿¬¶ôÃ³¸¦ ÀÔ·ÂÇÏ¼¼¿ä");form.tel3.focus();return (false);}
if ((form.email.value=='') || (form.email.value.search(/(\S+)@(\S+)\.(\S+)/) == -1))
{alert('E-mailÀ» ¹Ù¸£°Ô ÀÔ·ÂÇÏ¼¼¿ä.'); form.email.focus(); return (false);}

return (true);
}

function reset()
{
        document.forms[0].reset();
}

function Del(){
	 if(confirm('Á¤¸» Å»Åð ÇÏ½Ã°Ú½À´Ï±î!')){location.href='../login/member_del.php';}
}