	
function CheckSSN1Focus()
{
if(document.formJoin.mem_ssn1.value.length == 6)
   document.formJoin.mem_ssn2.focus();
}

function CheckSSN2Focus()
{
   if(document.formJoin.mem_ssn2.value.length == 7)
   {
      var data = document.formJoin.mem_ssn2.value.substring(0,1);

      if(data == "1" || data == "3")
         document.formJoin.mem_gender[0].checked = true;
      else if(data == "2" || data == "4")
         document.formJoin.mem_gender[1].checked = true;

      document.formJoin.mem_zip1.focus();

      var bYear = document.formJoin.mem_ssn1.value.substring(0,2);

      if(data == "1" || data == "2")
	     		document.formJoin.mem_birthyear.value = "19" + bYear;
	  			else if(data == "3" || data == "4")
	     		document.formJoin.mem_birthyear.value = "20" + bYear;

				  document.formJoin.mem_birthmonth.value = document.formJoin.mem_ssn1.value.substring(2,4);
				  document.formJoin.mem_birthday.value = document.formJoin.mem_ssn1.value.substring(4,6);

      document.formJoin.mem_calendar[0].focus();
   }
}
function SearchZip()
{
   w = 350, h = 300;
   x = (screen.availWidth - w) / 2;
   y = (screen.availHeight - h) / 2;
   window.open("popup_post.asp", 'zip_page','width='+w+', height='+h+', left='+x+', top='+y);
}
function Change_Email()
{
		if(document.formJoin.sel_email.selectedIndex != 0)
		{
			document.formJoin.mem_email2.value = document.formJoin.sel_email.value;
		}
		else
		{
			document.formJoin.mem_email2.value = "";
		}

		if(document.formJoin.sel_email.value == "Á÷Á¢ÀÔ·Â")
		{
			document.formJoin.mem_email2.readOnly = false;
			document.formJoin.mem_email2.value = "";
		}
		else
		{
			document.formJoin.mem_email2.readOnly = true;
		}
}
function JoinAction()
{
   if(CheckInputName(document.formJoin.member_name.value) == false)
      return;

   if(CheckComparePassword(document.formJoin.mem_webpwd.value, document.formJoin.mem_webpwd_re.value) == false)
      return;

   if(CheckSSN(document.formJoin.mem_ssn1.value, document.formJoin.mem_ssn2.value) == false)
      return;

   if(CheckBirthday(document.formJoin.mem_birthyear.value, document.formJoin.mem_birthmonth.value, document.formJoin.mem_birthday.value) == false)
      return;

   if(CheckAddress(document.formJoin.mem_zip1.value, document.formJoin.mem_dong.value, document.formJoin.mem_address.value) == false)
      return;

   if(CheckTelNumber(document.formJoin.mem_tel1, document.formJoin.mem_tel2, document.formJoin.mem_tel3) == false)
      return;

   if(CheckEmail(document.formJoin.mem_email1.value, document.formJoin.mem_email2.value) == false)
      return;

   document.formJoin.submit();
}
function CheckInputName(check_value)
{
   if(check_value == "")
   {
      alert("ÀÌ¸§À» ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä.");
	  			document.formJoin.member_name.focus();
	  			
      return false;
   }

   for(i = 0; i < check_value.length; i++)
   {
      if(check_value.substring(i, i+1) == "~" || check_value.substring(i, i+1) == "`" || check_value.substring(i, i+1) == "!" ||
							  check_value.substring(i, i+1) == "@" || check_value.substring(i, i+1) == "#" || check_value.substring(i, i+1) == "$" ||
								 check_value.substring(i, i+1) == "%" || check_value.substring(i, i+1) == "^" || check_value.substring(i, i+1) == "&" ||
								 check_value.substring(i, i+1) == "*" || check_value.substring(i, i+1) == "(" || check_value.substring(i, i+1) == ")" ||
								 check_value.substring(i, i+1) == "-" || check_value.substring(i, i+1) == "_" || check_value.substring(i, i+1) == "=" ||
								 check_value.substring(i, i+1) == "+" || check_value.substring(i, i+1) == "|" || check_value.substring(i, i+1) == "\\" ||
								 check_value.substring(i, i+1) == "[" || check_value.substring(i, i+1) == "]" || check_value.substring(i, i+1) == "{" ||
								 check_value.substring(i, i+1) == "}" || check_value.substring(i, i+1) == ":" || check_value.substring(i, i+1) == ";" ||
								 check_value.substring(i, i+1) == "<" || check_value.substring(i, i+1) == ">" || check_value.substring(i, i+1) == "?" ||
								 check_value.substring(i, i+1) == "," || check_value.substring(i, i+1) == "." || check_value.substring(i, i+1) == "/" ||
								 check_value.substring(i, i+1) == " " || check_value.substring(i, i+1) == "¡¡")
				  {
					    alert("ÀÌ¸§¿¡´Â Æ¯¼ö ¹®ÀÚ ¶Ç´Â ºó Ä­À» »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
									document.formJoin.member_name.value = "";
									document.formJoin.member_name.focus();
									
									return false;
				  }
   }
   
   for(i = 0; i < check_value.length; i++)
   {
      ch = check_value.charAt(i);   

				  if(ch >= "0" && ch <= "9")
				  {
				     alert("ÀÌ¸§¿¡´Â ¼ýÀÚ¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.");
				     document.formJoin.member_name.value = "";
							  document.formJoin.member_name.focus();
				     
					 			return false;
				  }
   }

   if(check_value.length < 2)
   {
      alert("ÀÌ¸§Àº 2ÀÚ ÀÌ»óÀ¸·Î ÀÛ¼ºµÇ¾î¾ß ÇÕ´Ï´Ù.");
				  document.formJoin.member_name.value = "";
				  document.formJoin.member_name.focus();
	  
	  			return false;
   }
   return true;
}
function CheckComparePassword(check_value1, check_value2)
{
   if(check_value1 == "" || check_value2 == "")
   {
      alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ½Ê½Ã¿ä.");
			   document.formJoin.mem_webpwd.value = "";
			   document.formJoin.mem_webpwd_re.value = "";
	  			document.formJoin.mem_webpwd.focus();
	  			
      return false;
   }

   if(check_value1 != check_value2)
   {
   			alert("ºñ¹Ð¹øÈ£°¡ ¸ÂÁö ¾Ê½À´Ï´Ù. È®ÀÎ¹Ù¶ø´Ï´Ù.");
			   document.formJoin.mem_webpwd.value = "";
			   document.formJoin.mem_webpwd_re.value = "";
	     document.formJoin.mem_webpwd.focus();

	  			return false;
   }

   if(check_value1.length < 4 || check_value1.length > 12 || check_value2.length < 4 || check_value2.length > 12)
   {
      alert("ºñ¹Ð¹øÈ£´Â 4 ~ 12ÀÚ »çÀÌ·Î ÀÔ·ÂÇÏ¼¼¿ä.");
			   document.formJoin.mem_webpwd.value = "";
			   document.formJoin.mem_webpwd_re.value = "";
	     document.formJoin.mem_webpwd.focus();

	  			return false;
   }
   else
   {
      for(i = 0; i < check_value1.length; i++) 
				  {
				     if(check_value1.substring(i,i+1) == " " || check_value1.substring(i,i+1) == "¡¡")
								 {
								    alert("ºñ¹Ð¹øÈ£´Â °ø¹é¾øÀÌ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
									   document.formJoin.mem_webpwd.value = "";
									   document.formJoin.mem_webpwd_re.value = "";
									   document.formJoin.mem_webpwd.focus();
									   
									   return false;
									}
					 }
	  }

   return true;
}
function CheckSSN(ssn_value1, ssn_value2)
{
   if(ssn_value1 == "" || ssn_value2 == "")
   {
      alert("ÁÖ¹Îµî·Ï¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
					 document.formJoin.mem_ssn1.value = "";
					 document.formJoin.mem_ssn2.value = "";
					 document.formJoin.mem_ssn1.focus();
					 
	  			return false;
   }

   for(i = 0; i < ssn_value1.length; i++)
   {
      if((ssn_value1.substring(i, i+1) < "0") || (ssn_value2.substring(i, i+1) > "9"))
				  {
				     alert("ÁÖ¹Îµî·Ï¹øÈ£¿¡ ¼ýÀÚ(0 ~ 9) ¿ÜÀÇ ´Ù¸¥ ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù. ¼öÁ¤ÇÏ¼¼¿ä.");
								 document.formJoin.mem_ssn1.value = "";
								 document.formJoin.mem_ssn2.value = "";
								 document.formJoin.mem_ssn1.focus();
								 
								 return false;
				  }
   }

   if(ssn_value1.substring(2, 4) > "12" || ssn_value1.substring(4, 6) > "31")
   {
				  alert("ÁÖ¹Î¹øÈ£ ¾ÕºÎºÐÀÌ ¿Ã¹Ù¸¥ ³¯Â¥°ªÀ» °¡Áö°í ÀÖÁö ¾Ê½À´Ï´Ù.");
				  document.formJoin.mem_ssn1.focus();
				  
				  return false;
   }

   if((parseInt(ssn_value2.charAt(0)) < 1) || (parseInt(ssn_value2.charAt(0)) > 4))
   {
      alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
				  document.formJoin.mem_ssn1.value = "";
				  document.formJoin.mem_ssn2.value = "";
      document.formJoin.mem_ssn1.focus();
      
	  			return false;
   }

   list = new Array(13);
   var last_list, listCheck;

   list[0] = parseInt(ssn_value1.substring(0,1)) * 2;
   list[1] = parseInt(ssn_value1.substring(1,2)) * 3;
   list[2] = parseInt(ssn_value1.substring(2,3)) * 4;
   list[3] = parseInt(ssn_value1.substring(3,4)) * 5;
   list[4] = parseInt(ssn_value1.substring(4,5)) * 6;
   list[5] = parseInt(ssn_value1.substring(5,6)) * 7;
   list[6] = parseInt(ssn_value2.substring(0,1)) * 8;
   list[7] = parseInt(ssn_value2.substring(1,2)) * 9;
   list[8] = parseInt(ssn_value2.substring(2,3)) * 2;
   list[9] = parseInt(ssn_value2.substring(3,4)) * 3;
   list[10] = parseInt(ssn_value2.substring(4,5)) * 4;
   list[11] = parseInt(ssn_value2.substring(5,6)) * 5;
   list[12] = 0;
   last_list = parseInt(ssn_value2.substring(6,7));

   for(i = 0; i < 12; i++)
   {
      list[12] += list[i];
   }

   listCheck = (11 - (list[12] % 11)) % 10;

   if(listCheck != last_list)
   {
      alert("ÁÖ¹Îµî·Ï¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
				  document.formJoin.mem_ssn1.value = "";
				  document.formJoin.mem_ssn2.value = "";
				  document.formJoin.mem_ssn1.focus();
			
				  return false;
   }
   return true;
}
function CheckBirthday(year, month, day)
{
   if(year == "")
   {
      alert("Ãâ»ý ³âµµ¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
				  document.formJoin.mem_birthyear.focus();
				  
				  return false;
   }

   if(month == "")
   {
      alert("Ãâ»ý ¿ùÀ» ¼±ÅÃÇÏ¼¼¿ä.");
				  document.formJoin.mem_birthmonth.focus();
				  
				  return false;
   }

   if(day == "")
   {
      alert("Ãâ»ý ÀÏÀÚ¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
				  document.formJoin.mem_birthday.focus();
				  
				  return false;
   }

   for(i = 0; i < year.length; i++)
   {
      if((year.substring(i, i+1) < "0") || (year.substring(i, i+1) > "9"))
				  {
				     alert("Ãâ»ý ³âµµ¿¡´Â ¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
								 document.formJoin.mem_birthyear.value = "";
								 document.formJoin.mem_birthyear.focus();
								 
								 return false;
				  }
   }

   return true;
}
function CheckAddress(zip1, addr1, addr2)
{
   if(zip1 == "")
   {
      alert("¿ìÆí ¹øÈ£¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
      
	  			return false;
   }
    
   if(addr1 == "")
   {
      alert("ÁÖ¼Ò´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
				  document.formJoin.mem_dong.focus();
				  
				  return false;
   }
   else if(addr2 == "")
   {
      alert("ÁÖ¼Ò´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
				  document.formJoin.mem_address.focus();	  
				  
				  return false;
   }

   return true;
}
function CheckTelNumber(tel1, tel2, tel3)
{
   if(tel1.value == "")
   {
      alert("ÀüÈ­ ¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
				  document.formJoin.mem_tel1.focus();
				  
				  return false;
   }
   else if(tel2.value == "")
   {
      alert("ÀüÈ­ ¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
				  document.formJoin.mem_tel2.focus();
				  
				  return false;
   }
   else if(tel3.value == "")
   {
      alert("ÀüÈ­ ¹øÈ£´Â ÇÊ¼ö ÀÔ·Â»çÇ×ÀÔ´Ï´Ù.");
				  document.formJoin.mem_tel3.focus();
				  
				  return false;
   }

   for(i = 0; i < tel1.value.length; i++)
   {
      if((tel1.value.substring(i, i+1) < "0") || (tel1.value.substring(i, i+1) > "9"))
	  {
	     alert("ÀüÈ­ ¹øÈ£¿¡´Â ¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
					 document.formJoin.mem_tel1.value = "";
					 document.formJoin.mem_tel1.focus();
					 
					 return false;
	  }
   }

   for(i = 0; i < tel2.value.length; i++)
   {
      if((tel2.value.substring(i, i+1) < "0") || (tel2.value.substring(i, i+1) > "9"))
	  {
	     alert("ÀüÈ­ ¹øÈ£¿¡´Â ¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
					 document.formJoin.mem_tel2.value = "";
					 document.formJoin.mem_tel2.focus();
					 
					 return false;
	  }
   }

   for(i = 0; i < tel3.value.length; i++)
   {
      if((tel3.value.substring(i, i+1) < "0") || (tel3.value.substring(i, i+1) > "9"))
				  {
				     alert("ÀüÈ­ ¹øÈ£¿¡´Â ¹®ÀÚ¸¦ ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
								 document.formJoin.mem_tel3.value = "";
								 document.formJoin.mem_tel3.focus();
								 
								 return false;
				  }
   }
}
function CheckEmail(e1, e2)
{

	if(e1 == "")
	{
					alert("ÀÌ¸ÞÀÏÀÌ ÀÔ·ÂµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
					document.formJoin.mem_email1.focus();
					
					return false;
	}
	else if(e2 == "")
	{
					alert("ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¼±ÅÃµÇÁö ¾Ê¾Ò½À´Ï´Ù.");
					document.formJoin.mem_email2.focus();
					
					return false;
	} 
    
   return true;
}
function Login()
{
		if(document.formJoin.member_id.value == "")
		{
				alert("È¸¿ø¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.")
				document.formJoin.member_id.focus();
				
				return false;		
		}
		
		if(document.formJoin.mem_webpwd.value == "")
		{
				alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.")
				document.formJoin.mem_webpwd.focus();
				
				return false;
		}
		
		document.formJoin.submit();
}

function Search_idpw()
{
   w = 350, h = 300;
   x = (screen.availWidth - w) / 2;
   y = (screen.availHeight - h) / 2;
   window.open("popup_idsearch.asp", 'popup_idsearch','width='+w+', height='+h+', left='+x+', top='+y);
}

function OldMember() 
{
			window.open ("../../popup1.asp","OldMember","toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=517,height=600");
}

function NewMember()
{
   window.open('../../popup2.asp','NewMember','toolbar=no,location=no,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=no,width=517,height=600');
}
function AmendAction()
{
   if(CheckComparePassword(document.formJoin.mem_webpwd.value, document.formJoin.mem_webpwd_re.value) == false)
      return;

   document.formJoin.submit();
}

function FamilySearch()
{
	var data1 = document.formFamilySearch.Sch_ssn1.value;
	var data2 = document.formFamilySearch.Sch_ssn2.value;
		
	f = document.getElementById("iframeAmend");
	f.contentWindow.location = "amend_sel.asp?type=1&data1=" + data1 + "&data2=" + data2;
//    window.open("amend_sel.asp?type=1&data1=" + data1 + "&data2=" + data2, 'subscription', "LEFT=20000,TOP=20000,height=10,width=10,status=no,toolbar=no,menubar=no,location=no");
}
function CheckSSN11Focus()
{
    if(document.formFamilySearch.Sch_ssn1.value.length == 6)
       document.formFamilySearch.Sch_ssn2.focus();
}
function FamilyAdd()
{		
	var data = document.formFamilySearch.Sch_member_id.value;
	
	if(data == "")
	{
		 return false;
	}
	else
	{	
				f = document.getElementById("iframeDel");
				f.contentWindow.location = "amend_add_del.asp?type=2&data=" + data;
			 //   window.open("amend_add_del.asp?type=2&data=" + data, 'ADD', "LEFT=20000,TOP=20000,height=10,width=10,status=no,toolbar=no,menubar=no,location=no");
					document.formFamilySearchDelete.submit();
		}
}
function FamilyDel(data)
{
	if(confirm("¼±ÅÃÇÑ È¸¿øÀ» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?") == false)
	{
		return false;
	}
	else
	{
		f = document.getElementById("iframeDel");
		f.contentWindow.location = "amend_add_del.asp?type=1&data=" + data;
		document.formFamilySearchDelete.submit();
	}
}
function Change_clsGroup()
{
			var data = document.formSel.sel_group.value;

			f = document.getElementById("iframeProgram");
			f.contentWindow.location = "program_sel.asp?data=" + data;
//			 window.open("program_sel.asp?data=" + data, 'Program', "LEFT=20,TOP=20,height=10,width=10,status=no,toolbar=no,menubar=no,location=no");
			document.formList.submit();
}

function LessonGo(data)
{
			f = document.getElementById("iframeProgram");
			f.contentWindow.location = "program_proc.asp?data=" + data;
//			 window.open("program_proc.asp?data=" + data, 'Program', "LEFT=20,TOP=20,height=1000,width=1000,scrollbar=yes, status=no,toolbar=no,menubar=no,location=no");
}
function ListSearch()
{
	document.formlist.search_on.value = "1";
    document.formlist.submit();
}

