﻿// <summary>
/// 파일    명: member.js
/// 파일  설명:	회원관련(호텔제팬)
/// 작  성  자:	k. kwang
/// 최초작성일:	2006.09.11
/// 수  정  자:	k. kwang<br/>
/// 최종수정일:	2006.09.11
/// </summary>
//////////////////////////// member_01 ///////////////////////////////
//////////////////////////////////////////////////////////////////////
function corp_id_check() {
	    var corp_code = form1.txtCorp_code1.value + form1.txtCorp_code2.value + form1.txtCorp_code3.value;
	    
    	if(isNaN(corp_code) == true)
        { 
            alert("회원번호는 숫자만 가능합니다.");
            form1.txtCorp_code1.focus();
            return false;
        }
	    
        if (corp_code.length != 10) 
        {
            alert("사업자등록번호가 잘못되었습니다.");                
            form1.txtCorp_code1.focus();
		    return;
        }

        sumMod = 0;
        sumMod += parseInt(corp_code.substring(0,1));
        sumMod += parseInt(corp_code.substring(1,2)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(2,3)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(3,4)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(4,5)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(5,6)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(6,7)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(7,8)) * 3 % 10;
        sumMod += Math.floor(parseInt(corp_code.substring(8,9)) * 5 / 10);
        sumMod += parseInt(corp_code.substring(8,9)) * 5 % 10;
        sumMod += parseInt(corp_code.substring(9,10));

        if (sumMod % 10 != 0) 
        {
            alert("사업자등록번호가 잘못되었습니다.");                
            form1.txtCorp_code1.focus();
		    return;
        }	    

	    //op
	    urlname = "../member/corporate_checkid.aspx?m_id="+form1.txtCorp_code1.value + "-" + form1.txtCorp_code2.value + "-" + form1.txtCorp_code3.value+"&div=2";
	    window.open(urlname, "browse_org","height=250,width=350, menubar=no,directories=no,resizable=no,status=no,scrollbars=no");

}

// 아이디 체크
function id_check1(div) {
	var urlname;
	
	if(div == '0')
	{		
	    if(form1.id.value.search(/^\d/) != -1 || form1.id.value.search(/[_\W]/) != -1 ||  form1.id.value.search(/[\W]/) != -1)
            {
                alert("아이디는 영어와 숫자만 가능합니다.");
                form1.id.focus();
                return false;
            }
	    //member
	    urlname = "member_checkid.aspx?m_id="+document.form1.id.value+"&div=0";
	}
	else if(div == '1')
	{
	    if(form1.id.value.search(/^\d/) != -1 || form1.id.value.search(/[_\W]/) != -1 ||  form1.id.value.search(/[\W]/) != -1)
            {
                alert("아이디는 영어와 숫자만 가능합니다.");
                form1.id.focus();
                return false;
            }
	    //op
	    urlname = "../member/member_checkid.aspx?m_id="+document.form1.op_id.value+"&div=1";
	}	
	else if(div == '2')
	{
	    var corp_code = form1.txtCorp_code1.value + form1.txtCorp_code2.value + form1.txtCorp_code3.value;
	    
    	if(isNaN(corp_code) == true)
        {
            alert("사업자등록번호는 숫자만 가능합니다.");
            form1.txtCorp_code1.focus();
            return false;
        }
	    
        if (corp_code.length != 10) 
        {
            alert("사업자등록번호가 잘못되었습니다.");                
            form1.txtCorp_code1.focus();
		    return;
        }

        sumMod = 0;
        sumMod += parseInt(corp_code.substring(0,1));
        sumMod += parseInt(corp_code.substring(1,2)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(2,3)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(3,4)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(4,5)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(5,6)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(6,7)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(7,8)) * 3 % 10;
        sumMod += Math.floor(parseInt(corp_code.substring(8,9)) * 5 / 10);
        sumMod += parseInt(corp_code.substring(8,9)) * 5 % 10;
        sumMod += parseInt(corp_code.substring(9,10));

        if (sumMod % 10 != 0) 
        {
            alert("사업자등록번호가 잘못되었습니다.");                
            form1.txtCorp_code1.focus();
		    return;
        }	    

	    //op
	    urlname = "../member/corporate_checkid.aspx?m_id="+form1.txtCorp_code1.value + "-" + form1.txtCorp_code2.value + "-" + form1.txtCorp_code3.value+"&div=2";
	}	
    else
    {
        if(form1.id.value.search(/^\d/) != -1 || form1.id.value.search(/[_\W]/) != -1 ||  form1.id.value.search(/[\W]/) != -1)
            {
                alert("아이디는 영어와 숫자만 가능합니다.");
                form1.id.focus();
                return false;
            }
        //agent
        urlname = "../member/member_checkid.aspx?m_id="+document.form1.id.value + "&hidSi_Type=B";
    }
        
	window.open(urlname, "browse_org","height=250,width=350, menubar=no,directories=no,resizable=no,status=no,scrollbars=no");

}

