//<!-- Start À©µµ¿ì Ã¢ ¿­±â -->//
function CoolIntro(url,pop,Nwidth,Nheight,step)
{
	if (!document.layers&&!document.all&&!document.getElementById)
	{
		paramstp="height=100,width=100,top=0,left=0,scrollbars=no,location=no"+
		",directories=no,status=no,menubar=no,toolbar=no,resizable=no"
		var gwa=window.open(url,"",paramstp);
		if (gwa.focus){gwa.focus();}
		return;
	}
	var movespeed=50;
	var resizespeed=70;	
    if(step == '1'){
	var winreswidth=Nwidth;					   // ÀüÃ¼È­¸é Width  : window.screen.availWidth;
	var winresheight=window.screen.availHeight;	// ÀüÃ¼È­¸é Height : window.screen.availHeight;
	}else{
	var winreswidth=Nwidth;					   // ÀüÃ¼È­¸é Width  : window.screen.availWidth;
	var winresheight=Nheight;	// ÀüÃ¼È­¸é Height : window.screen.availHeight;
	}
	var leftspeed=winreswidth/movespeed;
	var topspeed=winresheight/movespeed;
	var movewidth=winreswidth;
	var moveheight=winresheight;
	var widthspeed=winreswidth/resizespeed;
	var heightspeed=winresheight/resizespeed;
	var sizewidth=0;
	var sizeheight=0;

	if(step == '1'){
	var gwa=open(url,pop,"left="+winreswidth+",top="+winresheight+",width=100,height=100,toolbar=no,menubar=no,location=no,status=no,scrollbars=yes,resizable=no");
	}else{
	var gwa=open(url,pop,"left="+winreswidth+",top="+winresheight+",width=100,height=100,toolbar=no,menubar=no,location=no,status=no,scrollbars=no,resizable=no");
	}

	for (move=0;move<movespeed;move++)
	{
		gwa.moveTo(movewidth,moveheight);
		movewidth-=leftspeed;
		moveheight-=topspeed;
	}
	gwa.moveTo(0,0);
	for (size=0;size<resizespeed;size++)
	{
		gwa.resizeTo(sizewidth,sizeheight);
		sizewidth+=widthspeed;
		sizeheight+=heightspeed;
	}
	gwa.resizeTo(winreswidth,winresheight);
	if (gwa.focus){gwa.focus();}
}
//<!-- End À©µµ¿ì Ã¢ ¿­±â -->//


//<!-- Start À©µµ¿ì ¿ÀÇÂ -->//
function OpenWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}


/*
function SelectShow(){
	if	(document.FormCheck.Html[0].selected == true) {		
		document.FormCheck.DePopWidth.disabled=false;
		document.FormCheck.DePopHeight.disabled=false;
		}
	if	(document.FormCheck.Html[1].selected == true) {		
		document.FormCheck.DePopWidth.disabled=true;
		document.FormCheck.DePopHeight.disabled=true;
		}
	if	(document.FormCheck.Html[2].selected == true) {		
		document.FormCheck.DePopWidth.disabled=true;
		document.FormCheck.DePopHeight.disabled=true;
		}
}
*/

//<!-- ¼±ÅÃ -->//
function SelectShow(){
	if(document.FormCheck.Html[0].checked == true) {
		SelectShow1.style.display="";
		SelectShow2.style.display="none";
		document.FormCheck.Content.disabled=false;
		}

	if(document.FormCheck.Html[1].checked == true) {
		SelectShow1.style.display="";
		SelectShow2.style.display="none";
		document.FormCheck.Content.disabled=false;
	}
	
	if(document.FormCheck.Html[2].checked == true) {
		SelectShow1.style.display="none";
		SelectShow2.style.display="";
		document.FormCheck.Content.disabled=true;
	}
}

function SelectLoad0() {  
	SelectShow1.style.display="";
	SelectShow2.style.display="none";
}

function SelectLoad1() {  
	SelectShow1.style.display="";
	SelectShow2.style.display="none";
}

function SelectLoad2() {  
	SelectShow1.style.display="none";
	SelectShow2.style.display="";
}

/*
function DeSelectShow(){
document.FormCheck.Html[0].checked = true;
}
*/

