
// 약관동의체크
function fnConfirm()
{
	if(document.all["confirmYN"][1].checked==true)
	{
		alert("이용약관을 읽고 동의해 주세요");
		return;
	}
	if(document.all["personYN"][1].checked==true)
	{
		alert("개인정보보호정책을 읽고 동의해 주세요");
		return;
	}
	document.frmconfirm.submit();
}

// 회원가입 우편번호검색
function findZIP(frm) {
window.open('post_check.asp?frms='+ frm,'','width=410, height=400, scrollbars=yes, status=yes');
}

// 주민번호 입력시 앞자리 입력후 자동으로 포커스 이동
function fnPerson()
{
	if(document.getElementById("personcode1").value.length==6)
	{
		document.getElementById("personcode2").focus();
	}
}

// 회원가입-가입여부확인
function fnNamecheck()
{
	var h_name = document.getElementById("h_name").value;
	var personcode1 = document.getElementById("personcode1").value;
	var personcode2 = document.getElementById("personcode2").value;
	
	if (h_name.length < 1) {
		alert("이름을 입력해 주세요");
		document.getElementById("h_name").focus();
		return;
	}
	if (personcode1.length < 1 ) {
		alert("주민번호를 입력해 주세요");
		document.getElementById("personcode1").focus();
		return;
	}
	if (personcode2.length < 1 ) {
		alert("주민번호를 입력해 주세요");
		document.getElementById("personcode2").focus();
		return;
	}

	var isNum = /^[0-9-]+$/;
	if( isNaN(personcode1) ) 
	{
		alert("주민번호는 숫자만 입력해 주세요");
		document.getElementById("personcode1").value = "";
		document.getElementById("personcode1").focus();
		return;
	}

	if( isNaN(personcode2) ) 
	{
		alert("주민번호는 숫자만 입력해 주세요");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;
	}

	var str_serial1 = personcode1;
	var str_serial2 = personcode2;
	var digit=0
	for (var i=0;i<str_serial1.length;i++)
	{
		var str_dig=str_serial1.substring(i,i+1);
		if (str_dig<'0' || str_dig>'9')
		{ 
			digit=digit+1 
		}
	}
	if ((str_serial1 == '') || ( digit != 0 ))
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		 return;   
	}
	var digit1=0
	for (var i=0;i<str_serial2.length;i++)
	{
		var str_dig1=str_serial2.substring(i,i+1);
		if (str_dig1<'0' || str_dig1>'9')
		{ 
			digit1=digit1+1 
		}
	}
	if ((str_serial2 == '') || ( digit1 != 0 ))
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;   
	}
	if (str_serial1.substring(2,3) > 1)
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;   
	}
	if (str_serial1.substring(4,5) > 3)
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;   
	} 
	if (str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0)
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;   
	}
	var a1=str_serial1.substring(0,1)
	var a2=str_serial1.substring(1,2)
	var a3=str_serial1.substring(2,3)
	var a4=str_serial1.substring(3,4)
	var a5=str_serial1.substring(4,5)
	var a6=str_serial1.substring(5,6)
	var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7
	var b1=str_serial2.substring(0,1)
	var b2=str_serial2.substring(1,2)
	var b3=str_serial2.substring(2,3)
	var b4=str_serial2.substring(3,4)
	var b5=str_serial2.substring(4,5)
	var b6=str_serial2.substring(5,6)
	var b7=str_serial2.substring(6,7)
	var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
	check_digit = check_digit%11
	check_digit = 11 - check_digit
	check_digit = check_digit%10
	if (check_digit != b7)
	{
		alert ("유효하지 않은 주민등록번호입니다.");
		document.getElementById("personcode2").value = "";
		document.getElementById("personcode2").focus();
		return;   
	}	

	var rUrl = '/member/memberAction.asp';
	var Parms  = '?mode=namecheck';
		Parms += '&h_name=' + h_name;
		Parms += '&personcode1=' + personcode1;
		Parms += '&personcode2=' + personcode2;

	var res = dynamic.loadText(rUrl + Parms);
	if(res=="OK")
	{
		document.frmnamechk.action="join_step4.html";
		document.frmnamechk.submit();
	}else if(res=="NO")
	{
		alert("이미 등록된 회원입니다.");
		location.href="/member/login.html";
		return;
	}else{
		alert(res);
		return;
	}
}