// 유효성 체크(등록)
function member(param,param2) {
//	if(!form1.agree.checked) {
//	    if(param == "ko") {
//    		alert("회원약관에 동의 해주세요.");
//    	}
//    	else {
//    	    alert("You should agree to the terms and conditions in order to become a member.");
//    	}
//		form1.agree.focus();
//		return;
//	}
//	
//	if(form1.agree1 != null)
//	{
//	    if(form1.agree1.checked != null && !form1.agree1.checked) {
//	        if(param == "ko") {
//    		    alert("개인정보 수집에 동의 해주세요.");
//    	    }
//    	    else {
//    	        alert("You should agree to the terms and conditions in order to become a member.");
//    	    }
//		    form1.agree1.focus();
//		    return;
//	    }
//	}
	
	if(form1.id.value == "") {
	    if(param == "ko") {
    		alert("아이디를 입력 해주세요.");
    	}
    	else {
    	    alert("Please write your ID.");
    	}
		
		form1.id.focus();
		return;
	}
	
	if(form1.id.value.search(/^\d/) != -1 || form1.id.value.search(/[_\W]/) != -1 ||  form1.id.value.search(/[\W]/) != -1)
    {
//        if("<xsl:value-of select='$sitelang'/>" == "ko") {
    		alert("아이디는 영어와 숫자만 가능합니다.");
//    	}
//    	else {
//    	    alert("회원약관에 동의 해주세요.");
//    	}
        
        form1.id.focus();
        return;
    }
    
   if(form1.pass1.value.length < 4) {
	    if(param == "ko") {
    		alert("4자 이상인 비밀번호를 입력해 주세요.");
    	}
    	else {
    	    alert("Above English and number 4 letter.");
    	}
		
		form1.pass1.focus();
		return;
	}
	
	if(form1.pass1.value != form1.pass2.value) {
	    if(param == "ko") {
    		alert("비밀번호가 일치하지 않습니다.");
    	}
    	else {
    	    alert("Please verify password.");
    	}
		
		form1.pass2.focus();
		return;
	}
	
    
    if(param == "ko") {
	    if(form1.k_name.value == "") {
		    alert("한글이름을 입력 해주세요.");
    		form1.k_name.focus();
	    	return;
	    }
	}
	else {
	    if(param == "ko") {
    		alert("영문이름을 입력 해주세요.");
    	}
    	else {
    	    alert("Please write your name.");
    	}
		
		form1.e_name.focus();
		return;
	}
	
	
//	if(param == "ko") {
//    	if(form1.p_num1.value == '' || form1.p_num2.value =='') {
//	    	alert('주민등록번호를 입력해주세요!');
//		    form1.p_num1.focus();
//    		return;
//	    }
	
	
//	   var strregistnum1;
//       var strregistnum2;
//       var jumin ;
//	   strregistnum1 = form1.p_num1.value;
//       strregistnum2 = form1.p_num2.value;

//	   jumin = strregistnum1 + strregistnum2;
//	  
//       var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strZ;
//       var nCalA, nCalB, nCalC;
//       strA = jumin.substr(0, 1); 
//       strB = jumin.substr(1, 1);
//       strC = jumin.substr(2, 1);
//       strD = jumin.substr(3, 1);
//       strE = jumin.substr(4, 1);
//       strF = jumin.substr(5, 1);
//       strG = jumin.substr(6, 1); 
//       strH = jumin.substr(7, 1);
//       strI = jumin.substr(8, 1);
//       strJ = jumin.substr(9, 1);
//       strK = jumin.substr(10, 1);
//       strL = jumin.substr(11, 1);
//       strM = jumin.substr(12, 1);
//       strZ = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;
//       nCalA = eval(strZ);
//       nCalB = nCalA % 11;
//       nCalC = 11 - nCalB;
//       nCalC = nCalC % 10;
//  
//        if ( nCalC != strM) 
//         {
//	    	alert ('정확한 주민등록번호 정보를 확인해주세요');
//		    form1.p_num1.focus();
//		
//    		return;
//         }
//     }
    
//   if(form1.address1.value == '')
//	{
//	    if(param == "ko") {
//    		alert('주소를 입력해 주세요!');
//    	}
//    	else {
//    	    alert('Please write your home address!');
//    	}
//		
//		form1.address1.focus();
//		return;
//	}
  
    if(form1.mobile1.value == '') {
        if(param == "ko") {
    		alert('핸드폰번호를 입력해 주세요!');
    	}
    	else {
    	    alert('Please write your cell phone number!');
    	}
	   	
	    form1.mobile1.focus();
    	return;
	}
	
	if(form1.mobile2.value == '' || form1.mobile3.value == '') {
	   	if(param == "ko") {
    		alert('핸드폰번호를 입력해 주세요!');
    	}
    	else {
    	    alert('Please write your cell phone number!');
    	}
	    form1.mobile2.focus();
    	return;
	}
	
    if(isNaN(form1.mobile1.value) == true || isNaN(form1.mobile2.value) == true || isNaN(form1.mobile3.value) == true)
	{
	    alert('핸드폰번호는 숫자만 가능합니다.');
    	form1.mobile1.focus();
	   	return;
	}
	 
    if(param == "ko") {
     
         var email = form1.email1.value + "@" + form1.email2.value;
	
	    if(form1.email1.value == '') {
		    alert('email을 입력해 주세요!');
    		form1.email1.focus();
	    	return;
    	}
	
	    if(form1.email2.value == '') {
	        alert('email을 입력해 주세요!');
    	    form1.email2.focus();
	        return;
    	}
	}
    else {
	    var email = form1.email.value;
	}
	
	if (email =='' || email.length <= 6 || email.indexOf ('@', 0) == -1 || email.indexOf ('.', 0) == -1) {
	     if(param == "ko") {
    		alert("'' " + form1.email1.value + " '', 은 이메일주소가 아닙니다"); 
    	}
    	else {
    	    alert("Please write your correct e-mail address.");
    	}
	    
	    return; 
    }
   
    
	
	if(param == "ko") {
	    if(form1.postnum1.value == '') {
		    alert('우편번호를 입력해 주세요!');
		    form1.postnum1.focus();
    		return;
	    }
	
	    if(form1.postnum1.value == '') {
		    alert('우편번호를 입력해 주세요!');
    		form1.postnum1.focus();
	    	return;
    	}
	
	    if(isNaN(form1.postnum1.value) == true)
    	{
	    	alert('우편번호는 숫자만 가능합니다.');
		    form1.postnum1.focus();
    		return;
	    }
	
    	if(isNaN(form1.postnum2.value) == true)
	    {
		    alert('우편번호는 숫자만 가능합니다.');
    		form1.postnum2.focus();
	    	return;
    	}
	}

    
    if(param == "ko" && param2 != "1") {
        var _arrvisit = new Array("일본","동남아","유럽","중국","대양주","국내");
        var _arrtravel = new Array("골프/레져","허니문","반딧불","주말여행","단체여행","온천여행","테마여행","쇼핑여행","자유여행");
        var _visit = "";
        var _visit_txt = "";
        var _travel = "";
        var _travel_txt = "";
        
        for(i=1;i<7;i++) {
            var _objVisit = document.getElementById("visit" + i);
            if(_objVisit.checked) {
                _visit = _visit + _objVisit.value + ",";
                _visit_txt = _visit_txt + _arrvisit[i-1] + ",";
            }
        
        }
        for(i=1;i<10;i++) {
            var _objTravel = document.getElementById("travel" + i);
            if(_objTravel.checked) {
                _travel = _travel + _objTravel.value + ",";
                _travel_txt = _travel_txt + _arrtravel[i-1] + ",";
            }
        
        }   
        
        document.getElementById("visit").value = _visit;
        document.getElementById("travel").value = _travel;
        document.getElementById("visit_str").value = _visit_txt;
        document.getElementById("travel_str").value = _travel_txt;
    }
    if(document.getElementById("work")!= null && document.getElementById("work").value != "")
        document.getElementById("work_str").value = document.getElementById("work").options[document.getElementById("work").value].text;
	
    if(param == "ko") {
        if(confirm('회원 정보를 정확히 입력하셨습니까?'))
        {
            document.form1.action="../member/member_01_4.aspx?for="+param2; // https://www.hoteljapan.com/hoteljapan
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
    else {
        if(confirm('Are you sure that all information is correct?'))
        {
            document.form1.action="https://www.hoteljapan.com/hoteljapan/member/member_02.aspx";
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
    
}

function member_insert(param2) {
    document.form1.action="../member/member_02.aspx?for="+param2; // https://www.hoteljapan.com/hoteljapan
    document.form1.submit();
}

// 유효성 체크(등록)
function corp_member(param) {
//	if(!form1.agree.checked) 
//	{
//	    if(param == "ko")
//    		alert("회원약관에 동의 해주세요.");
//    		
//    	else
//    	    alert("You should agree to the terms and conditions in order to become a member.");
//    	    
//		form1.agree.focus();
//		return;
//	}
//	
//	if(form1.agree1 != null)
//	{
//	    if(form1.agree1.checked != null && !form1.agree1.checked) 
//	    {
//	        if(param == "ko")
//    		    alert("개인정보 수집에 동의 해주세요.");
//    		    
//    	    else
//    	        alert("You should agree to the terms and conditions in order to become a member.");
//    	     
//		    form1.agree1.focus();
//		    return;
//	    }
//	}
	
	if(form1.txtCorp_code1.value == "") 
	{
	    if(param == "ko")
            alert("사업자등록번호를 입력 해주세요.");
            
        else
            alert("Please enter the register number.");
		
		form1.txtCorp_code1.focus();
		return;
	}
	
	if(form1.txtCorp_code2.value == "") 
	{
	    if(param == "ko")
            alert("사업자등록번호를 입력 해주세요.");
            
        else
            alert("Please enter the register number.");
		
		form1.txtCorp_code2.focus();
		return;
	}
	
	if(form1.txtCorp_code3.value == "") 
	{
	    if(param == "ko")
            alert("사업자등록번호를 입력 해주세요.");
            
        else
            alert("Please enter the register number.");
		
		form1.txtCorp_code3.focus();
		return;
	}
	

    strNumb = form1.txtCorp_code1.value + form1.txtCorp_code2.value + form1.txtCorp_code3.value;
    
    if (strNumb.length != 10) 
    {
        if(param == "ko")
            alert("사업자등록번호가 잘못되었습니다.");
            
        else
            alert("Business Registration Number is invalid.");
            
        form1.txtCorp_code1.focus();
		return;
    }

    sumMod = 0;
    sumMod += parseInt(strNumb.substring(0,1));
    sumMod += parseInt(strNumb.substring(1,2)) * 3 % 10;
    sumMod += parseInt(strNumb.substring(2,3)) * 7 % 10;
    sumMod += parseInt(strNumb.substring(3,4)) * 1 % 10;
    sumMod += parseInt(strNumb.substring(4,5)) * 3 % 10;
    sumMod += parseInt(strNumb.substring(5,6)) * 7 % 10;
    sumMod += parseInt(strNumb.substring(6,7)) * 1 % 10;
    sumMod += parseInt(strNumb.substring(7,8)) * 3 % 10;
    sumMod += Math.floor(parseInt(strNumb.substring(8,9)) * 5 / 10);
    sumMod += parseInt(strNumb.substring(8,9)) * 5 % 10;
    sumMod += parseInt(strNumb.substring(9,10));

    if (sumMod % 10 != 0) 
    {
        if(param == "ko")
            alert("사업자등록번호가 잘못되었습니다.");
            
        else
            alert("Business Registration Number is invalid.");
            
        form1.txtCorp_code1.focus();
		return;
    }
    
    if(form1.hidCorp_code.value == "") 
	{
	    if(param == "ko")
            alert("사업자등록번호 중복검사를 해주세요.");
            
        else
            alert("Please enter the register number.");
		
		form1.txtCorp_code1.focus();
		return;
	}
	
	if(form1.txtCorp_name.value == "") 
	{
	    if(param == "ko")
    		alert("회사명을 입력 해주세요.");
    		
    	else 
    	    alert("Please write your company name.");
		
		form1.txtCorp_name.focus();
		return;
	}
	
	if(form1.txtCorp_president.value == "") 
	{
	    if(param == "ko")
	        alert("대표자를 입력 해주세요.");
	        
	    else
	        alert("Please enter a representative.");
		
		form1.txtCorp_president.focus();
		return;
	}
	
	if(form1.txtCorp_tel1.value == '') 
    {
        if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
	   	
	    form1.txtCorp_tel1.focus();
    	return;
	}
	
	if(form1.txtCorp_tel2.value == '' || form1.txtCorp_tel3.value == '') 
	{
	   	if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
    	 
	    form1.txtCorp_tel2.focus();
    	return;
	}
	
    if(isNaN(form1.txtCorp_tel1.value) == true || isNaN(form1.txtCorp_tel2.value) == true || isNaN(form1.txtCorp_tel3.value) == true)
	{
	   	if(param == "ko")
    		alert("전화번호를 숫자만 가능합니다.");
    		
    	else
	        alert("Phone number is only a number.");
	        
    	form1.txtCorp_tel1.focus();
	   	return;
	}
	
	if(form1.postnum1.value == '') 
	{
	    if(param == "ko")
	        alert("우편번호를 입력해 주세요.");
	        
	    else
	        alert("Please enter a zip code.");	        
	    
	    form1.postnum1.focus();
		return;
    }
    
    if(isNaN(form1.postnum1.value) == true)
	{
    	if(param == "ko")
	        alert("우편번호는 숫자만 가능합니다.");
	        
	    else
	        alert("Zip code numbers are available.");	  
	        
	    form1.postnum1.focus();
		return;
    }

    if(form1.postnum2.value == '') 
    {
	    if(param == "ko")
	        alert("우편번호를 입력해 주세요.");
	        
	    else
	        alert("Please enter a zip code.");	
	        
		form1.postnum2.focus();
    	return;
	}

	if(isNaN(form1.postnum2.value) == true)
    {
	    if(param == "ko")
	        alert('우편번호는 숫자만 가능합니다.');
	        
	    else
	        alert("Zip code numbers are available.");	 
	        
		form1.postnum2.focus();
    	return;
	}
	
	if(form1.address1.value == '')
	{
	    if(param == "ko") {
    		alert("주소를 입력해 주세요.");
    	}
    	else {
    	    alert("Please write your home address.");
    	}
		
		form1.address1.focus();
		return;
	}
	
    
	
    if(form1.id.value == '') 
    {
        if(param == "ko")
    		alert("아이디를 입력해 주세요.");
    		
    	else
    	    alert("Please enter the ID.");
	   	
	    form1.id.focus();
    	return;
	}
		
	if(form1.id.value.search(/^\d/) != -1 || form1.id.value.search(/[_\W]/) != -1 ||  form1.id.value.search(/[\W]/) != -1)
    {
    	alert("아이디는 영어와 숫자만 가능합니다.");
        
        form1.txtCharge_id.focus();
        return;
    }
    
    if(form1.hidId.value == "") 
	{
	    if(param == "ko")
            alert("아이디 중복검사를 해주세요.");
            
        else
            alert("Please enter the register number.");
		
		form1.txtCorp_code1.focus();
		return;
	}
    
    if(form1.pwdCharge_pass1.value.length < 4) 
    {
	    if(param == "ko")
    		alert("4자 이상인 비밀번호를 입력해 주세요.");
    		
    	else
    	    alert("Above English and number 4 letter.");
		
		form1.pwdCharge_pass1.focus();
		return;
	}
	
	if(form1.pwdCharge_pass1.value != form1.pwdCharge_pass2.value) 
	{
	    if(param == "ko")
    		alert("비밀번호가 일치하지 않습니다.");
    		
    	else
    	    alert("Please verify password.");
		
		form1.pwdCharge_pass2.focus();
		return;
	}
    

    if(form1.txtCharge_name.value == "") 
    {
	    if(param == "ko")
    		alert("담당자명을 입력 해주세요.");
    		
    	else
    	    alert("Please enter the contact name.");
    	    
	    
		form1.txtCharge_name.focus();
    	return;
    }
    
    if(form1.txtCharge_num1.value == '' || form1.txtCharge_num2.value =='') {
    	alert('주민등록번호를 입력해주세요!');
	    form1.txtCharge_num1.focus();
		return;
    }

	
	   var strregistnum1;
       var strregistnum2;
       var jumin ;
	   strregistnum1 = form1.txtCharge_num1.value;
       strregistnum2 = form1.txtCharge_num2.value;

	   jumin = strregistnum1 + strregistnum2;
	  
       var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strZ;
       var nCalA, nCalB, nCalC;
       strA = jumin.substr(0, 1); 
       strB = jumin.substr(1, 1);
       strC = jumin.substr(2, 1);
       strD = jumin.substr(3, 1);
       strE = jumin.substr(4, 1);
       strF = jumin.substr(5, 1);
       strG = jumin.substr(6, 1); 
       strH = jumin.substr(7, 1);
       strI = jumin.substr(8, 1);
       strJ = jumin.substr(9, 1);
       strK = jumin.substr(10, 1);
       strL = jumin.substr(11, 1);
       strM = jumin.substr(12, 1);
       strZ = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;
       nCalA = eval(strZ);
       nCalB = nCalA % 11;
       nCalC = 11 - nCalB;
       nCalC = nCalC % 10;
  
    if ( nCalC != strM) 
     {
    	alert ('정확한 주민등록번호 정보를 확인해주세요');
	    form1.txtCharge_num1.focus();
	
		return;
     }
    
    if(form1.txtCharge_tel1.value == '') 
    {
        if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
	   	
	    form1.txtCharge_tel1.focus();
    	return;
	}
	
	if(form1.txtCharge_tel2.value == '' || form1.txtCharge_tel3.value == '') 
	{
	   	if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
    	 
	    form1.txtCharge_tel2.focus();
    	return;
	}
	
	if(form1.txtCharge_hp1.value == '') 
    {
        if(param == "ko")
    		alert("휴대폰번호를 입력해 주세요.");
    		
    	else
    	    alert('Please write your cell phone number.');
	   	
	    form1.txtCharge_hp1.focus();
    	return;
	}
	
	if(form1.txtCharge_hp2.value == '' || form1.txtCharge_hp3.value == '') 
	{
	   	if(param == "ko")
    		alert("휴대폰번호를 입력해 주세요.");
    		
    	else
    	    alert('Please write your cell phone number.');
    	 
	    form1.txtCharge_hp2.focus();
    	return;
	}
	
     var email = form1.txtCharge_email1.value + "@" + form1.txtCharge_email2.value;

    if(form1.txtCharge_email1.value == '') 
    {
	    alert('email을 입력해 주세요!');
		form1.txtCharge_email1.focus();
    	return;
	}

    if(form1.txtCharge_email2.value == '') 
    {
        alert('email을 입력해 주세요!');
	    form1.txtCharge_email2.focus();
        return;
	}
	
	if (email =='' || email.length <= 6 || email.indexOf ('@', 0) == -1 || email.indexOf ('.', 0) == -1) 
	{
	     if(param == "ko")
    		alert("'' " + form1.txtCharge_email1.value + " '', 은 이메일주소가 아닙니다"); 
    		
    	else
    	    alert("Please write your correct e-mail address.");
	    
	    return; 
    }
    
    var _arrvisit = new Array("일본","동남아","유럽","중국","대양주","국내");
    var _visit = "";
    var _visit_txt = "";
    if(param == "ko") {
        for(i=1;i<7;i++) {
            var _objVisit = document.getElementById("visit" + i);
            if(_objVisit.checked) {
                _visit = _visit + _objVisit.value + ",";
                _visit_txt = _visit_txt + _arrvisit[i-1] + ",";
            }
        
        }
 
        document.getElementById("visit").value = _visit;
        document.getElementById("visit_str").value = _visit_txt;
    }

    if(param == "ko") 
    {
        if(confirm('회원 정보를 정확히 입력하셨습니까?'))
        {
            document.form1.action="member_05_3.aspx";
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
    else 
    {
        if(confirm('Are you sure that all information is correct?'))
        {
            document.form1.action="member_05.aspx";
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
    
}


function corp_member_insert(param) {
    document.form1.action="member_05.aspx";
	document.form1.submit();
}

function unity_ok() {
	if(!form1.agree.checked) {
		alert("회원약관에 동의 해주세요.");
		form1.agree.focus();
		return;
	}
    else
	{
	    document.form1.action="totalmembership.aspx?unity=ok&id=" + document.form1.id.value;
	    document.form1.submit();
	}
}

function unity_fail() {
    document.form1.action="totalmembership.aspx?unity=fail&id=" + document.form1.id.value;
    document.form1.submit();
}

// 주소 검색
function PostOpen() {
 	var urlname = "../member/address.aspx?hidSi_Type=B"
	window.open(urlname, "browse_org","height=300,width=450, menubar=no,directories=no,resizable=no,status=no,scrollbars=yes");
}

//////////////////////// member_checkid(pop) /////////////////////////
//////////////////////////////////////////////////////////////////////
// 부모창에 아이디값 보내기
function id_ok(div) {
    var param = document.getElementById('rtn_id').innerHTML;
    if(div == "1")
        opener.document.form1.op_id.value = param;	
	else
	    opener.document.form1.id.value = param;
	    
	if(opener.document.form1.hidId != null)
	    opener.document.form1.hidId.value = "0";
	    
	window.close();
}

// 아이디 중복 초기화
function init(id, cnt)
{
    document.all.Panel1.style.display = "none";
    document.all.Panel2.style.display = "none";
    if(id == '')
        return;
    
    //중복아이디일 경우
    if(cnt > 0)
    {
        document.all.Panel1.style.display = "";
    }    
    else
    {
        document.all.Panel2.style.display = "";
        document.all.Panel0.style.display = "none";
    }
        
    if(document.form1.m_id != null)
        document.form1.m_id.value = id;
        
    document.getElementById('rtn_id').innerHTML = id;
    
    if(document.getElementById('rtn_id2') != null)
        document.getElementById('rtn_id2').innerHTML = id;
}

//아이디 중복확인
function idCheckBtn(div,param)
{
    if(div == "2")
    {
        var corp_code = form1.txtCorp_code1.value + form1.txtCorp_code2.value + form1.txtCorp_code3.value;

        if (corp_code.length != 10) 
        {
            if(param == "ko")
                alert("사업자등록번호가 잘못되었습니다.");
                
            else
                alert("Business Registration Number is invalid.");
                
            form1.txtCorp_code1.focus();
		    return;
        }

        sumMod = 0;
        sumMod += parseInt(corp_code.substring(0,1));
        sumMod += parseInt(corp_code.substring(1,2)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(2,3)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(3,4)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(4,5)) * 3 % 10;
        sumMod += parseInt(corp_code.substring(5,6)) * 7 % 10;
        sumMod += parseInt(corp_code.substring(6,7)) * 1 % 10;
        sumMod += parseInt(corp_code.substring(7,8)) * 3 % 10;
        sumMod += Math.floor(parseInt(corp_code.substring(8,9)) * 5 / 10);
        sumMod += parseInt(corp_code.substring(8,9)) * 5 % 10;
        sumMod += parseInt(corp_code.substring(9,10));

        if (sumMod % 10 != 0) 
        {
            if(param == "ko")
                alert("사업자등록번호가 잘못되었습니다.");
                
            else
                alert("Business Registration Number is invalid.");
                
            form1.txtCorp_code1.focus();
		    return;
        }	
        
        document.form1.action = "corporate_checkid.aspx_checkid.aspx?m_id=" + form1.txtCorp_code1.value + "-" + form1.txtCorp_code2.value + "-" + form1.txtCorp_code3.value + "&div="+div + "&hidSi_Type=B";
    }
    
    else
    {
    
        if(document.form1.m_id.value == '')
        {
            if(param == "ko") {
                alert('아이디를 입력하세요.');
            }
            else {
                alert('Please fill in your ID.');
            }   
            return;
        }
    
        document.form1.action = "member_checkid.aspx?div="+div + "&hidSi_Type=B";
    }
    document.form1.submit();
}

///////////////////////// 주소 검색 창 ///////////////////////////////
//////////////////////////////////////////////////////////////////////
function zipsubmit()
{
	if (document.form1.key_name.value == "") {
		alert("지역명을 입력해주세요!");
		document.form1.key_name.focus();
		return false;
	}
	document.form1.action = "address.aspx?hidSi_Type=B";
	document.form1.submit();
}

function syncData(pzip, padd)
{
    if (opener.document.form1.postnum1 != null && opener.document.form1.postnum2 != null)
    {
        var arrPzip = pzip.split('-');
        opener.document.form1.postnum1.value = arrPzip[0];
        opener.document.form1.postnum2.value = arrPzip[1];
    }
    
    else
    {
        opener.document.form1.postnum.value = pzip; 
    }       
	
	opener.document.form1.address1.value = padd.innerHTML;
    window.close();
}

function focus(value)
{
    document.form1.key_name.value = value;
	document.form1.key_name.focus();
	
}

function enterkey()
{  
    if(event.which || event.keyCode)
    {
        if ((event.which == 13) || (event.keyCode == 13)) 
        {
            document.getElementById('btnSearch').click();
            return false;
        }
    }
    else 
    {
        return true
    }
}

///////////////////////// 등록 확인 //////////////////////////////////
//////////////////////////////////////////////////////////////////////

function checkMsg(rtnCode)
{
    if(rtnCode == '-1')
    {
        document.all.Msg1.style.display = "none";
        document.all.Msg2.style.display = "";
    }
    else
    {
        document.all.Msg1.style.display = "";
        document.all.Msg2.style.display = "none";
    }    
}

/////////////////////// 회원정보확인변경 /////////////////////////////
//////////////////////////////////////////////////////////////////////

function dataSplit(pnum, tel, moblie, fax, postnum, email, work, marriage, magaz, sms, postcheck, birthday, birthmode, marriageday, visit, travel)
{
    var nowdate = new Date();
	var year = 0;
    
    if(document.getElementById("birth_year") != null) {

	    for (i = 1 ; i < 55 ; i++) { 
		    year = nowdate.getYear() - 15 - i;

		    document.getElementById("birth_year").options[i] = new Option(year,1);
		    document.getElementById("birth_year").options[i].value = year;
    		
		    document.getElementById("marriage_year").options[i] = new Option(nowdate.getYear() - i + 1 ,1);
		    document.getElementById("marriage_year").options[i].value = nowdate.getYear() - i + 1;
	    }
    	
	    for (i = 1 ; i < 13 ; i++) { 
		    document.getElementById("birth_month").options[i] = new Option(i,1);
		    document.getElementById("birth_month").options[i].value = i;
    		
		    document.getElementById("marriage_month").options[i] = new Option(i,1);
		    document.getElementById("marriage_month").options[i].value = i;
	    }
    	
	    for (i = 1 ; i < 32 ; i++) { 
		    document.getElementById("birth_day").options[i] = new Option(i,1);
		    document.getElementById("birth_day").options[i].value = i;
    		
		    document.getElementById("marriage_day").options[i] = new Option(i,1);
		    document.getElementById("marriage_day").options[i].value = i;
	    }
    }
    
    if (document.form1.p_num1 != null && document.form1.p_num2 != null)
    {
        var arrPnum = pnum.split('-');
        document.form1.p_num1.value = arrPnum[0];  
        document.form1.p_num2.value = arrPnum[1];
    }
    
    if (document.form1.tel1 != null && document.form1.tel2 != null && document.form1.tel3 != null)
    {
        var arrTel = tel.split('-');
        document.form1.tel1.value = arrTel[0];
        document.form1.tel2.value = arrTel[1];
        document.form1.tel3.value = arrTel[2];
    }

    if (document.form1.mobile1 != null && document.form1.mobile2 != null && document.form1.mobile3 != null)
    {
        var arrMobile = moblie.split('-');
        document.form1.mobile1.value = arrMobile[0];
        document.form1.mobile2.value = arrMobile[1];
        document.form1.mobile3.value = arrMobile[2];
    }

    if (document.form1.fax1 != null && document.form1.fax2 != null && document.form1.fax3 != null)
    {
        var arrFax = fax.split('-');
        document.form1.fax1.value = arrFax[0];
        document.form1.fax2.value = arrFax[1];
        document.form1.fax3.value = arrFax[2];
    }
    
    if (document.form1.postnum1 != null && document.form1.postnum2 != null)
    {
        var arrpostnum = postnum.split('-');
        document.form1.postnum1.value = arrpostnum[0];
        document.form1.postnum2.value = arrpostnum[1];
    }
    
    if (document.form1.email1 != null && document.form1.email2 != null)
    {
        var arremail = email.split('@');
        document.form1.email1.value = arremail[0];
        document.form1.email2.value = arremail[1];
        
        for(i = 0 ; i < document.form1.email_type.options.length; i++)
        {
            if(document.form1.email_type.options[i].value == arremail[1])
            { 
                document.form1.email_type.options[i].selected = true;
                break;
            }
        } 
        
        if(document.form1.email_type.value != '')
        {
            document.form1.email2.value = document.form1.email_type.value;
            document.form1.email2.readOnly = true;
        }
            
        else
            document.form1.email2.readOnly = false;
    }
    
    for(i = 0 ; i < document.getElementsByName("magazine").length; i++)
    {
        if(document.getElementsByName("magazine")[i].value == magaz)
        {         
            document.getElementsByName("magazine")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("marriage").length; i++)
    {
        if(document.getElementsByName("marriage")[i].value == marriage)
        { 
            document.getElementsByName("marriage")[i].checked = true;
            break;
        }
    }
        
    for(i = 0 ; i < document.form1.work.options.length; i++)
    {
        if(document.form1.work.options[i].value == work)
        { 
            document.form1.work.options[i].selected = true;
            break;
        }
    }  
    
    for(i = 0 ; i < document.getElementsByName("sms").length; i++)
    {
        if(document.getElementsByName("sms")[i].value == sms)
        { 
            document.getElementsByName("sms")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("post").length; i++)
    {
        if(document.getElementsByName("post")[i].value == postcheck)
        { 
            document.getElementsByName("post")[i].checked = true;
            break;
        }
    }
    
    if (document.form1.birth_year != null && document.form1.birth_month != null && document.form1.birth_day != null)
    {
        var arrBirth = birthday.split('-');
        document.form1.birth_year.value = parseInt(arrBirth[0]);
        document.form1.birth_month.value = parseInt(arrBirth[1]);
        document.form1.birth_day.value = parseInt(arrBirth[2]);
    }
    
    for(i = 0 ; i < document.getElementsByName("birth_mode").length; i++)
    {
        if(document.getElementsByName("birth_mode")[i].value == birthmode)
        { 
            document.getElementsByName("birth_mode")[i].checked = true;
            break;
        }
    }
    
    if (document.form1.marriage_year != null && document.form1.marriage_month != null && document.form1.marriage_day != null)
    {
        var arrMarriage = marriageday.split('-');
        document.form1.marriage_year.value = parseInt(arrMarriage[0]);
        document.form1.marriage_month.value = parseInt(arrMarriage[1]);
        document.form1.marriage_day.value = parseInt(arrMarriage[2]);
    }
    
    if(document.form1.visit1 != null) {
        var arrVisit = visit.split(',');
        for(j = 0 ; j < arrVisit.length ; j++) {
            for(i = 1 ; i < 7; i++)
            {
                var objVisit = document.getElementById("visit" + i);
                if(objVisit.value == arrVisit[j])
                { 
                    objVisit.checked = true;
                    break;
                }
            }
        }
    }
    
    if(document.form1.travel1 != null) {
        var arrTravel = travel.split(',');
        for(j = 0 ; j < arrTravel.length ; j++) {
            for(i = 1 ; i < 10; i++)
            {
                var objTravel = document.getElementById("travel" + i);
                if(objTravel.value == arrTravel[j])
                { 
                    objTravel.checked = true;
                    break;
                }
            }
        }
    }
    
    if (document.form1.postnum1 != null && document.form1.postnum2 != null)
    {
        var arrpostnum = postnum.split('-');
        document.form1.postnum1.value = arrpostnum[0];
        document.form1.postnum2.value = arrpostnum[1];
    }      
}

// 유효성 체크(수정)
function memberModify() {
	if(form1.k_name.value == "") {
		alert("한글이름을 입력 해주세요.");
		form1.k_name.focus();
		return;
	}
	if(form1.e_name.value == "") {
		alert("영문이름을 입력 해주세요.");
		form1.e_name.focus();
		return;
	}
	if(form1.pass1.value == "") {
		alert("비밀번호를 입력 해주세요.");
		form1.pass1.focus();
		return;
	}
	if(form1.pass1.value.length < 4) {
		alert("4자 이상인 비밀번호를 입력해 주세요.");
		form1.pass1.focus();
		return;
	}
	if(form1.pass1.value != form1.pass2.value) {
		alert("비밀번호가 일치하지 않습니다.");
		form1.pass1.focus();
		return;
	}
	
	var email = form1.email1.value + "@" + form1.email2.value;
	
	if(form1.email1.value == '') {
		alert('email을 입력해 주세요!');
		form1.email1.focus();
		return;
	}
	if(form1.email2.value == '') {
		alert('email을 입력해 주세요!');
		form1.email2.focus();
		return;
	}
	if (email =='' || email.length <= 6 || email.indexOf ('@', 0) == -1 || email.indexOf ('.', 0) == -1) {
	        alert("'' " + email + " '', 은 이메일주소가 아닙니다"); 
	        return; 
    }
	if(form1.tel1.value == '') {
		alert('전화번호를 입력해 주세요!');
		form1.tel1.focus();
		return;
	}
	if(form1.tel2.value == '' || form1.tel3.value == '') {
		alert('전화번호를 입력해 주세요!');
		form1.tel2.focus();
		return;
	}
	if(form1.postnum1.value == '') {
		alert('우편번호를 입력해 주세요!');
		form1.postnum1.focus();
		return;
	}
	if(form1.postnum2.value == '') {
		alert('우편번호를 입력해 주세요!');
		form1.postnum2.focus();
		return;
	}
	if(form1.address1.value == '') {
		alert('주소를 입력해 주세요!');
		form1.address1.focus();
		return;
	}
	if(form1.magazine.checked) form1.magazine.value = "1";
	else form1.magazine.value = "0";
	
	var _visit = "";
    var _travel = "";
	for(i=1;i<7;i++) {
        var _objVisit = document.getElementById("visit" + i);
        if(_objVisit.checked) {
            _visit = _visit + _objVisit.value + ",";
        }
    
    }
    for(i=1;i<10;i++) {
        var _objTravel = document.getElementById("travel" + i);
        if(_objTravel.checked) {
            _travel = _travel + _objTravel.value + ",";
        }
    
    }   
    
    document.getElementById("visit").value = _visit;
    document.getElementById("travel").value = _travel;

    if(confirm('회원 정보를 변경하시겠습니까?'))
    {
	    document.form1.action="member_02.aspx";
	    document.form1.submit();
	}
	else
	{
	    return;
	}
}

///////////////////// 회원 아이디/ 비밀번호 찾기//////////////////////
//////////////////////////////////////////////////////////////////////

function search_change(no)
{
    if(no == '1')
    {
        document.all.id_search.style.display = "";
        document.all.pass_search.style.display = "none";
    }else
    {
        document.all.id_search.style.display = "none";
        document.all.pass_search.style.display = "";

    }
}

function id_search(param)
{
	if(form1.k_name.value == "") {
	    if(param == "ko") {
		    alert("이름을 입력 해주세요.");
		}
		else {
		    alert("Please write your name.");
		}
		form1.k_name.focus();
		return;
	}
    if(param == "ko") {
    	if(form1.i_num1.value == "") {
	    	alert("주민번호를 입력 해주세요.");
		    form1.i_num1.focus();
    		return;
	    }
	
    	if(form1.i_num2.value == "") {
	    	alert("주민번호를 제대로 입력 해주세요.");
		    form1.i_num2.focus();
    		return;
	    }
	}
	else {
	    if(form1.i_email.value == "") {
	        if(param == "ko") {
		        alert("이메일 주소를 입력 해주세요.");
    		}
	    	else {
		        alert("Please write your correct e-mail address.");
    		}
    		
	    	form1.i_email.focus();
		    return;
    	}
	}	
		
    form1.action="member_04.aspx?ip_search=1";
    form1.submit();        
}

function pass_search(param)
{
	if(form1.id2.value == "") {
		if(param == "ko") {
		    alert("아이디를 입력 해주세요.");
		}
		else {
		    alert("Please write your ID.");
		}
		form1.id2.focus();
		return;
	}

    if(param == "ko") {
    	if(form1.p_num1.value == "") {
	    	alert("주민번호를 입력 해주세요.");
		    form1.p_num1.focus();
    		return;
	    }
	
    	if(form1.p_num2.value == "") {
	    	alert("주민번호를 제대로 입력 해주세요.");
		    form1.p_num2.focus();
    		return;
	    }	
	}
	else {
	    if(form1.p_email.value == "") {
	        if(param == "ko") {
		        alert("이메일 주소를 입력 해주세요.");
    		}
	    	else {
		        alert("Please write your correct e-mail address.");
    		}
    		
	    	form1.p_email.focus();
		    return;
    	}
	}	
		
    form1.action="member_04.aspx?ip_search=2";
    form1.submit();    
}

function id_check(m_id, m_email, m_div, sitelang)
{
    //아이디 체크
    if(m_div == '1')
    {
        if(m_id != '')
        {
            document.all.main.style.display = "none";
            document.all.result1.style.display = "";
        }
        else
        {
            if(sitelang == "ko") {
                alert('회원 정보가 일치 하지않습니다.');
            }
            else {
                alert('Invalid Information');
            }
            document.all.main.style.display = "";
            document.all.result1.style.display = "none";

            return;
        }
    }
    else if(m_div =="2")
    {
        if(m_email != '')
        {
            document.all.main.style.display = "none";
            document.all.result2.style.display = "";

        }
        else
        {    
            if(sitelang == "ko") {
                alert('회원 정보가 일치 하지않습니다.');
            }
            else {
                alert('Invalid Information');
            }
            document.all.main.style.display = "";
            document.all.result2.style.display = "none";
            
            return;
        }    
    }
    else
    {
            document.all.main.style.display = "";
            document.all.result2.style.display = "none";
    }
}

 function check_focus()
 {
    var div = document.all.ip_search[0].checked;
    
    if(div)
    {
        if(form2.i_num1.value.length == 6)
            form2.i_num2.focus();
    }
    else
    {
        if(form2.p_num1.value.length == 6)
            form2.p_num2.focus();    
    }    
 }
 
 function memberout_check() {
 
    if(document.form1.user_id.value == '') 
    {
        alert('패스워드를 입력해주세요\n');
        document.form1.user_id.focus();
        return;
    }

    if(document.form1.user_pw.value == '') 
    {
        alert('패스워드를 입력해주세요\n');
        document.form1.user_pw.focus();
        return;
    }
    
    document.form1.action = "member_out_complete.aspx"
    document.form1.submit(); 	
}

function check_rst(div)
{
    if(div == 'N')
    {
        alert('패스워드를 확인해주세요\n');
    }
}

function email_select()
{   

    document.form1.email2.value = document.form1.email_type.value;
    
    if (document.form1.email_type.value != '')
        document.form1.email2.readOnly = true;
        
    else
        document.form1.email2.readOnly = false;
}

function free_tour_submit()
{
    if(document.form1.s_date.value == "")
    {
	    alert("출발일을 입력해주세요")
	    document.form1.s_date.focus();
	    return;
    }
	
    if(document.form1.chk_hotel.value == "")
    {
	    alert("호텔을 입력해주세요")
	    document.form1.chk_hotel.focus();
	    return;
    }
	
    if(document.form1.RESERV_NAME.value == "")
    {
	    alert("예약자 이름을 입력해주세요")
	    document.form1.RESERV_NAME.focus();
	    return;
    }
	
    if(document.form1.RESERV_TEL_NUM.value == "")
    {
	    alert("예약자 전화번호를 입력해주세요")
	    document.form1.RESERV_TEL_NUM.focus();
	    return;
    }
	
    if(isNaN(document.form1.RESERV_TEL_NUM.value) == true)
    {
	    alert("전화번호는 숫자만 가능합니다.");
	    document.form1.RESERV_TEL_NUM.focus();
	    return;
    }
	
    if(document.form1.RESERV_ID_NUM1.value == "")
    {
	    alert("예약자 주민등록번호를 입력해주세요")
	    document.form1.RESERV_ID_NUM1.focus();
	    return;
    }
	
    if(isNaN(document.form1.RESERV_ID_NUM1.value) == true)
    {
	    alert("주민등록번호는 숫자만 가능합니다.");
	    document.form1.RESERV_ID_NUM1.focus();
	    return;
    }
	
    if(document.form1.RESERV_ID_NUM2.value == "")
    {
	    alert("예약자 주민등록번호를 입력해주세요")
	    document.form1.RESERV_ID_NUM2.focus();
	    return;
    }
	
    if(isNaN(document.form1.RESERV_ID_NUM2.value) == true)
    {
	    alert("주민등록번호는 숫자만 가능합니다.");
	    document.form1.RESERV_ID_NUM2.focus();
	    return;
    }
	
    var strregistnum1;
    var strregistnum2;
    var jumin ;
    strregistnum1 = form1.RESERV_ID_NUM1.value;
    strregistnum2 = form1.RESERV_ID_NUM2.value;

    jumin = strregistnum1 + strregistnum2;

    var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strZ;
    var nCalA, nCalB, nCalC;
    strA = jumin.substr(0, 1); 
    strB = jumin.substr(1, 1);
    strC = jumin.substr(2, 1);
    strD = jumin.substr(3, 1);
    strE = jumin.substr(4, 1);
    strF = jumin.substr(5, 1);
    strG = jumin.substr(6, 1); 
    strH = jumin.substr(7, 1);
    strI = jumin.substr(8, 1);
    strJ = jumin.substr(9, 1);
    strK = jumin.substr(10, 1);
    strL = jumin.substr(11, 1);
    strM = jumin.substr(12, 1);
    strZ = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;
    nCalA = eval(strZ);
    nCalB = nCalA % 11;
    nCalC = 11 - nCalB;
    nCalC = nCalC % 10;
    if ( nCalC != strM) 
    {
	    alert ("정확한 주민등록번호 정보를 확인해주세요");
	    form1.RESERV_ID_NUM1.focus();

    return;
    }
	
    if(document.form1.RESERV_EMAIL.value == "")
    {
	    alert("예약자 메일을 입력해주세요")
	    document.form1.RESERV_EMAIL.focus();
	    return;
    }
	
    var sum_email = document.form1.RESERV_EMAIL.value;
	
    if (sum_email =="" || sum_email.length <= 6 || sum_email.indexOf ("@", 0) == -1 || sum_email.indexOf (".", 0) == -1) 
    {
		   alert(sum_email + "은 이메일주소가 아닙니다"); 
	       return; 
    }
	
    if(document.form1.postnum.value == "")
    {
	    alert("예약자 우편번호를 입력해주세요")
	    document.form1.postnum1.focus();
	    return;
    }
	
    if(document.form1.address1.value == "")
    {
	    alert("예약자 주소를 입력해주세요")
	    document.form1.address1.focus();
	    return;
    }
	
    if(document.form1.CUSTOM1_K_NAME.value == "")
    {
	    alert("숙박자 한글이름을 입력해주세요")
	    document.form1.CUSTOM1_K_NAME.focus();
	    return;
    }
	
    if(document.form1.CUSTOM1_E_NAME1.value == "")
    {
	    alert("숙박자 영어이름을 입력해주세요")
	    document.form1.CUSTOM1_E_NAME1.focus();
	    return;
    }
	
    if(document.form1.CUSTOM1_E_NAME2.value == "")
    {
	    alert("숙박자 영어이름을 입력해주세요")
	    document.form1.CUSTOM1_E_NAME2.focus();
	    return;
    }
	
    if(document.form1.CUSTOM1_SN1.value == "")
    {
	    alert("숙박자 주민등록번호를 입력해주세요")
	    document.form1.CUSTOM1_SN1.focus();
	    return;
    }
	
    if(isNaN(document.form1.CUSTOM1_SN1.value) == true)
    {
	    alert("주민등록번호는 숫자만 가능합니다.");
	    document.form1.CUSTOM1_SN1.focus();
	    return;
    }
	
    if(document.form1.CUSTOM1_SN2.value == "")
    {
	    alert("숙박자 주민등록번호를 입력해주세요")
	    document.form1.CUSTOM1_SN2.focus();
	    return;
    }
	
    if(isNaN(document.form1.CUSTOM1_SN2.value) == true)
    {
	    alert("주민등록번호는 숫자만 가능합니다.");
	    document.form1.CUSTOM1_SN2.focus();
	    return;
    }
	
    var strregistnum1;
    var strregistnum2;
    var jumin ;
    strregistnum1 = form1.CUSTOM1_SN1.value;
    strregistnum2 = form1.CUSTOM1_SN2.value;

    jumin = strregistnum1 + strregistnum2;

    var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strZ;
    var nCalA, nCalB, nCalC;
    strA = jumin.substr(0, 1); 
    strB = jumin.substr(1, 1);
    strC = jumin.substr(2, 1);
    strD = jumin.substr(3, 1);
    strE = jumin.substr(4, 1);
    strF = jumin.substr(5, 1);
    strG = jumin.substr(6, 1); 
    strH = jumin.substr(7, 1);
    strI = jumin.substr(8, 1);
    strJ = jumin.substr(9, 1);
    strK = jumin.substr(10, 1);
    strL = jumin.substr(11, 1);
    strM = jumin.substr(12, 1);
    strZ = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;
    nCalA = eval(strZ);
    nCalB = nCalA % 11;
    nCalC = 11 - nCalB;
    nCalC = nCalC % 10;
    if ( nCalC != strM) 
    {
	    alert ("정확한 주민등록번호 정보를 확인해주세요");
	    form1.RESERV_ID_NUM1.focus();

    return;
    }
	
    if(document.form1.CUSTOM1_TEL_NUM.value == "")
    {
	    alert("숙박자 전화번호을 입력해주세요")
	    document.form1.CUSTOM1_TEL_NUM.focus();
	    return;
    }
	
    if(isNaN(document.form1.CUSTOM1_TEL_NUM.value) == true)
    {
	    alert("주민등록번호는 숫자만 가능합니다.");
	    document.form1.CUSTOM1_TEL_NUM.focus();
	    return;
    }
	
    if(confirm("Do you want to register?"))
    {
	    document.form1.action="freetour_revation_complete.aspx";
	    document.form1.submit();
    }
    else
    {
	    return;
    }
}

function input_check(id, num1, num2)
{
    if(document.getElementById(id + num1).value.length == num2)
        document.getElementById(id + (num1 + 1)).focus();
}

// 아이디 중복 초기화
function corporate_init(cnt, regi_no, id, name, tel, fax, addr, president, homepage)
{
    document.all.Panel1.style.display = "none";
    document.all.Panel2.style.display = "none";
    if(id == '')
        return;
    
    //중복아이디일 경우
    if(cnt > 0)
    {
        document.all.Panel1.style.display = "";
    }    
    else
    {
        document.all.Panel2.style.display = "";
        document.all.Panel0.style.display = "none";
    }
        
    opener.document.form1.txtCorp_id.value = id;
    opener.document.form1.hidCorp_code.value = "0";
//    opener.document.form1.txtCorp_code1.value = "";
//    opener.document.form1.txtCorp_code2.value = "";
//    opener.document.form1.txtCorp_code3.value = "";        
//    opener.document.form1.txtCorp_name.value = "";    
//    opener.document.form1.txtCorp_president.value = "";
//    opener.document.form1.txtCorp_tel1.value = "";
//    opener.document.form1.txtCorp_tel2.value = "";
//    opener.document.form1.txtCorp_tel3.value = "";
//    opener.document.form1.txtCorp_fax1.value = "";
//    opener.document.form1.txtCorp_fax2.value = "";
//    opener.document.form1.txtCorp_fax3.value = "";
//    opener.document.form1.postnum1.value = "";
//    opener.document.form1.postnum2.value = "";
//    opener.document.form1.address1.value = "";
//    opener.document.form1.address2.value = "";
//    opener.document.form1.txtCorp_homepage.value = "";
    
    if(regi_no != "")
    {
        opener.document.form1.txtCorp_code1.value = regi_no.split('-')[0];
        opener.document.form1.txtCorp_code2.value = regi_no.split('-')[1];
        opener.document.form1.txtCorp_code3.value = regi_no.split('-')[2];      
        opener.document.form1.txtCorp_name.value = name;    
        opener.document.form1.txtCorp_president.value = president;
        opener.document.form1.txtCorp_tel1.value = tel.split('-')[0];
        opener.document.form1.txtCorp_tel2.value = tel.split('-')[1];
        opener.document.form1.txtCorp_tel3.value = tel.split('-')[2];
        opener.document.form1.txtCorp_fax1.value = fax.split('-')[0];
        opener.document.form1.txtCorp_fax2.value = fax.split('-')[1];
        opener.document.form1.txtCorp_fax3.value = fax.split('-')[2];
        opener.document.form1.postnum1.value = addr.split(':')[0].split('-')[0];
        opener.document.form1.postnum2.value = addr.split(':')[0].split('-')[1];
        opener.document.form1.address1.value = addr.split(':')[1].split('  ')[0];
        opener.document.form1.address2.value = addr.split(':')[1].split('  ')[1];
        opener.document.form1.txtCorp_homepage.value = homepage;
        
        opener.document.form1.txtCorp_name.readOnly = true;
        opener.document.form1.txtCorp_president.readOnly = true;
        opener.document.form1.txtCorp_tel1.readOnly = true;
        opener.document.form1.txtCorp_tel2.readOnly = true;
        opener.document.form1.txtCorp_tel3.readOnly = true;
        opener.document.form1.txtCorp_fax1.readOnly = true;
        opener.document.form1.txtCorp_fax2.readOnly = true;
        opener.document.form1.txtCorp_fax3.readOnly = true;
        opener.document.form1.postnum1.readOnly = true;
        opener.document.form1.postnum2.readOnly = true;
        opener.document.form1.address1.readOnly = true;
        opener.document.form1.address2.readOnly = true;
        opener.document.form1.txtCorp_homepage.readOnly = true;
    }
    
    else
    {
        opener.document.form1.txtCorp_code1.readOnly = false;
        opener.document.form1.txtCorp_code2.readOnly = false;
        opener.document.form1.txtCorp_code3.readOnly = false;
        opener.document.form1.txtCorp_name.readOnly = false;
        opener.document.form1.txtCorp_president.readOnly = false;
        opener.document.form1.txtCorp_tel1.readOnly = false;
        opener.document.form1.txtCorp_tel2.readOnly = false;
        opener.document.form1.txtCorp_tel3.readOnly = false;
        opener.document.form1.txtCorp_fax1.readOnly = false;
        opener.document.form1.txtCorp_fax2.readOnly = false;
        opener.document.form1.txtCorp_fax3.readOnly = false;
        opener.document.form1.postnum1.readOnly = false;
        opener.document.form1.postnum2.readOnly = false;
        opener.document.form1.address1.readOnly = false;
        opener.document.form1.address2.readOnly = false;
        opener.document.form1.txtCorp_homepage.readOnly = false;
    }

        
    document.getElementById('rtn_id').innerHTML = id;
    
    if(document.getElementById('rtn_id2') != null)
        document.getElementById('rtn_id2').innerHTML = id;
}

function corp_id_check(id)
{
    document.getElementById("hid" + id).value = "";
}



function CorpdataSplit(pnum, tel, moblie, email, marriage, magaz, sms, postcheck, birthday, birthmode, marriageday, visit)
{
    var nowdate = new Date();
	var year = 0;
    
    if(document.getElementById("birth_year") != null) {

	    for (i = 1 ; i < 55 ; i++) { 
		    year = nowdate.getYear() - 15 - i;

		    document.getElementById("birth_year").options[i] = new Option(year,1);
		    document.getElementById("birth_year").options[i].value = year;
    		
		    document.getElementById("marriage_year").options[i] = new Option(nowdate.getYear() - i + 1 ,1);
		    document.getElementById("marriage_year").options[i].value = nowdate.getYear() - i + 1;
	    }
    	
	    for (i = 1 ; i < 13 ; i++) { 
		    document.getElementById("birth_month").options[i] = new Option(i,1);
		    document.getElementById("birth_month").options[i].value = i;
    		
		    document.getElementById("marriage_month").options[i] = new Option(i,1);
		    document.getElementById("marriage_month").options[i].value = i;
	    }
    	
	    for (i = 1 ; i < 32 ; i++) { 
		    document.getElementById("birth_day").options[i] = new Option(i,1);
		    document.getElementById("birth_day").options[i].value = i;
    		
		    document.getElementById("marriage_day").options[i] = new Option(i,1);
		    document.getElementById("marriage_day").options[i].value = i;
	    }
    }
    
    if (document.form1.txtCharge_num1 != null && document.form1.txtCharge_num2 != null)
    {
        var arrPnum = pnum.split('-');
        document.form1.txtCharge_num1.value = arrPnum[0];  
        document.form1.txtCharge_num2.value = arrPnum[1];
    }
    
    if (document.form1.txtCharge_tel1 != null && document.form1.txtCharge_tel2 != null && document.form1.txtCharge_tel3 != null)
    {
        var arrTel = tel.split('-');
        document.form1.txtCharge_tel1.value = arrTel[0];
        document.form1.txtCharge_tel2.value = arrTel[1];
        document.form1.txtCharge_tel3.value = arrTel[2];
    }

    if (document.form1.txtCharge_hp1 != null && document.form1.txtCharge_hp2 != null && document.form1.txtCharge_hp3 != null)
    {
        var arrMobile = moblie.split('-');
        document.form1.txtCharge_hp1.value = arrMobile[0];
        document.form1.txtCharge_hp2.value = arrMobile[1];
        document.form1.txtCharge_hp3.value = arrMobile[2];
    }

    if (document.form1.txtCharge_email1 != null && document.form1.txtCharge_email2 != null)
    {
        var arremail = email.split('@');
        document.form1.txtCharge_email1.value = arremail[0];
        document.form1.txtCharge_email2.value = arremail[1];
        
        for(i = 0 ; i < document.form1.email_type.options.length; i++)
        {
            if(document.form1.email_type.options[i].value == arremail[1])
            { 
                document.form1.email_type.options[i].selected = true;
                break;
            }
        } 
        
        if(document.form1.email_type.value != '')
        {
            document.form1.txtCharge_email2.value = document.form1.email_type.value;
            document.form1.txtCharge_email2.readOnly = true;
        }
            
        else
            document.form1.txtCharge_email2.readOnly = false;
    }
    
    for(i = 0 ; i < document.getElementsByName("magazine").length; i++)
    {
        if(document.getElementsByName("magazine")[i].value == magaz)
        {         
            document.getElementsByName("magazine")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("marriage").length; i++)
    {
        if(document.getElementsByName("marriage")[i].value == marriage)
        { 
            document.getElementsByName("marriage")[i].checked = true;
            break;
        }
    }

    
    for(i = 0 ; i < document.getElementsByName("sms").length; i++)
    {
        if(document.getElementsByName("sms")[i].value == sms)
        { 
            document.getElementsByName("sms")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("post").length; i++)
    {
        if(document.getElementsByName("post")[i].value == postcheck)
        { 
            document.getElementsByName("post")[i].checked = true;
            break;
        }
    }
    
    if (document.form1.birth_year != null && document.form1.birth_month != null && document.form1.birth_day != null)
    {
        var arrBirth = birthday.split('-');
        document.form1.birth_year.value = parseInt(arrBirth[0]);
        document.form1.birth_month.value = parseInt(arrBirth[1]);
        document.form1.birth_day.value = parseInt(arrBirth[2]);
    }
    
    for(i = 0 ; i < document.getElementsByName("birth_mode").length; i++)
    {
        if(document.getElementsByName("birth_mode")[i].value == birthmode)
        { 
            document.getElementsByName("birth_mode")[i].checked = true;
            break;
        }
    }
    
    if (document.form1.marriage_year != null && document.form1.marriage_month != null && document.form1.marriage_day != null)
    {
        var arrMarriage = marriageday.split('-');
        document.form1.marriage_year.value = parseInt(arrMarriage[0]);
        document.form1.marriage_month.value = parseInt(arrMarriage[1]);
        document.form1.marriage_day.value = parseInt(arrMarriage[2]);
    }
    
    if(document.form1.visit1 != null) {
        var arrVisit = visit.split(',');
        for(j = 0 ; j < arrVisit.length ; j++) {
            for(i = 1 ; i < 7; i++)
            {
                var objVisit = document.getElementById("visit" + i);
                if(objVisit.value == arrVisit[j])
                { 
                    objVisit.checked = true;
                    break;
                }
            }
        }
    }

    if (document.form1.postnum1 != null && document.form1.postnum2 != null)
    {
        var arrpostnum = postnum.split('-');
        document.form1.postnum1.value = arrpostnum[0];
        document.form1.postnum2.value = arrpostnum[1];
    }      
}




// 유효성 체크(수정)
function Corp_Modify(param) {    
    if(form1.pwdCharge_pass1.value.length < 4) 
    {
	    if(param == "ko")
    		alert("4자 이상인 비밀번호를 입력해 주세요.");
    		
    	else
    	    alert("Above English and number 4 letter.");
		
		form1.pwdCharge_pass1.focus();
		return;
	}
	
	if(form1.pwdCharge_pass1.value != form1.pwdCharge_pass2.value) 
	{
	    if(param == "ko")
    		alert("비밀번호가 일치하지 않습니다.");
    		
    	else
    	    alert("Please verify password.");
		
		form1.pwdCharge_pass2.focus();
		return;
	}
    

    if(form1.txtCharge_name.value == "") 
    {
	    if(param == "ko")
    		alert("담당자명을 입력 해주세요.");
    		
    	else
    	    alert("Please enter the contact name.");
    	    
	    
		form1.txtCharge_name.focus();
    	return;
    }
    
    if(form1.txtCharge_tel1.value == '') 
    {
        if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
	   	
	    form1.txtCharge_tel1.focus();
    	return;
	}
	
	if(form1.txtCharge_tel2.value == '' || form1.txtCharge_tel3.value == '') 
	{
	   	if(param == "ko")
    		alert("전화번호를 입력해 주세요.");
    		
    	else
    	    alert("Please enter your phone number.");
    	 
	    form1.txtCharge_tel2.focus();
    	return;
	}
	
	if(form1.txtCharge_hp1.value == '') 
    {
        if(param == "ko")
    		alert("휴대폰번호를 입력해 주세요.");
    		
    	else
    	    alert('Please write your cell phone number.');
	   	
	    form1.txtCharge_hp1.focus();
    	return;
	}
	
	if(form1.txtCharge_hp2.value == '' || form1.txtCharge_hp3.value == '') 
	{
	   	if(param == "ko")
    		alert("휴대폰번호를 입력해 주세요.");
    		
    	else
    	    alert('Please write your cell phone number.');
    	 
	    form1.txtCharge_hp2.focus();
    	return;
	}
	
     var email = form1.txtCharge_email1.value + "@" + form1.txtCharge_email2.value;

    if(form1.txtCharge_email1.value == '') 
    {
	    alert('email을 입력해 주세요!');
		form1.txtCharge_email1.focus();
    	return;
	}

    if(form1.txtCharge_email2.value == '') 
    {
        alert('email을 입력해 주세요!');
	    form1.txtCharge_email2.focus();
        return;
	}
		
    if(param == "ko") 
    {
        var _visit = "";
        for(i=1;i<7;i++) {
            var _objVisit = document.getElementById("visit" + i);
            if(_objVisit.checked) {
                _visit = _visit + _objVisit.value + ",";
            }
        
        }
    
        if(confirm('회원 정보를 정확히 입력하셨습니까?'))
        {
            document.form1.action="member_03.aspx";
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
    else 
    {
        if(confirm('Are you sure that all information is correct?'))
        {
            document.form1.action="member_03.aspx";
	        document.form1.submit();
    	}
	    else
    	{
	        return;
    	}
    }
}

function setData(work, marriage, magaz, sms, postcheck, birthmode, visit, travel)
{    
    for(i = 0 ; i < document.getElementsByName("magazine").length; i++)
    {
        if(document.getElementsByName("magazine")[i].value == magaz)
        {         
            document.getElementsByName("magazine")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("marriage").length; i++)
    {
        if(document.getElementsByName("marriage")[i].value == marriage)
        { 
            document.getElementsByName("marriage")[i].checked = true;
            break;
        }
    }
        
    for(i = 0 ; i < document.form1.work.options.length; i++)
    {
        if(document.form1.work.options[i].value == work)
        { 
            document.form1.work.options[i].selected = true;
            break;
        }
    }  
    
    for(i = 0 ; i < document.getElementsByName("sms").length; i++)
    {
        if(document.getElementsByName("sms")[i].value == sms)
        { 
            document.getElementsByName("sms")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("post").length; i++)
    {
        if(document.getElementsByName("post")[i].value == postcheck)
        { 
            document.getElementsByName("post")[i].checked = true;
            break;
        }
    }
    
    for(i = 0 ; i < document.getElementsByName("birth_mode").length; i++)
    {
        if(document.getElementsByName("birth_mode")[i].value == birthmode)
        { 
            document.getElementsByName("birth_mode")[i].checked = true;
            break;
        }
    }
    
    if(document.form1.visit1 != null) {
        var arrVisit = visit.split(',');
        for(j = 0 ; j < arrVisit.length ; j++) {
            for(i = 1 ; i < 7; i++)
            {
                var objVisit = document.getElementById("visit" + i);
                if(objVisit.value == arrVisit[j])
                { 
                    objVisit.checked = true;
                    break;
                }
            }
        }
    }
    
    if(document.form1.travel1 != null) {
        var arrTravel = travel.split(',');
        for(j = 0 ; j < arrTravel.length ; j++) {
            for(i = 1 ; i < 10; i++)
            {
                var objTravel = document.getElementById("travel" + i);
                if(objTravel.value == arrTravel[j])
                { 
                    objTravel.checked = true;
                    break;
                }
            }
        }
    }   
}