//<!-- ±Û ¾²±â -->//
function CheckWrite(WriteForm){
	if(WriteForm.DeEmail.value == "Y"){
	var str=WriteForm.Email.value;
	var defstr="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_@.";
	
	}

	if(WriteForm.CheckSel.value == "Y"){
		if(!WriteForm.Selected.value){
			alert("¼±ÅÃ»çÇ×À» ³Ö¾îÁÖ¼¼¿ä");
			WriteForm.Selected.focus();
			return false;
		}
	}
	
	if(!WriteForm.Name.value){
		alert("ÀÛ¼ºÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä");
		WriteForm.Name.focus();
		return false;
	}

	if(WriteForm.DeEmail.value == "Y"){
		if(!WriteForm.Email.value){
			alert("ÀÌ¸ÞÀÏÀ» ³Ö¾îÁÖ¼¼¿ä");
			WriteForm.Email.focus();
			return false;
		}	
		for(i=0;i<str.length;i++){
			if(defstr.indexOf(str.substring(i,i+1))<0){
				alert("E-mail¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
				WriteForm.Email.value="";
				WriteForm.Email.focus();
				return false;
			}
		}	
		if(str.length <10){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			WriteForm.Email.value="";
			WriteForm.Email.focus();
			return false;
		}	
		var npos=str.indexOf('@');
		if(npos < 0){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			WriteForm.Email.value="";
			WriteForm.Email.focus();
			return false;
		}	
		substr=str.split("@")		
		if(substr[0].length < 3){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			WriteForm.Email.valeu="";
			WriteForm.Email.focus();
			return false;
		}	
		if(substr[1].length < 6){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			WriteForm.Email.focus();
			return false;
		}
		if(substr[1].indexOf(".") < 0){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			WriteForm.Email.value = "";
			WriteForm.Email.focus();
			return false;
		}
	}	

	if(!WriteForm.Subject.value){
		alert("Á¦¸ñÀ» ³Ö¾îÁÖ¼¼¿ä");
		WriteForm.Subject.focus();
		return false;
	}
	
	if(WriteForm.DeHtml.value == "Y"){
		if(WriteForm.Html[0].checked == true || WriteForm.Html[1].checked == true){
			if(!WriteForm.Content.value){
				alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
				WriteForm.Content.focus();
				return false;
			}
		}


		if(WriteForm.Html[2].checked == true){		
			WriteForm.msgbody.value = myeditor.outputHTML();		
			}

		if(WriteForm.PassCheck.value=="N"){
			if(!WriteForm.Pass.value){
				alert("ºñ¹Ð¹øÈ£¸¦ ³Ö¾îÁÖ¼¼¿ä");
				WriteForm.Pass.focus();
				return false;
			}
		}
	}else{
		
		if(!WriteForm.Content.value){
				alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
				WriteForm.Content.focus();
				return false;
			}
	}

	if(WriteForm.DeSpam.value=="Y"){
		if(!WriteForm.AuthSpam.value){
			alert("±×¸²¿¡ ³ª¿À´Â ±ÛÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä");
			WriteForm.AuthSpam.focus();
			return false;
		}
	}

	return true;
}

//<!--  Ã½Å©¹Ú½º -->//
function  CheckCheckbox() {
   var check_nums = document.FormChekbox.elements.length;
   for(var i = 0; i < check_nums; i++) {
      var checkbox_obj = eval("document.FormChekbox.elements[" + i + "]");
      if(checkbox_obj.checked == true) {
         break;
      }
   }
   if(i == check_nums) {
      alert("¸ÕÀú »èÁ¦ÇÒ ³»¿ëÀ» ¼±ÅÃÇÏ¼¼¿ä");
      return;   
   } else {
      document.FormChekbox.submit();
   }   
}

//<!-- °Ë»ö -->//
function SearchKeyword(thisForm)  
{
  if (thisForm.Search.value.length == 0) {
      alert("°Ë»öÇÒ ´Ü¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä") ;
      thisForm.Search.focus();
      return false ;
  }
  return true ;    
}

//<!--  ÆäÀÌÁö°¡±â -->//
function PageGo(Coform)
{
  Coform.submit();
}

//<!-- ¸®½ºÆ® Á¤·Ä -->//
function PageOrder(Orderform)
{
  Orderform.submit();
}

//<!-- ¸®½ºÆ® Á¤·Ä -->//
function Selected(Selform)
{
  Selform.submit();
}

//<!-- ¸µÅ© -->//
function AdminHref(){ top.location.href="../Admin/index.php?Mode=Admin"; }


//<!--  ÂÊÁö Ã¢ ¿­±â -->//
			function MM_findObj(n, d, f) { //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); 
				if(f) x = d.form1[n];
				return x;
			}
			//¿øÇÏ´Â ±æÀÌ¸¸Å­ '0'À» ºÙ¿©ÁÖ´Â ÇÔ¼ö
			//fn_numformat(1,2);			
			//µÎ°³ÀÇ ¿ÀºíÁ§Ã÷¿¡ ¿øÇÏ´Â °ª¸¸Å­ÀÇ Â÷ÀÌ°¡ ³ªµµ·Ï ³¯Â¥¸¦ ÀÔ·ÂÇÏ´Â ÇÔ¼ö
			function fn_betdate(objname1, objname2, difvalue){
				obj1 = MM_findObj(objname1,document,form1);
				obj2 = MM_findObj(objname2,document,form1);
				var datD = new Date(2004,07-1,16);
				var arrValue = new Array();
				obj2.value = fn_getdate(datD); //ÇöÀç ³¯Â¥¸¦ ¼ÂÆÃ
				arrValue = difvalue.split(":");
				if(arrValue[0] == "D"){
					datD.setDate(datD.getDate() - eval(arrValue[1]));
				}
				if(arrValue[0] == "M"){
					datD.setMonth(datD.getMonth() - eval(arrValue[1]));
				}
				obj1.value = fn_getdate(datD); //Â÷ÀÌ³ª´Â ³¯ÀÚ¸¦ Àû¿ë½ÃÅ² ³¯Â¥ ¼ÂÆÃ
			}
/*
function ViewDiv(Load,str,Uname,Uemail,Step){
				obj = MM_findObj(str,document,form1);
				calendar.style.display = "";
				document.all.calendar.style.posLeft = event.x - 90 + document.body.scrollLeft;
				document.all.calendar.style.posTop  = event.y + 10 + document.body.scrollTop;
				var arrTemp = new Array();
				//arrTemp = obj.value.split("-");
				//if((arrTemp[0].length == 4) && (arrTemp[1].length == 2)){
				//	arrival_frame.location.href="./test3.php"
				//	eval(arrTemp[1]);
				//}
				//else{
					arrival_frame.location.href=Load+"/Send.php?Load="+Load+"/&Id="+str+"&Uname="+Uname+"&Uemail="+Uemail+"&Step="+Step;
				//}
			}
*/
function ViewDiv(PHP_SELF,Mid,str,Uname,Uemail,Step){
				obj = MM_findObj(str,document,form1);
				calendar.style.display = "";
				document.all.calendar.style.posLeft = event.x - 90 + document.body.scrollLeft;
				document.all.calendar.style.posTop  = event.y + 10 + document.body.scrollTop;
				var arrTemp = new Array();
				//arrTemp = obj.value.split("-");
				//if((arrTemp[0].length == 4) && (arrTemp[1].length == 2)){
				//	arrival_frame.location.href="./test3.php"
				//	eval(arrTemp[1]);
				//}
				//else{
					arrival_frame.location.href=PHP_SELF+"?Mid="+Mid+"&Ac=Send&Id="+str+"&Uname="+Uname+"&Uemail="+Uemail+"&Step="+Step;
				//}
			}
			function on_focus(strFName){
				if(window.event.keyCode == 13){
					strFName.focus();
				}
			}

function MM_findObj2(n, d, f) { //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_findObj2(n,d.layers[i].document);
				if(!x  &&  document.getElementById) x = document.getElementById(n); 
				if(f) x = d.form2[n];
				return x;
			}
			//¿øÇÏ´Â ±æÀÌ¸¸Å­ '0'À» ºÙ¿©ÁÖ´Â ÇÔ¼ö
			//fn_numformat(1,2);			
			//µÎ°³ÀÇ ¿ÀºíÁ§Ã÷¿¡ ¿øÇÏ´Â °ª¸¸Å­ÀÇ Â÷ÀÌ°¡ ³ªµµ·Ï ³¯Â¥¸¦ ÀÔ·ÂÇÏ´Â ÇÔ¼ö
			function fn_betdate2(objname1, objname2, difvalue){
				obj1 = MM_findObj2(objname1,document,form2);
				obj2 = MM_findObj2(objname2,document,form2);
				var datD = new Date(2004,07-1,16);
				var arrValue = new Array();
				obj2.value = fn_getdate(datD); //ÇöÀç ³¯Â¥¸¦ ¼ÂÆÃ
				arrValue = difvalue.split(":");
				if(arrValue[0] == "D"){
					datD.setDate(datD.getDate() - eval(arrValue[1]));
				}
				if(arrValue[0] == "M"){
					datD.setMonth(datD.getMonth() - eval(arrValue[1]));
				}
				obj1.value = fn_getdate(datD); //Â÷ÀÌ³ª´Â ³¯ÀÚ¸¦ Àû¿ë½ÃÅ² ³¯Â¥ ¼ÂÆÃ
			}
/*
function ViewDiv2(Load,str,Uname,Uemail,Step){
				obj = MM_findObj2(str,document,form2);
				calendar2.style.display = "";
				document.all.calendar2.style.posLeft = event.x - 90 + document.body.scrollLeft;
				document.all.calendar2.style.posTop  = event.y + 10 + document.body.scrollTop;
				var arrTemp = new Array();
				//arrTemp = obj.value.split("-");
				//if((arrTemp[0].length == 4) && (arrTemp[1].length == 2)){
				//	arrival_frame.location.href="./test3.php"
				//	eval(arrTemp[1]);
				//}
				//else{
					arrival_frame2.location.href=Load+"/Send.php?Load="+Load+"/&Id="+str+"&Uname="+Uname+"&Uemail="+Uemail+"&Step="+Step;
				//}
			}
*/
function ViewDiv2(PHP_SELF,Mid,str,Uname,Uemail,Step){
				obj = MM_findObj2(str,document,form2);
				calendar2.style.display = "";
				document.all.calendar2.style.posLeft = event.x - 90 + document.body.scrollLeft;
				document.all.calendar2.style.posTop  = event.y + 10 + document.body.scrollTop;
				var arrTemp = new Array();
				//arrTemp = obj.value.split("-");
				//if((arrTemp[0].length == 4) && (arrTemp[1].length == 2)){
				//	arrival_frame.location.href="./test3.php"
				//	eval(arrTemp[1]);
				//}
				//else{
					arrival_frame2.location.href=PHP_SELF+"?Mid="+Mid+"&Ac=Send&Id="+str+"&Uname="+Uname+"&Uemail="+Uemail+"&Step="+Step;
				//}
			}
			function on_focus(strFName){
				if(window.event.keyCode == 13){
					strFName.focus();
				}
			}
			function on_focus(strFName){
				if(window.event.keyCode == 13){
					strFName.focus();
				}
			}


//<!-- ÂÊÁö Ã¢ Close -->//
function DropDiv(){
	parent.window.calendar.style.display = "none";
	return;
}

//<!-- ÂÊÁö Ã¢ Close -->//
function DropDiv2(){
	parent.window.calendar2.style.display = "none";
	return;
}


//<!-- µ¡±Û ¾²±â -->//
function CheckMemo(MemoForm){

	var chf, f; chf = 0; f = 0;

	if(MemoForm.DeIcon.value == "2"){		
			for (f = 0; f < MemoForm.Icon.length; f++) {
			if (MemoForm.Icon[f].checked) {chf++;}}
			if (chf == 0) {alert('Ç¥Á¤ ¼±ÅÃÇØÁÖ¼¼¿ä.'); return false;}		
	}

	if(!MemoForm.Name.value){
		alert("ÀÛ¼ºÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä");
		MemoForm.Name.focus();
		return false;
	}
	if(MemoForm.PassCheck.value=="N"){
	if(!MemoForm.MemoPass.value){
		alert("ºñ¹Ð¹øÈ£¸¦ ³Ö¾îÁÖ¼¼¿ä");
		MemoForm.MemoPass.focus();
		return false;
	}
	}
	if(!MemoForm.Comment.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		MemoForm.Comment.focus();
		return false;
	}
	return true;
}

//<!-- µ¡±× »èÁ¦ -->//
function CheckMemoDel(thisForm)  
{
  if (!thisForm.MemoPass.value) {
      alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä") ;
      thisForm.MemoPass.focus();
      return false ;
  }
  return true ;    

}

//<!--  Confirm -->//
function OpenConfirm(cUrl, Title, Message) {
	var msg = Title + Message ;    
	if(confirm(msg)) {
		location.href = cUrl ;
	}
}


//<!-- °Ô½ÃÆÇ »èÁ¦ -->//
function CheckDel(thisForm)  
{
  if (!thisForm.Pass.value) {
      alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä") ;
      thisForm.Pass.focus();
      return false ;
  }
  return true ;    

}


//<!-- ¹æ¸í·Ï ¾²±â -->//
function CheckMemoWrite(ThisForm){
	if(!ThisForm.Name.value){
		alert("ÀÛ¼ºÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Name.focus();
		return false;
	}
	if(ThisForm.PassCheck.value=="N"){
	if(!ThisForm.Pass.value){
		alert("ºñ¹Ð¹øÈ£¸¦ ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Pass.focus();
		return false;
	}
	}
	if(!ThisForm.Content.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Content.focus();
		return false;
	}
	return true;
}


//<!-- ¹æ¸í·Ï µ¡±Û ¾²±â -->//
function CheckMemoMemo(ThisForm){
	if(!ThisForm.Comment.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Comment.focus();
		return false;
	}
	return true;
}

//<!-- ¹æ¸í·Ï ¼öÁ¤ -->//
function CheckMemoEdit(ThisForm){
	if(!ThisForm.Name.value){
		alert("ÀÛ¼ºÀÚ¸¦ ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Name.focus();
		return false;
	}
	if(ThisForm.PassCheck.value=="N"){
	if(!ThisForm.Pass.value){
		alert("ºñ¹Ð¹øÈ£¸¦ ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Pass.focus();
		return false;
	}
	}
	if(!ThisForm.Content.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Content.focus();
		return false;
	}
	return true;
}


//<!-- ÂÊÁö º¸³»±â  -->//
function CheckNote(ThisForm){
	if(!ThisForm.Subject.value){
		alert("Á¦¸ñÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Subject.focus();
		return false;
	}
	if(!ThisForm.Content.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Content.focus();
		return false;
	}
	return true;
}

//<!-- ¸ÞÀÏ º¸³»±â  -->//
function CheckMail(ThisForm){
	if(!ThisForm.Subject.value){
		alert("Á¦¸ñÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Subject.focus();
		return false;
	}
	if(!ThisForm.Content.value){
		alert("³»¿ëÀ» ³Ö¾îÁÖ¼¼¿ä");
		ThisForm.Content.focus();
		return false;
	}
	return true;
}


//<!-- Login -->//
function CheckLogin(LoginForm){
  if(!LoginForm.Id.value){
	alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	LoginForm.Id.focus();
	return false;
  }
  if(!LoginForm.Pass.value){
	alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	LoginForm.Pass.focus();
	return false;
  }
  return true;
}


//<!-- Members Check -->//
function CheckMembers(ThisFrom){
 var userid_valid = "abcdefghijklmnopqrstuvwxyz0123456789_";
  var userid_valname ="abcdefghijklmnopqrstuvwxhzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
  var userid_startChar = "abcdefghijklmnopqrstuvwxyz";
  var temp;
 if(!ThisFrom.Id.value){
	alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Id.focus();
	return false;
  }
  ThisFrom.Id.value = ThisFrom.Id.value.toLowerCase();
	if (ThisFrom.Id.value=="") {
		alert ("ID¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		ThisFrom.Id.focus();
		return false;
	   }
	temp = ThisFrom.Id.value.substring(0,1);
	if(userid_startChar.indexOf(temp) == -1) {
		alert("¾ÆÀÌµðÀÇ Ã¹ÀÚ´Â ¿µ¹®À¸·Î ½ÃÀÛÇÏ¿©¾ß ÇÕ´Ï´Ù");
		ThisFrom.Id.select();
		return false;
		}
					
	for (var i=0; i<ThisFrom.Id.value.length; i++) {
		temp = ThisFrom.Id.value.substring(i,i+1);
		if(userid_valid.indexOf(temp) == -1) {
			alert("È¸¿ø¾ÆÀÌµð´Â ¿µ¹®, ¼ýÀÚ¿Í _ ·Î¸¸ »ç¿ëÇÒ¼ö ÀÖ½À´Ï´Ù");
			ThisFrom.Id.select();
			return false;
		}
	}
	
	if ((ThisFrom.Id.value.length<4) ||(ThisFrom.Id.value.length>=12)){
		alert ("ID°¡ 4~12ÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		ThisFrom.Id.value="";
		ThisFrom.Id.focus();
		return false;
		}

  if(!ThisFrom.Pass.value){
	alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Pass.focus();
	return false;
  }
  if(ThisFrom.Pass.value!=ThisFrom.PassCheck.value){
	alert('ºñ¹Ð¹øÈ£¸¦ È®ÀÎÇØÁÖ¼¼¿ä ');
	ThisFrom.Pass.value ="";
	ThisFrom.PassCheck.value ="";
	ThisFrom.Pass.focus();
	return false;
  }
  if(!ThisFrom.Name.value){
	alert('ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Name.focus();
	return false;
  }
  	for (var i=0; i<ThisFrom.Name.value.length; i++) {
	temp = ThisFrom.Name.value.substring(i,i+1);
		if(userid_valname.indexOf(temp) != -1) {
			alert("ÇÑ±Û¸¸ °¡´ÉÇÕ´Ï´Ù.");
			ThisFrom.Name.select();
			return false;
		}
	}
  if(!ThisFrom.Jumin1.value){
	alert('ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Jumin1.focus();
	return false;
  }
    if(!ThisFrom.Jumin2.value){
	alert('ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Jumin2.focus();
	return false;
  }  
   if(!ThisFrom.Zip.value){
	alert('¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Zip.focus();
	return false;
  }
if(!ThisFrom.Addr1.value){
	alert('ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Addr1.focus();
	return false;
  }
   if(!ThisFrom.Tel.value){
	alert('ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Tel.focus();
	return false;
  }
  if(ThisFrom.Email.value !=""){
	var str=ThisFrom.Email.value;
	var defstr="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_@.";
	  for(i=0;i<str.length;i++){
			if(defstr.indexOf(str.substring(i,i+1))<0){
				alert("E-mail¿¡ Çã¿ëÇÒ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÔ·ÂµÇ¾ú½À´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
				ThisFrom.Email.value="";
				ThisFrom.Email.focus();
				return false;
			}
		}	
		if(str.length <10){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			ThisFrom.Email.value="";
			ThisFrom.Email.focus();
			return false;
		}	
		var npos=str.indexOf('@');
		if(npos < 0){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			ThisFrom.Email.value="";
			ThisFrom.Email.focus();
			return false;
		}	
		substr=str.split("@")		
		if(substr[0].length < 3){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			ThisFrom.Email.valeu="";
			ThisFrom.Email.focus();
			return false;
		}	
		if(substr[1].length < 6){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			ThisFrom.Email.focus();
			return false;
		}
		if(substr[1].indexOf(".") < 0){
			alert("À¯È¿ÇÏÁö ¾ÊÀº E-mail ÁÖ¼ÒÀÔ´Ï´Ù. \n´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä");
			ThisFrom.Email.value = "";
			ThisFrom.Email.focus();
			return false;
		}
  }
  return true;
}

//<!-- ¾ÆÀÌµð Ã¼Å©1 -->//
function ID_Check(){
var CheckId = document.FormMembers.Id;
 var userid_valid = "abcdefghijklmnopqrstuvwxyz0123456789_";  
  var userid_startChar = "abcdefghijklmnopqrstuvwxyz";
  var temp;
  document.FormMembers.Id.value = document.FormMembers.Id.value.toLowerCase();
  temp = CheckId.value.substring(0,1);
	if(userid_startChar.indexOf(temp) == -1) {
		alert("¾ÆÀÌµðÀÇ Ã¹ÀÚ´Â ¿µ¹®À¸·Î ½ÃÀÛÇÏ¿©¾ß ÇÕ´Ï´Ù");
		CheckId.select();
		return false;
		}
					
	for (var i=0; i<CheckId.length; i++) {
		temp = CheckId.value.substring(i,i+1);
		if(userid_valid.indexOf(temp) == -1) {
			alert("È¸¿ø¾ÆÀÌµð´Â ¿µ¹®, ¼ýÀÚ¿Í _ ·Î¸¸ »ç¿ëÇÒ¼ö ÀÖ½À´Ï´Ù");
			CheckId.select();
			return false;
		}
	}	
	
	return true;
}

//<!-- ¾ÆÀÌµð Ã¼Å©2 -->//
function IdCheck(ThisFrom){
 var userid_valid = "abcdefghijklmnopqrstuvwxyz0123456789_";
  var userid_valname ="abcdefghijklmnopqrstuvwxhzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
  var userid_startChar = "abcdefghijklmnopqrstuvwxyz";
  var temp;
 if(!ThisFrom.Id.value){
	alert('¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
	ThisFrom.Id.focus();
	return false;
  }
  ThisFrom.Id.value = ThisFrom.Id.value.toLowerCase();
	if (ThisFrom.Id.value=="") {
		alert ("ID¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		ThisFrom.Id.focus();
		return false;
	   }
	temp = ThisFrom.Id.value.substring(0,1);
	if(userid_startChar.indexOf(temp) == -1) {
		alert("¾ÆÀÌµðÀÇ Ã¹ÀÚ´Â ¿µ¹®À¸·Î ½ÃÀÛÇÏ¿©¾ß ÇÕ´Ï´Ù");
		ThisFrom.Id.select();
		return false;
		}
					
	for (var i=0; i<ThisFrom.Id.value.length; i++) {
		temp = ThisFrom.Id.value.substring(i,i+1);
		if(userid_valid.indexOf(temp) == -1) {
			alert("È¸¿ø¾ÆÀÌµð´Â ¿µ¹®, ¼ýÀÚ¿Í _ ·Î¸¸ »ç¿ëÇÒ¼ö ÀÖ½À´Ï´Ù");
			ThisFrom.Id.select();
			return false;
		}
	}
	
	if ((ThisFrom.Id.value.length<4) ||(ThisFrom.Id.value.length>=12)){
		alert ("ID°¡ 4~12ÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		ThisFrom.Id.value="";
		ThisFrom.Id.focus();
		return false;
		}
 return true;
}

function IdOk(Id){
  opener.document.FormMembers.Id.value=Id;
	window .close();
}


//<!-- ¾ÆÀÌµð Áßº¹È®ÀÎ -->//
function CheckID(Mid,Ac)
{
	Id=document.FormMembers.Id.value;
	Url = "./AmiBoard.php?Mid="+Mid+"&Ac="+Ac+"&Id="+Id;
	if (Id == "") {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
		document.FormMembers.Id.focus();
	}
	else{
		window.open(Url,"Checkid"," scrollbars=no,toolbar=no,location=no,directories=no,status=no,width=390,height=300,resizable=no,menubar=no,left=100,top=100");
	}
}

//<!-- ÁÖ¹Î¹øÈ£ -->//
function keyup() {
   if (document.FormMembers.Jumin1.value.length==6)
        document.FormMembers.Jumin2.focus();
 }

//<!-- ÁÖµî·Ï¹øÈ£ Ã¼Å© -->//
function jumin_sub_check(jkjun) {

    var isNum = true;
    var ll_jkjun = 0;
    var ll_temp = 0;
   if ( jkjun == "1234567890123" ) {
        return 0;
   } 
   else {
    var str =  String(jkjun);
    ll_jkjun = ll_jkjun + parseInt(str.substring(0,1),10) * 9;
    ll_jkjun = ll_jkjun + parseInt(str.substring(1,2),10) * 8;
    ll_jkjun = ll_jkjun + parseInt(str.substring(2,3),10) * 7;
    ll_jkjun = ll_jkjun + parseInt(str.substring(3,4),10) * 6;
    ll_jkjun = ll_jkjun + parseInt(str.substring(4,5),10) * 5;
    ll_jkjun = ll_jkjun + parseInt(str.substring(5,6),10) * 4;
    ll_jkjun = ll_jkjun + parseInt(str.substring(6,7),10) * 3;
    ll_jkjun = ll_jkjun + parseInt(str.substring(7,8),10) * 2;
    ll_jkjun = ll_jkjun + parseInt(str.substring(8,9),10) * 9;
    ll_jkjun = ll_jkjun + parseInt(str.substring(9,10),10) * 8;
    ll_jkjun = ll_jkjun + parseInt(str.substring(10,11),10) * 7;
    ll_jkjun = ll_jkjun + parseInt(str.substring(11,12),10) * 6;
    ll_temp = ll_jkjun % 11;
    if (ll_temp == 0 ){
            ll_temp = 1;
    }
    if (ll_temp == 10 ){
            ll_temp = 0;
    }

    if (jkjun.length != 13 || ( parseInt(str.substring(6,7),10) > 4 ))  {
	return 1; 
    }
   	else if (ll_temp != parseInt(str.substring(12,13),10)) {
	return 2;
   	}
   	else  {
	return 0;
   	}
  }
}

function jumin_check()  {
	 tmp1 = document.FormMembers.Jumin1.value;
     tmp2 = document.FormMembers.Jumin2.value;
    
   if (tmp1 != "" ) {
        rtn = jumin_sub_check(tmp1 + tmp2);

       if (rtn == 1 )  {
            alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇÏ¼¼¿ä1.") ;
            document.FormMembers.Jumin1.value="";
            document.FormMembers.Jumin2.value="" ;
            document.FormMembers.Jumin1.focus() ;
            return false;
       }
       else if ( rtn == 2)  {
            alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇÏ¼¼¿ä2..") ;
            document.FormMembers.Jumin1.value="";
            document.FormMembers.Jumin2.value="" ;
            document.FormMembers.Jumin1.focus() ;
            return false;   
	   }
       else if (rtn == 0) {
			return true;			          
       }
   }
   else {
		return false;
        alert("ÁÖ¹Î¹øÈ£¸¦ Á¤È®ÇÏ°Ô ÀÔ·ÂÇÏ¼¼¿ä2..") ;
        document.FormMembers.Jumin1.value="";
        document.FormMembers.Jumin2.value="" ;
	    document.FormMembers.Jumin1.focus() ;
        return false;
   }
}


//<!-- ¿ìÆí¹øÈ£ -->//
function focusIt() {      
	document.zipsearch.dong.focus();
}

function focusIt2() {      
	document.zipsearch.adds.focus();
}

function checkIt(form) {
	if(!form.dong.value) {
		alert("À¾/¸é/µ¿ ¸íÀ» ¸ÕÀú ÀÔ·ÂÇØÁÖ¼¼¿ä!");
		form.dong.focus();
		return false;
	} else {
		return true;
	}
}

function checkIt2(form) {
	if(!form.dong.value) {
		alert("³ª¸ÓÁöÁÖ¼Ò¸¦ ³Ö¾îÁÖ¼¼¿ä!");
		form.dong.focus();
		return false;
	} else {
		return true;
	}
}

function selectIt() {
var zipadd = document.zipsearch.searched[zipsearch.searched.selectedIndex].value;
var form_object = eval("opener.document.FormMembers");	
if(document.zipsearch.adds.value ==""){
	alert("³ª¸ÓÁöÁÖ¼Ò¸¦ ³Ö¾îÁÖ¼¼¿ä!");
		document.zipsearch.adds.focus();
		return false;
}
form_object.Zip.value = zipadd.substring(0,7);
//form_object.zip2.value = zipadd.substring(4,7);
form_object.Addr1.value = zipadd.substring(8);
form_object.Addr2.value = document.zipsearch.adds.value;
self.close();
}