function fnIDinsert()
{
	document.getElementById("idchk").value="N";
}
function fnIDchk()
{
	var uid = document.getElementById("uid").value;
	if(uid=="")
	{
		alert("아이디를 입력해 주세요");
		document.getElementById("uid").focus();
		return;
	}

	var rUrl = '/member/memberAction.asp';
	var Parms  = '?mode=idcheck';
		Parms += '&uid=' + uid;

	var res = dynamic.loadText(rUrl + Parms);
	if(res=="OK")
	{
		alert("사용가능한 아이디입니다.");
		document.getElementById("idchk").value="Y";
		document.getElementById("pass").focus();
		return;
	}else if(res=="NO")
	{
		alert("이미 사용중인 아이디입니다.  다른 아이디를 사용해 주세요");
		document.getElementById("uid").value="";
		document.getElementById("uid").focus();
		return;
	}else{
		alert(res);
		return;
	}
}
// 회원가입
function fnRegist()
{
	var idchk = document.getElementById("idchk").value;
	if (idchk=="N")
	{
		alert("아이디 중복확인을 해주십시요.");
		document.getElementById("uid").focus();
		return;
	}
	
	var gubun = document.getElementById("gubun").value
	var uid = document.getElementById("uid").value;
	var pass = document.getElementById("pass").value;
	var pass_confirm = document.getElementById("pass_confirm").value;
	var h_name = document.getElementById("h_name").value;
	if(document.all["sex"][0].checked)
	{
		var sex = "M";
	}else{
		var sex = "F";
	}
	var e_name = document.getElementById("e_name").value;
//	var personcode1 = document.getElementById("personcode1").value;
//	var personcode2 = document.getElementById("personcode2").value;
	var tel = document.getElementById("tel").value;
	var hp = document.getElementById("hp").value;
	var fax = document.getElementById("fax").value;
	var email = document.getElementById("email").value;
	var url = document.getElementById("url").value;
	var MSN = document.getElementById("MSN").value;
	var company = document.getElementById("company").value;
	var addr = document.getElementById("addr").value;
	var Parms_Agent = "";
	if(document.getElementById("emailYN").checked)
	{
		var emailYN = "Y";
	}else{
		var emailYN = "N";
	}
	if(document.getElementById("smsYN").checked)
	{
		var smsYN = "Y";
	}else{
		var smsYN = "N";
	}

	if(gubun!="A")
	{
		if(pass=="")
		{
			alert("비밀번호를 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass.length<4)
		{
			alert("비밀번호는 4~8자로 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass_confirm=="")
		{
			alert("비밀번호 확인을 입력해 주세요");
			document.getElementById("pass_confirm").focus();
			return;
		}
		if(pass!=pass_confirm)
		{
			alert("비밀번호가 일치하지 않습니다.");
			document.getElementById("pass").value="";
			document.getElementById("pass").focus();
			return;
		}
		if(h_name=="")
		{
			alert("한글 이름을 입력해 주세요");
			document.getElementById("h_name").focus();
			return;
		}
		if(e_name=="")
		{
			alert("영문 이름을 입력해 주세요");
			document.getElementById("e_name").focus();
			return;
		}
		if(tel=="")
		{
			alert("전화번호를 입력해 주세요");
			document.getElementById("tel").focus();
			return;
		}
		if(hp=="")
		{
			alert("휴대전화번호를 입력해 주세요");
			document.getElementById("hp").focus();
			return;
		}
		if(email=="")
		{
			alert("이메일주소를 입력해 주세요");
			document.getElementById("email").focus();
			return;
		}
		if (email.indexOf(".")<3) 
		{
			alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
			document.getElementById("email").value = "";
			document.getElementById("email").focus();
			return;
		}
		if(company=="")
		{
			alert("회사명을 입력해 주세요");
			document.getElementById("company").focus();
			return;
		}
		if(addr=="")
		{
			alert("주소를 입력해 주세요");
			document.getElementById("addr").focus();
			return;
		}
	}else{
		var companyNum = document.getElementById("companyNum").value
		var companyOwner = document.getElementById("companyOwner").value;
		var companyPart = document.getElementById("companyPart").value;
		var companyLevel = document.getElementById("companyLevel").value;
		var companyBank = document.getElementById("companyBank").value;
		var companyAccount = document.getElementById("companyAccount").value;
		var companyAccountNm = document.getElementById("companyAccountNm").value;

		if(pass=="")
		{
			alert("비밀번호를 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass.length<4)
		{
			alert("비밀번호는 4~8자로 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass_confirm=="")
		{
			alert("비밀번호 확인을 입력해 주세요");
			document.getElementById("pass_confirm").focus();
			return;
		}
		if(pass!=pass_confirm)
		{
			alert("비밀번호가 일치하지 않습니다.");
			document.getElementById("pass").value="";
			document.getElementById("pass").focus();
			return;
		}
		if(h_name=="")
		{
			alert("한글 이름을 입력해 주세요");
			document.getElementById("h_name").focus();
			return;
		}
		if(e_name=="")
		{
			alert("영문 이름을 입력해 주세요");
			document.getElementById("e_name").focus();
			return;
		}
		if(hp=="")
		{
			alert("휴대전화번호를 입력해 주세요");
			document.getElementById("hp").focus();
			return;
		}
		if(email=="")
		{
			alert("이메일주소를 입력해 주세요");
			document.getElementById("email").focus();
			return;
		}
		if (email.indexOf(".")<3) 
		{
			alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
			document.getElementById("email").value = "";
			document.getElementById("email").focus();
			return;
		}
		if(company=="")
		{
			alert("여행사명을 입력해 주세요");
			document.getElementById("company").focus();
			return;
		}
		if(companyNum=="")
		{
			alert("사업자등록번호를 입력해 주세요");
			document.getElementById("companyNum").focus();
			return;
		}
		if(companyOwner=="")
		{
			alert("대표자명을 입력해 주세요");
			document.getElementById("companyOwner").focus();
			return;
		}
		if(companyPart=="")
		{
			alert("담당자 부서를 입력해 주세요");
			document.getElementById("companyPart").focus();
			return;
		}
		if(companyLevel=="")
		{
			alert("담당자 직급을 입력해 주세요");
			document.getElementById("companyLevel").focus();
			return;
		}
		if(tel=="")
		{
			alert("전화번호를 입력해 주세요");
			document.getElementById("tel").focus();
			return;
		}
		if(addr=="")
		{
			alert("주소를 입력해 주세요");
			document.getElementById("addr").focus();
			return;
		}
		if(companyBank=="")
		{
			alert("입금졔좌의 은행명을 입력해 주세요");
			document.getElementById("companyBank").focus();
			return;
		}
		if(companyAccount=="")
		{
			alert("입금졔좌번호를 입력해 주세요");
			document.getElementById("companyAccount").focus();
			return;
		}
		if(companyAccountNm=="")
		{
			alert("입금졔좌의 예금주를 입력해 주세요");
			document.getElementById("companyAccountNm").focus();
			return;
		}
		Parms_Agent = '&companyNum=' + companyNum;
		Parms_Agent += '&companyOwner=' + companyOwner;
		Parms_Agent += '&companyPart=' + companyPart;
		Parms_Agent += '&companyLevel=' + companyLevel;
		Parms_Agent += '&companyBank=' + companyBank;
		Parms_Agent += '&companyAccount=' + companyAccount;
		Parms_Agent += '&companyAccountNm=' + companyAccountNm;
	}
	
	var rUrl = '/member/memberAction.asp';
	var Parms  = '&mode=regist';
		Parms += '&gubun=' + gubun;
		Parms += '&uid=' + uid;
		Parms += '&pass=' + pass;
		Parms += '&h_name=' + h_name;
		Parms += '&sex=' + sex;
		Parms += '&e_name=' + e_name;
//		Parms += '&personcode1=' + personcode1;
//		Parms += '&personcode2=' + personcode2;
		Parms += '&tel=' + tel;
		Parms += '&hp=' + hp;
		Parms += '&fax=' + fax;
		Parms += '&email=' + email;
		Parms += '&url=' + url;
		Parms += '&MSN=' + MSN;
		Parms += '&company=' + company;
		Parms += '&addr=' + addr;
		Parms += '&emailYN=' + emailYN;
		Parms += '&smsYN=' + smsYN;
		Parms += Parms_Agent;

	sendRequest(fnRegistMSG,Parms,"POST",rUrl,true,true);
}

//회원가입 결과 메세지
function fnRegistMSG(res)
{
	var gubun = document.getElementById("gubun").value
	var uid = document.getElementById("uid").value
	var email = document.getElementById("email").value;
	var h_name = document.getElementById("h_name").value;

	if(res.responseText=="OK")
	{
		if(gubun=="A")
		{
			var res = dynamic.loadHtml('/mail/membermail_agent.html?uid='+uid);
		}else{
			var res = dynamic.loadHtml('/mail/membermail.html?uid='+uid);
		}
		var rUrl = '/member/memberAction.asp';
		var Parms  = '&mode=membermail';
			Parms += '&h_name=' + h_name;
			Parms += '&toMail=' + email;
			Parms += '&memberinfo=' + ReplaceINSERT(res);
			
		sendRequest(fnNULL,Parms,"POST",rUrl,true,true);

		location.href="/member/join_step4.html?gubun="+gubun + "&uid="+uid;

		return;
	}else{
		if(res.responseText=="Personcode_error")
		{
			alert("이미 가입된 주민번호입니다. 다시한번 주민번호를 체크해주세요");
			location.href="/member/join_step2.html?gubun="+gubun;
		}else if(res.responseText=="ID_error")
		{
			alert("이미 사용중인 아이디입니다");
			return;
		}else{
			alert(res.responseText);
			return;
		}
	}
}
// 회원정보수정
function fnModify()
{
	var gubun = document.getElementById("gubun").value
	var uid = document.getElementById("uid").value;
	var pass = document.getElementById("pass").value;
	var pass_confirm = document.getElementById("pass_confirm").value;
	var h_name = document.getElementById("h_name").value;
	var sex = document.getElementById("sex").value;
	var e_name = document.getElementById("e_name").value;
	var tel = document.getElementById("tel").value;
	var hp = document.getElementById("hp").value;
	var fax = document.getElementById("fax").value;
	var email = document.getElementById("email").value;
	var url = document.getElementById("url").value;
	var MSN = document.getElementById("MSN").value;
	var company = document.getElementById("company").value;
	var addr = document.getElementById("addr").value;
	var Parms_Agent = "";
	if(document.getElementById("emailYN").checked)
	{
		var emailYN = "Y";
	}else{
		var emailYN = "N";
	}
	if(document.getElementById("smsYN").checked)
	{
		var smsYN = "Y";
	}else{
		var smsYN = "N";
	}

	if(gubun!="A")
	{
		if(pass=="")
		{
			alert("비밀번호를 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass.length<4)
		{
			alert("비밀번호는 4~8자로 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass_confirm=="")
		{
			alert("비밀번호 확인을 입력해 주세요");
			document.getElementById("pass_confirm").focus();
			return;
		}
		if(pass!=pass_confirm)
		{
			alert("비밀번호가 일치하지 않습니다.");
			document.getElementById("pass").value="";
			document.getElementById("pass").focus();
			return;
		}
		if(e_name=="")
		{
			alert("영문 이름을 입력해 주세요");
			document.getElementById("e_name").focus();
			return;
		}
		if(tel=="")
		{
			alert("전화번호를 입력해 주세요");
			document.getElementById("tel").focus();
			return;
		}
		if(hp=="")
		{
			alert("휴대전화번호를 입력해 주세요");
			document.getElementById("hp").focus();
			return;
		}
		if(email=="")
		{
			alert("이메일주소를 입력해 주세요");
			document.getElementById("email").focus();
			return;
		}
		if (email.indexOf(".")<3) 
		{
			alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
			document.getElementById("email").value = "";
			document.getElementById("email").focus();
			return;
		}
		if(company=="")
		{
			alert("회사명을 입력해 주세요");
			document.getElementById("company").focus();
			return;
		}
		if(addr=="")
		{
			alert("주소를 입력해 주세요");
			document.getElementById("addr").focus();
			return;
		}
	}else{
		var companyNum = document.getElementById("companyNum").value
		var companyOwner = document.getElementById("companyOwner").value;
		var companyPart = document.getElementById("companyPart").value;
		var companyLevel = document.getElementById("companyLevel").value;
		var companyBank = document.getElementById("companyBank").value;
		var companyAccount = document.getElementById("companyAccount").value;
		var companyAccountNm = document.getElementById("companyAccountNm").value;

		if(pass=="")
		{
			alert("비밀번호를 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass.length<4)
		{
			alert("비밀번호는 4~8자로 입력해 주세요");
			document.getElementById("pass").focus();
			return;
		}
		if(pass_confirm=="")
		{
			alert("비밀번호 확인을 입력해 주세요");
			document.getElementById("pass_confirm").focus();
			return;
		}
		if(pass!=pass_confirm)
		{
			alert("비밀번호가 일치하지 않습니다.");
			document.getElementById("pass").value="";
			document.getElementById("pass").focus();
			return;
		}
		if(e_name=="")
		{
			alert("영문 이름을 입력해 주세요");
			document.getElementById("e_name").focus();
			return;
		}
		if(hp=="")
		{
			alert("휴대전화번호를 입력해 주세요");
			document.getElementById("hp").focus();
			return;
		}
		if(email=="")
		{
			alert("이메일주소를 입력해 주세요");
			document.getElementById("email").focus();
			return;
		}
		if (email.indexOf(".")<3) 
		{
			alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
			document.getElementById("email").value = "";
			document.getElementById("email").focus();
			return;
		}
		if(company=="")
		{
			alert("여행사명을 입력해 주세요");
			document.getElementById("company").focus();
			return;
		}
		if(companyNum=="")
		{
			alert("사업자등록번호를 입력해 주세요");
			document.getElementById("companyNum").focus();
			return;
		}
		if(companyOwner=="")
		{
			alert("대표자명을 입력해 주세요");
			document.getElementById("companyOwner").focus();
			return;
		}
		if(companyPart=="")
		{
			alert("담당자 부서를 입력해 주세요");
			document.getElementById("companyPart").focus();
			return;
		}
		if(companyLevel=="")
		{
			alert("담당자 직급을 입력해 주세요");
			document.getElementById("companyLevel").focus();
			return;
		}
		if(tel=="")
		{
			alert("전화번호를 입력해 주세요");
			document.getElementById("tel").focus();
			return;
		}
		if(addr=="")
		{
			alert("주소를 입력해 주세요");
			document.getElementById("addr").focus();
			return;
		}
		if(companyBank=="")
		{
			alert("입금졔좌의 은행명을 입력해 주세요");
			document.getElementById("companyBank").focus();
			return;
		}
		if(companyAccount=="")
		{
			alert("입금졔좌번호를 입력해 주세요");
			document.getElementById("companyAccount").focus();
			return;
		}
		if(companyAccountNm=="")
		{
			alert("입금졔좌의 예금주를 입력해 주세요");
			document.getElementById("companyAccountNm").focus();
			return;
		}
		Parms_Agent = '&companyNum=' + companyNum;
		Parms_Agent += '&companyOwner=' + companyOwner;
		Parms_Agent += '&companyPart=' + companyPart;
		Parms_Agent += '&companyLevel=' + companyLevel;
		Parms_Agent += '&companyBank=' + companyBank;
		Parms_Agent += '&companyAccount=' + companyAccount;
		Parms_Agent += '&companyAccountNm=' + companyAccountNm;
	}
	
	var rUrl = '/member/memberAction.asp';
	var Parms  = '&mode=modify';
		Parms += '&gubun=' + gubun;
		Parms += '&uid=' + uid;
		Parms += '&pass=' + pass;
		Parms += '&h_name=' + h_name;
		Parms += '&sex=' + sex;
		Parms += '&e_name=' + e_name;
		Parms += '&tel=' + tel;
		Parms += '&hp=' + hp;
		Parms += '&fax=' + fax;
		Parms += '&email=' + email;
		Parms += '&url=' + url;
		Parms += '&MSN=' + MSN;
		Parms += '&company=' + company;
		Parms += '&addr=' + addr;
		Parms += '&emailYN=' + emailYN;
		Parms += '&smsYN=' + smsYN;
		Parms += Parms_Agent;

	sendRequest(fnModifyMSG,Parms,"POST",rUrl,true,true);
}

//회원정보수정 결과 메세지
function fnModifyMSG(res)
{
	if(res.responseText=="OK")
	{
		alert("회원정보가 수정되었습니다.");
		return;
	}else{
		alert(res.responseText);
		return;
	}
}

function fnBankClear()
{
	if(document.getElementById("companyBank").value == "은행명")
	{
		document.getElementById("companyBank").value = "";
	}
}
function fnAccountClear()
{
	if(document.getElementById("companyAccount").value == "계좌번호")
	{
		document.getElementById("companyAccount").value = ""
	} 
}
function fnAccountNmClear()
{
	if(document.getElementById("companyAccountNm").value == "예금주")
	{
		document.getElementById("companyAccountNm").value = "";
	}
}
// 회원탈퇴 요청
function fnLeave()
{
	if (confirm('회원 탈퇴 요청을 하시겠습니까?'))
	{
		var rUrl = '/member/member_ok.asp';
		var Parms  = '?mode=leave';
		var res = dynamic.loadText(rUrl + Parms);

		if(res=="OK")
		{
			alert("회원 탈퇴 요청되었습니다.");
			location.href="/index.asp";
			return;
		}else{
			alert(res);
			return;
		}
	}
}

// ID찾기
function fnIDfind()
{
	var h_name = document.getElementById("h_name").value;
	var email = document.getElementById("email").value;
	
	if (h_name.length < 1) {
		alert("이름을 입력해 주세요");
		document.getElementById("h_name").focus();
		return;
	}
	if (email.length < 1) {
		alert("이메일을 입력해 주세요");
		document.getElementById("email").focus();
		return;
	}
	if (email.indexOf(".")<3) 
	{
		alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
		document.getElementById("email").value = "";
		document.getElementById("email").focus();
		return;
	}

	var rUrl = '/member/memberAction.asp';
	var Parms  = '?mode=idfind';
		Parms += '&h_name=' + URLencode(h_name);
		Parms += '&email=' + email;

	var res = dynamic.loadText(rUrl + Parms);
	res = res.split('||');

	if(res[0]=="OK")
	{
		location.href="/member/idfind_ok.html?uid=" + res[1];
		return;
	}else{
		alert("입력하신 정보와 일치하는 정보가 없습니다.");
		return;
	}
}


// 비밀번호 찾기
function fnPWDfind()
{
	var uid = document.getElementById("uid").value;
	var h_name = document.getElementById("h_name").value;
	var email = document.getElementById("email").value;

	if(uid=="")
	{
		alert("아이디를 입력해 주세요");
		document.getElementById("uid").focus();
		return;
	}

	if(h_name=="")
	{
		alert("이름을 입력해 주세요");
		document.getElementById("h_name").focus();
		return;
	}

	if(email=="")
	{
		alert("이메일을 입력해 주세요");
		document.getElementById("email").focus();
		return;
	}
	if (email.indexOf(".")<3) 
	{
		alert("이메일의 형식이 잘못되었습니다. 다시 입력해 주세요")
		document.getElementById("email").value = "";
		document.getElementById("email").focus();
		return;
	}

	var rUrl = '/member/memberAction.asp';
	var Parms  = '?mode=pwdfind';
		Parms += '&uid=' + uid;
		Parms += '&h_name=' + URLencode(h_name);
		Parms += '&email=' + email;

	var res = dynamic.loadText(rUrl + Parms);
	if(res=="OK")
	{
		var res = dynamic.loadHtml('/mail/passfindmail.html?uid='+uid+'&h_name='+URLencode(h_name));
		var rUrl = '/member/memberAction.asp';
		var Parms  = '&mode=pwdfindmail';
			Parms += '&uid=' + uid;
			Parms += '&h_name=' + h_name;
			Parms += '&toMail=' + email;
			Parms += '&passinfo=' + ReplaceINSERT(res);
			
		sendRequest(fnalert,Parms,"POST",rUrl,true,true);
	}else{
		alert("입력하신 정보와 일치하는 정보가 없습니다.");
		return;
	}

}

// 회원탈퇴
function fnLeave()
{
	var uid = document.getElementById("uid").value;
	var pass = document.getElementById("pass").value;
	
	if (pass.length < 1) {
		alert("비밀번호를 입력해 주세요");
		document.getElementById("pass").focus();
		return;
	}

	var rUrl = '/member/memberAction.asp';
	var Parms  = '?mode=leave';
		Parms += '&uid=' + uid;
		Parms += '&pass=' + pass;

	var res = dynamic.loadText(rUrl + Parms);
	if(res=="OK")
	{
		alert("회원탈퇴가 완료되었습니다.  그동안 이룡을 이용해 주셔서 감사합니다.");
		location.href="/index.html";
	}else if(res=="NO")
	{
		alert("비밀번호가 일치하지 않습니다.");
		document.getElementById("pass").value="";
		document.getElementById("pass").focus();
		return;
	}else{
		alert(res);
		return;
	}
}

