﻿////////////////////////////////////////////////////////////////////
// 메인 페이지 업소 가입 페이지 폼 체크
////////////////////////////////////////////////////////////////////
var MasterPath = "ctl00_cphMain_";        // 업소가입 페이지의 ID Path.

function venderRegistrationCheckForm()
{   
        // 업소 이름 체크 루틴
        if (isEmpty(MasterPath + 'txtLodgingNameEng') == false)
        {
            alert("업소 이름을 입력해 주세요");
            document.getElementById(MasterPath + 'txtLodgingNameEng').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtLodgingNameKor') == false)
        {
            alert("업소 한글 이름을 입력해 주세요");
            document.getElementById(MasterPath + 'txtLodgingNameKor').focus();
            return false;
        }
        
        // 업소 형태 체크 루틴
        if (document.getElementById(MasterPath + 'ddlLodgingCategory').value == -1)
        {
            alert("업소 형태를 선택해 주세요");
            document.getElementById(MasterPath + 'ddlLodgingCategory').focus();
            return false;
        }
        
        // 국가 선택 체크 루틴
        if (document.getElementById(MasterPath + 'reg_ddlCountryList').value == 0)
        {
            alert("국가를 선택해 주세요");
            document.getElementById(MasterPath + 'reg_ddlCountryList').focus();
            return false;
        }
        
        // 도시 선택 체크 루틴
        if (document.getElementById(MasterPath + 'reg_ddlCityList').value == 0)
        {
            alert("도시를 선택해 주세요");
            document.getElementById(MasterPath + 'reg_ddlCityList').focus();
            return false;
        }
        
        // 업소 주소 1 체크 루틴
        if (isEmpty(MasterPath + 'txtAddress1') == false)
        {
            alert("업소 주소를 입력해 주세요.");
            document.getElementById(MasterPath + 'txtAddress1').focus();
            return false;
        }  
        
        // 우편번호 체크 루틴
        if (isEmpty(MasterPath + 'txtZipCode') == false)
        {
            alert("우편번호를 입력해 주세요.");
            document.getElementById(MasterPath + 'txtZipCode').focus();
            return false;
        }  
        
        // 업소 전화번호 체크 루틴
        if (isEmpty(MasterPath + 'txtPhoneNum') == false)
        {
            alert("업소 전화번호를 입력해 주세요.");
            document.getElementById(MasterPath + 'txtPhoneNum').focus();
            return false;
        }
        else if(chkPhoneNum(MasterPath + 'txtPhoneNum') == false)
        {
            alert("업소 전화번호 형식이 올바르지 않습니다.\n다시 입력해 주세요");
            document.getElementById(MasterPath + 'txtPhoneNum').focus();
            return false;
        } 

        //한국내 연락번호 체크 루틴
        if(chkPhoneNum(MasterPath + 'txtPhoneNumKor') == false)
        {
            alert("한국내 전화번호 형식이 올바르지 않습니다.\n다시 입력해 주세요");
            document.getElementById(MasterPath + 'txtPhoneNumKor').focus();
            return false;
        } 

        // 팩스 번호 체크 루틴
        if(chkPhoneNum(MasterPath + 'txtFaxNum') == false)
        {
            alert("팩스번호 형식이 올바르지 않습니다.\n다시 입력해 주세요");
            document.getElementById(MasterPath + 'txtFaxNum').focus();
            return false;
        } 


        // 신청인 이름 체크 루틴
        if (isEmpty(MasterPath + 'txtRegName') == false)
        {
            alert("신청인 이름을 입력해 주세요.");
            document.getElementById(MasterPath + 'txtRegName').focus();
            return false;
        }      
        else if(chkEnglish(MasterPath + 'txtRegName') == false)
        {
            alert("신청인 이름은 영문으로만 입력해 주세요.");
            document.getElementById(MasterPath + 'txtRegName').focus();
            return false;
        }   

        // 대표자 이름 체크 루틴
        if (chkEnglish(MasterPath + 'txtCEOName') == false)
        {
           alert("대표자 이름은 영문으로만 입력해 주세요.");
           document.getElementById(MasterPath + 'txtCEOName').focus();
           return false;
        } 
          

        // 예약 통지 이메일 체크 루틴
        if (isEmpty(MasterPath + 'txtResEmail') == false)
        {
            alert("예약 통지 이메일 주소를 입력해 주세요.");
            document.getElementById(MasterPath + 'txtResEmail').focus();
            return false;
        }

        else if(checkEmail(MasterPath + 'txtResEmail') == false)
        {
            alert("예약 통지 이메일 주소 형식이 올바르지 않습니다.\n다시 입력해 주세요.");
            document.getElementById(MasterPath + 'txtResEmail').focus();
            return false;
        }
        
        if(isEmpty(MasterPath + 'txtEtcEmail') != false && checkEmail(MasterPath + 'txtEtcEmail') == false)
        {
            alert("기타 연락 가능한 이메일 주소 형식이 올바르지 않습니다.\n다시 입력해 주세요.");
            document.getElementById(MasterPath + 'txtEtcEmail').focus();
            return false;
        }

        return true;
}

////////////////////////////////////////////////////////////////////
// 유저 예약정보 입력 체크
////////////////////////////////////////////////////////////////////
function userBookingCheckForm()
{
        // 예약자 성명 체크
        if (isEmpty(MasterPath + 'txtResLName') == false)
        {
            alert("예약고객의 성명을 입력해 주세요");
            document.getElementById(MasterPath + 'txtResLName').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtResLName') != false && chkEnglish(MasterPath + 'txtResLName') == false)
        {
            alert("예약고객의 성명은 영문으로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtResLName').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtResFName') == false)
        {
            alert("예약고객의 이름을 입력해 주세요");
            document.getElementById(MasterPath + 'txtResFName').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtResFName') != false && chkEnglish(MasterPath + 'txtResFName') == false)
        {
            alert("예약고객의 이름은 영문으로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtResFName').focus();
            return false;
        }
        
        // 국적 체크 
        if (document.getElementById(MasterPath + 'reg_ddlCountryList').value <= 0)
        {
            alert("국적을 선택해 주세요");
            document.getElementById(MasterPath + 'reg_ddlCountryList').focus();
            return false;
        }
        
        // 숙박인원 체크
        if (document.getElementById(MasterPath + 'ddlMaleGuest').value == 0 && document.getElementById(MasterPath + 'ddlFemaleGuest').value == 0)
        {
            alert("예약 인원을 입력해 주세요");
            document.getElementById(MasterPath + 'ddlMaleGuest').focus();
            return false;
        }
        
        
        // 이메일 주소 체크
        if (isEmpty(MasterPath + 'txtResEmail') == false)
        {
            alert("이메일 주소를 입력해 주세요");
            document.getElementById(MasterPath + 'txtResEmail').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtResEmail') != false && checkEmail(MasterPath + 'txtResEmail') == false)
        {
            alert("이메일 주소 형식이 올바르지 않습니다");
            document.getElementById(MasterPath + 'txtResEmail').focus();
            return false;
        }
        
        
        if (isEmpty(MasterPath + 'txtConfirmResEmail') == false)
        {
            alert("이메일 주소 재입력란를 입력해 주세요");
            document.getElementById(MasterPath + 'txtConfirmResEmail').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtConfirmResEmail') != false && checkEmail(MasterPath + 'txtConfirmResEmail') == false)
        {
            alert("이메일 주소 재입력 형식이 올바르지 않습니다");
            document.getElementById(MasterPath + 'txtConfirmResEmail').focus();
            return false;
        }
        
       if (document.getElementById(MasterPath + 'txtResEmail').value.trim() != document.getElementById(MasterPath + 'txtConfirmResEmail').value.trim())
       {
           alert("재입력하신 이메일 주소가 일치하지 않습니다");
           document.getElementById(MasterPath + 'txtConfirmResEmail').focus();
           return false;
       }
       
       // 전화번호 체크
       if (isEmpty(MasterPath + 'txtResPhoneNum') == false)
        {
            alert("전화번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtResPhoneNum').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtResPhoneNum') != false && chkPhoneNum(MasterPath + 'txtResPhoneNum') == false)
        {
            alert("전화번호 형식이 올바르지 않습니다");
            document.getElementById(MasterPath + 'txtResPhoneNum').focus();
            return false;
        }
        
        // 카드 소유자 성명 체크
        if (isEmpty(MasterPath + 'txtApplicantName') == false)
        {
            alert("카드 소유자 성명을 입력해 주세요");
            document.getElementById(MasterPath + 'txtApplicantName').focus();
            return false;
        }
        
        // 카드번호 체크
        if (isEmpty(MasterPath + 'txtCardNum1') == false)
        {
            alert("카드 번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum1').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum2') == false)
        {
            alert("카드 번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum2').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum3') == false)
        {
            alert("카드 번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum3').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum4') == false)
        {
            alert("카드 번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum4').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum1') != false && chkOnlyNumber(MasterPath + 'txtCardNum1') == false)
        {
            alert("카드번호는 숫자로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum1').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum2') != false && chkOnlyNumber(MasterPath + 'txtCardNum2') == false)
        {
            alert("카드번호는 숫자로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum2').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum3') != false && chkOnlyNumber(MasterPath + 'txtCardNum3') == false)
        {
            alert("카드번호는 숫자로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum3').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCardNum4') != false && chkOnlyNumber(MasterPath + 'txtCardNum4') == false)
        {
            alert("카드번호는 숫자로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtCardNum4').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCVVNumber') == false)
        {
            alert("카드 보안번호를 입력해 주세요");
            document.getElementById(MasterPath + 'txtCVVNumber').focus();
            return false;
        }
        
        if (isEmpty(MasterPath + 'txtCVVNumber') != false && chkOnlyNumber(MasterPath + 'txtCVVNumber') == false)
        {
            alert("카드 보안 번호는 숫자로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtCVVNumber').focus();
            return false;
        }
        
        if (document.getElementById('chkAgree').checked == false)
        {
            alert("예약 조건에 동의하셔야 예약이 진행 됩니다.");
            document.getElementById('chkAgree').focus();
            return false;
        }
        
        document.getElementById('bar').style.display = "none";
    
        revealModal("modalPage");
    /*
        document.getElementById('reservationBody').style.display="none";
    
        var obj = document.getElementById('loadingBar');
        var objImg = document.getElementById("loadingImg"); 
        if (obj.style.display == "none")
        {
            obj.style.display = 'block';
            obj.innerHTML = "<center><img src='/main/images/Booking_waitng_gif_ani_final.gif' /></center>";
        }
        else
        {
            obj.style.display = 'none'
        }
     */     
    return true;
}

////////////////////////////////////////////////////////////////////
// 유저 가입 정보 입력 체크
////////////////////////////////////////////////////////////////////
function RegisterMemberChkForm()
{
    // 이메일 주소 체크    
    if (isEmpty(MasterPath + 'txtUserEmail') == false)
    {
        alert("이메일 주소를 입력해 주세요");
        document.getElementById(MasterPath + 'txtUserEmail').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtUserEmail') != false && checkEmail(MasterPath + 'txtUserEmail') == false)
    {
        alert("이메일 주소 형식이 올바르지 않습니다");
        document.getElementById(MasterPath + 'txtUserEmail').focus();
        return false;
    }
    
    
    // 컨펌 이메일 주소 체크    
    if (isEmpty(MasterPath + 'txtReinputUserEmail') == false)
    {
        alert("이메일 재입력란에 다시 한번 이메일 주소를 입력해 주세요");
        document.getElementById(MasterPath + 'txtReinputUserEmail').focus();
        return false;
    }
    
    if (document.getElementById(MasterPath + 'txtUserEmail').value.trim() != document.getElementById(MasterPath + 'txtReinputUserEmail').value.trim())
    {
        alert("재입력하신 이메일 주소가 일치하지 않습니다");
        document.getElementById(MasterPath + 'txtReinputUserEmail').focus();
        return false;
    }
    
    // 패스워드 체크
    if (isEmpty(MasterPath + 'txtPassword') == false)
    {
        alert("패스워드를 입력해 주세요");
        document.getElementById(MasterPath + 'txtPassword').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtPassword') != false && chkPassword(MasterPath + 'txtPassword') == false)
    {
        alert("패스워드는 영문과 숫자로만 구성 됩니다");
        document.getElementById(MasterPath + 'txtPassword').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtConfirmPassword') == false)
    {
        alert("패스워드를 재입력해 주세요");
        document.getElementById(MasterPath + 'txtConfirmPassword').focus();
        return false;
    }
    
    if (document.getElementById(MasterPath + 'txtPassword').value.trim() != document.getElementById(MasterPath + 'txtConfirmPassword').value.trim())
    {
        alert("재입력하신 패스워드가 일치하지 않습니다");
        document.getElementById(MasterPath + 'txtConfirmPassword').focus();
        return false;
    }    
    
    
    if (isEmpty(MasterPath + 'txtUserFName') == false)
        {
            alert("예약고객의 이름을 입력해 주세요");
            document.getElementById(MasterPath + 'txtUserFName').focus();
            return false;
        }
     
     if (isEmpty(MasterPath + 'txtUserFName') != false && chkEnglish(MasterPath + 'txtUserFName') == false)
        {
            alert("예약고객 이름은 영문으로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtUserFName').focus();
            return false;
        }  
        
    if (isEmpty(MasterPath + 'txtUserLName') == false)
    {
        alert("예약고객의 성명을 입력해 주세요");
        document.getElementById(MasterPath + 'txtUserLName').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtUserLName') != false && chkEnglish(MasterPath + 'txtUserLName') == false)
        {
            alert("예약고객 성명은 영문으로만 입력해 주세요");
            document.getElementById(MasterPath + 'txtUserLName').focus();
            return false;
        }
    
    if (document.getElementById(MasterPath + 'reg_ddlCountryList').value == 0)
    {
        alert("국적을 선택해 주세요");
        document.getElementById(MasterPath + 'reg_ddlCountryList').focus();
        return false;
    }
    
    if (document.getElementById('Agreed').checked == false)
    {
        alert("이용 약관에 동의하셔야 가입하실 수 있습니다. ");
        document.getElementById('Agreed').focus();
        return false;
    }
   
   return true;   
}

////////////////////////////////////////////////////////////////////
// 유저 정보 수정 체크
////////////////////////////////////////////////////////////////////
function UpdateMemberChkForm()
{
     if (isEmpty(MasterPath + 'txtCurrentPassword') == false)
    {
        alert("변경할 패스워드를 입력해 주세요");
        document.getElementById(MasterPath + 'txtCurrentPassword').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtChangePassword') == false)
    {
        alert("변경할 패스워드를 재 입력해 주세요");
        document.getElementById(MasterPath + 'txtChangePassword').focus();
        return false;
    }

    if ((isEmpty(MasterPath + 'txtChangePassword') != false) && (document.getElementById(MasterPath + 'txtCurrentPassword').value.trim() != document.getElementById(MasterPath + 'txtChangePassword').value.trim()))
    {
        alert("재입력하신 패스워드가 일치하지 않습니다");
        document.getElementById(MasterPath + 'txtChangePassword').focus();
        return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
//  문의 하기 폼 체크(General Question)
////////////////////////////////////////////////////////////////////
function ReskorQnAChkForm()
{
    // 이메일 주소 체크    
    if (isEmpty(MasterPath + 'txtQuestionerEmail') == false)
    {
        alert("이메일 주소를 입력해 주세요");
        document.getElementById(MasterPath + 'txtQuestionerEmail').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtQuestionerEmail') != false && checkEmail(MasterPath + 'txtQuestionerEmail') == false)
    {
        alert("이메일 주소 형식이 올바르지 않습니다");
        document.getElementById(MasterPath + 'txtQuestionerEmail').focus();
        return false;
    }
    
    // 보내는 사람 이름 체크
    if (isEmpty(MasterPath + 'txtQuestionerName') == false)
    {
        alert("질문하시는 분의 이름을 입력해 주세요");
        document.getElementById(MasterPath + 'txtQuestionerName').focus();
        return false;
    }
    
    // 제목 체크
    if (isEmpty(MasterPath + 'txtQuestionTitle') == false)
    {
        alert("제목을 입력해 주세요");
        document.getElementById(MasterPath + 'txtQuestionTitle').focus();
        return false;
    }
    
    // 내용 체크
    if (isEmpty(MasterPath + 'txtQuestionContents') == false)
    {
        alert("질문 또는 건의 사항을 입력해 주세요");
        document.getElementById(MasterPath + 'txtQuestionContents').focus();
        return false;
    }   
    return true;
}

////////////////////////////////////////////////////////////////////
//  유저 로그인 폼 체크
////////////////////////////////////////////////////////////////////
function UserLoginChkForm()
{
    // ID 체크    
    if (isEmpty(MasterPath + 'txtMemberID') == false)
    {
        alert("아이디를 입력해 주세요");
        document.getElementById(MasterPath + 'txtMemberID').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtMemberID') != false && checkEmail(MasterPath + 'txtMemberID') == false)
    {
        alert("아이디 형식이 올바르지 않습니다\n아이디는 이메일 주소 형식입니다");
        document.getElementById(MasterPath + 'txtMemberID').focus();
        return false;
    }
    
    // 제목 체크
    if (isEmpty(MasterPath + 'txtMemberPassword') == false)
    {
        alert("비밀 번호를 입력해 주세요");
        document.getElementById(MasterPath + 'txtMemberPassword').focus();
        return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
//  유저 업소에 질문하기 체크
////////////////////////////////////////////////////////////////////
function LodgingQnAChkForm()
{
    if (isEmpty('txtQuestionTitle') == false)
    {
        alert("제목을 입력해 주세요");
        document.getElementById('txtQuestionTitle').focus();
        return false;        
    }
    
    if (isEmpty('txtQuestionContents') == false)
    {
        alert("질문 내용을 입력해 주세요");
        document.getElementById('txtQuestionContents').focus();
        return false;        
    }
    return true;    
}


////////////////////////////////////////////////////////////////////
//  유저 평가 커멘트 체크
////////////////////////////////////////////////////////////////////
function UserRatingChkForm()
{
    // 제목 체크
    if (isEmpty(MasterPath + 'txtTitle') == false && isEmpty(MasterPath + 'txtComment') != false)
    {
        alert("제목을 입력해 주세요");
        document.getElementById(MasterPath + 'txtTitle').focus();
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtTitle') != false && isEmpty(MasterPath + 'txtComment') == false)
    {
        alert("평가 내용을 입력해 주세요");
        document.getElementById(MasterPath + 'txtComment').focus();
        return false;
    }
    
    // 사진 입력 체크
    if (isEmpty(MasterPath + 'txtTitle') == false && isEmpty(MasterPath + 'txtComment') == false && isEmpty(MasterPath + 'fudImage1') != false)
    {
        alert("이미지는 평가내용을 작성하셔야만 올리실 수 있습니다.");        
        document.getElementById(MasterPath + 'fudImage1').focus();        
        return false;
    }
    
    if (isEmpty(MasterPath + 'txtTitle') == false && isEmpty(MasterPath + 'txtComment') == false && isEmpty(MasterPath + 'fudImage2') != false)
    {
        alert("이미지는 평가내용을 작성하셔야만 올리실 수 있습니다.");
        document.getElementById(MasterPath + 'fudImage2').focus();
        return false;
    }
    
    return true;  
}


////////////////////////////////////////////////////////////////////
//  검색 결과 후 예약할 객실 선택 체크
////////////////////////////////////////////////////////////////////
function RoomTypeChk()
{
   var PrivatePath = "ctl00_cphMain_rptPrivateRooms_";
   var DormitoryPath = "ctl00_cphMain_rptDormRooms_";
    // 객실 선택
    for ( r = 1; r < 60 ; r++)
    {
        if (r < 10)
        {
            if (document.getElementById(PrivatePath + 'ctl0' + r + '_chkPrivate') != null) 
            {            
                if (document.getElementById(PrivatePath + 'ctl0' + r + '_chkPrivate').checked == true)
                {
                    return true;
                }
             }
             if (document.getElementById(DormitoryPath + 'ctl0' + r + '_ddlDormNumBedAvailable') != null)
             {   
                if (document.getElementById(DormitoryPath + 'ctl0' + r + '_ddlDormNumBedAvailable').value > 0)
                {
                    return true;
                }                            
            }                        
        }
        else
        {
            if (document.getElementById(PrivatePath + 'ctl' + r + '_chkPrivate') != null)
            {
                if (document.getElementById(PrivatePath + 'ctl' + r + '_chkPrivate').checked == true)
                {
                    return true;
                }                
            }
            if (document.getElementById(DormitoryPath + 'ctl' + r + '_ddlDormNumBedAvailable') != null)
            {
                if (document.getElementById(DormitoryPath + 'ctl' + r + '_ddlDormNumBedAvailable').value > 0)
                {
                    return true;
                }     
            }
        }           
    }
    alert("예약하실 객실을 선택해 주세요.");
    return false;
}

////////////////////////////////////////////////////////////////////
//  친구에게 메일 보내기 체크
////////////////////////////////////////////////////////////////////
function EmailSendToFriend()
{
    // 보내는 사람 체크
    if (isEmpty('txtSenderEmail') == false)
    {
        alert("보내는 사람의 메일 주소를 입력해 주세요");
        document.getElementById('txtSenderEmail').focus();
        return false;
    }
    
    // 보내는 사람 이메일 주소 체크
    if (isEmpty('txtSenderEmail') != false && checkEmail('txtSenderEmail') == false)
    {
        alert("보내는 사람의 이메일 주소 형식이 올바르지 않습니다");
        document.getElementById('txtSenderEmail').focus();
        return false;
    }
    
    // 보내는 사람 이름 체크
    if (isEmpty('txtSenderName') == false)
    {
        alert("보내는 사람의 이름을 입력해 주세요");
        document.getElementById('txtSenderName').focus();
        return false;
    }
    
    // 받는 사람 체크
    if ((isEmpty('txtReferEmail_1') == false) && (isEmpty('txtReferEmail_2') == false) && (isEmpty('txtReferEmail_2') == false))
    {
        alert("받는 사람의 이메일 주소를 입력해 주세요\n최소 한명은 입력하셔야 합니다.");
        document.getElementById('txtReferEmail_1').focus();
        return false;
    }
    
    // 보내는 사람 이메일 주소 체크
    if (isEmpty('txtReferEmail_1') != false && checkEmail('txtReferEmail_1') == false)
    {
        alert("받는 사람의 이메일 주소 형식이 올바르지 않습니다");
        document.getElementById('txtReferEmail_1').focus();
        return false;
    }
    
    if (isEmpty('txtReferEmail_2') != false && checkEmail('txtReferEmail_2') == false)
    {
        alert("받는 사람의 이메일 주소 형식이 올바르지 않습니다");
        document.getElementById('txtReferEmail_2').focus();
        return false;
    }
    
    if (isEmpty('txtReferEmail_3') != false && checkEmail('txtReferEmail_3') == false)
    {
        alert("받는 사람의 이메일 주소 형식이 올바르지 않습니다");
        document.getElementById('txtReferEmail_3').focus();
        return false;
    }
    
    return true;
}