﻿
////////////////////////////////////////////////////////////////////
// 인박스 로그인 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function chkLoginID()
{
  if(isEmpty('txtLoginID') == false)   
    {
        alert("Please enter member ID.");
        document.getElementById('txtLoginID').focus();
        return false;
    }
  
  if(isEmpty('txtPassword') == false)
  {
    alert("Please enter member Password.");
    document.getElementById('txtPassword').focus();
    return false;
  } 
  
  return true;
  
}

////////////////////////////////////////////////////////////////////
// 템포 업소기본 정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
var MastertempPath = "ctl00_chpTempInbox_";

//Form 형식 체크
function chkTempForm()
{   
   // 업소 전화번호 체크 루틴
   if (isEmpty(MastertempPath + 'txtPhoneNum') == false)
   {
        alert("Please enter Phone Number.");
        document.getElementById(MastertempPath + 'txtPhoneNum').focus();
        return false;
   }
   
   else if(chkPhoneNum(MastertempPath + 'txtPhoneNum') == false)
   {
        alert("Invalid Phone Number.\nPlease enter Phone Number.");
        document.getElementById(MastertempPath + 'txtPhoneNum').focus();
        return false;
   } 
   
   //한국내 연락번호 체크 루틴
   if(isEmpty(MastertempPath + 'txtPhoneNumKor') != false && chkPhoneNum(MastertempPath + 'txtPhoneNumKor') == false)
   {
        alert("Invalid Toll Free Phone Number.\nPlease enter Phone Number.");
        document.getElementById(MastertempPath + 'txtPhoneNumKor').focus();
        return false;
   } 
   
   // 팩스 번호 체크 루틴
   if(isEmpty(MastertempPath + 'txtFaxNum') != false && chkPhoneNum(MastertempPath + 'txtFaxNum') == false)
   {
        alert("Invalid Fax Number, Please enter Fax Number.");
        document.getElementById(MastertempPath + 'txtFaxNum').focus();
        return false;
   } 
   
   
   // 신청인 이름 체크 루틴
   if (isEmpty(MastertempPath + 'txtRegName') == false)
   {
        alert("Please enter your Name.");
        document.getElementById(MastertempPath + 'txtRegName').focus();
        return false;
   }      
   else if(chkEnglish(MastertempPath + 'txtRegName') == false)
   {
        alert("Please enter your name in English.");
        document.getElementById(MastertempPath + 'txtRegName').focus();
        return false;
   }   
   
   // 대표자 이름 체크 루틴
   if (chkEnglish(MastertempPath + 'txtCEOName') == false)
    {
       alert("Please enter CEO's name in English.");
       document.getElementById(MastertempPath + 'txtCEOName').focus();
       return false;
    }  
   
   // 예약 통지 이메일 체크 루틴
   if (isEmpty(MastertempPath + 'txtResEmail') == false)
   {
        alert("Please enter E-Mail address for Booking Notice.");
        document.getElementById(MastertempPath + 'txtResEmail').focus();
        return false;
   }
   
   else if(checkEmail(MastertempPath + 'txtResEmail') == false)
   {
        alert("Invalid E-mail address.\nPlease enter E-Mail address for Booking Notice.");
        document.getElementById(MastertempPath + 'txtResEmail').focus();
        return false;
   }
   
   if(isEmpty(MastertempPath + 'txtEtcEmail') != false && checkEmail(MastertempPath + 'txtEtcEmail') == false)
   {
        alert("Invalid E-mail address.\nPlease enter E-Mail address.");
        document.getElementById(MastertempPath + 'txtEtcEmail').focus();
        return false;
   }
   
   return true;
  
}

////////////////////////////////////////////////////////////////////
// 템포 업소 위치정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function templodgingDirectionChkForm()
{
        // 메인공항에서 입력 폼 체크
        if ((document.getElementById(MastertempPath + 'ddlToAirport').value == 0) && isEmpty(MastertempPath + 'txtToAirportMIn') != false)
        {
           alert("Please select a transportation means from Airport.");
           document.getElementById(MastertempPath + 'ddlToAirport').focus();
           return false;
        } 
        else if ((document.getElementById(MastertempPath + 'ddlToAirport').value > 1) && isEmpty(MastertempPath + 'txtToAirportMIn') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(MastertempPath + 'txtToAirportMIn').focus();
            return false;
        }
        
        if(isEmpty(MastertempPath + 'txtToAirportMIn') != false && chkOnlyNumber(MastertempPath + 'txtToAirportMIn') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(MastertempPath + 'txtToAirportMIn').focus();
            return false;
        }
        

        // 메인 기차정거장에서 입력 폼 체크
        if ((document.getElementById(MastertempPath + 'ddlToTrainStat').value == 0) && isEmpty(MastertempPath + 'txtToTrainStatMin') != false)
        {
           alert("Please select a transportation means from Train Station.");
           document.getElementById(MastertempPath + 'ddlToTrainStat').focus();
           return false;
        } 
        else if ((document.getElementById(MastertempPath + 'ddlToTrainStat').value > 1) && isEmpty(MastertempPath + 'txtToTrainStatMin') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(MastertempPath + 'txtToTrainStatMin').focus();
            return false;
        }
        
        if(isEmpty(MastertempPath + 'txtToTrainStatMin') != false && chkOnlyNumber(MastertempPath + 'txtToTrainStatMin') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(MastertempPath + 'txtToTrainStatMin').focus();
            return false;
        }

        // 메인 버스 터미널에서 입력 폼 체크
        if ((document.getElementById(MastertempPath + 'ddlToBusStation').value == 0) && isEmpty(MastertempPath + 'txtToBusStation') != false)
        {
           alert("Please select a transportation means from Main Bus Terminal.");
           document.getElementById(MastertempPath + 'ddlToBusStation').focus();
           return false;
        } 
        else if ((document.getElementById(MastertempPath + 'ddlToBusStation').value > 1) && isEmpty(MastertempPath + 'txtToBusStation') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(MastertempPath + 'txtToBusStation').focus();
            return false;
        }
        
        if(isEmpty(MastertempPath + 'txtToBusStation') != false && chkOnlyNumber(MastertempPath + 'txtToBusStation') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(MastertempPath + 'txtToBusStation').focus();
            return false;
        }

        // 버스 정류장 또는 지하철에서 입력 폼 체크
        if ((document.getElementById(MastertempPath + 'ddlToBusStop').value == 0) && isEmpty(MastertempPath + 'txtToBusStopMin') != false)
        {
           alert("Please select a transportation means from Bus Stop.");
           document.getElementById(MastertempPath + 'ddlToBusStop').focus();
           return false;
        } 
        else if ((document.getElementById(MastertempPath + 'ddlToBusStop').value > 1) && isEmpty(MastertempPath + 'txtToBusStopMin') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(MastertempPath + 'txtToBusStopMin').focus();
            return false;
        }
        
        if(isEmpty(MastertempPath + 'txtToBusStopMin') != false && chkOnlyNumber(MastertempPath + 'txtToBusStopMin') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(MastertempPath + 'txtToBusStopMin').focus();
            return false;
        }

        // 업소 주변 관광지_1 설명 입력 폼 체크
        if ((isEmpty(MastertempPath + 'txtTourName1') == false) && isEmpty(MastertempPath + 'txtTourDesc1') != false)
        {
           alert("Please enter Main Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourName1').focus();
           return false;
        }
        else if ((isEmpty(MastertempPath + 'txtTourName1') != false) && isEmpty(MastertempPath + 'txtTourDesc1') == false)
        {
           alert("Please describe about Main Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourDesc1').focus();
           return false;
        }


        // 업소 주변 관광지_2 설명 입력 폼 체크
        if ((isEmpty(MastertempPath + 'txtTourName2') == false) && isEmpty(MastertempPath + 'txtTourDesc2') != false)
        {
           alert("Please enter another Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourName2').focus();
           return false;
        }
        else if ((isEmpty(MastertempPath + 'txtTourName2') != false) && isEmpty(MastertempPath + 'txtTourDesc2') == false)
        {
           alert("Please describe about another Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourDesc2').focus();
           return false;
        }

        // 업소 주변 관광지_3 설명 입력 폼 체크
        if ((isEmpty(MastertempPath + 'txtTourName3') == false) && isEmpty(MastertempPath + 'txtTourDesc3') != false)
        {
           alert("Please enter other Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourName3').focus();
           return false;
        }
        else if ((isEmpty(MastertempPath + 'txtTourName3') != false) && isEmpty(MastertempPath + 'txtTourDesc3') == false)
        {
           alert("Please describe about other Sightseeing Point near around your Hotel.");
           document.getElementById(MastertempPath + 'txtTourDesc3').focus();
           return false;
        }   
        return true;
}

////////////////////////////////////////////////////////////////////
// 템포 업소운영 정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function templodgingMngrChkForm()
{
    if (document.getElementById(MastertempPath + 'ddlBusinessTerm').value == 0)
    {
       alert("How many years you have been running this hotel?");
       document.getElementById(MastertempPath + 'ddlBusinessTerm').focus();
       return false;
    }
    
    if (document.getElementById(MastertempPath + 'ddlNumRooms').value == 0)
    {
       alert("How many rooms do you have?");
       document.getElementById(MastertempPath + 'ddlNumRooms').focus();
       return false;
    }
    
    if(isEmpty(MastertempPath + 'txtMessenger') != false && checkEmail(MastertempPath + 'txtMessenger') == false)
        {
            alert("Messenger type wrong.");
            document.getElementById(MastertempPath + 'txtMessenger').focus();
            return false;
        }
        
    if (document.getElementById(MastertempPath + 'ddlCheckInTime').value == 0)
    {
       alert("What time is the Check in available?");
       document.getElementById(MastertempPath + 'ddlCheckInTime').focus();
       return false;
    }
    
    if (document.getElementById(MastertempPath + 'ddlCheckOutTime').value == 0)
    {
       alert("What is the Check out time?");
       document.getElementById(MastertempPath + 'ddlCheckOutTime').focus();
       return false;
    }
    
    if (document.getElementById(MastertempPath + 'ddlOfficeHour').value == 0)
    {
       alert("Please select office open hours");
       document.getElementById(MastertempPath + 'ddlOfficeHour').focus();
       return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 템포 업소설명 정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function templodgingDescChkForm()
{
    if (isEmpty(MastertempPath + 'txtIntroduction') == false)
    {
       alert("Please enter Hotel General Description.");
       document.getElementById(MastertempPath + 'txtIntroduction').focus();
       return false;
    }
    
    if (isEmpty(MastertempPath + 'txtSpecialty') == false)
    {
       alert("Please enter Hotel event Description Info");
       document.getElementById(MastertempPath + 'txtSpecialty').focus();
       return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 업소 기본정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
var Master3RowPath = "ctl00_chpInbox_";        // 업소정보 섹션의 ID Path.

function lodgingBasicInfoCheckForm()
{   
        // 비밀번호 체크 루틴
        if(isEmpty(Master3RowPath + 'txtPassword') == false && isEmpty(Master3RowPath + 'txtConfirmPassword') != false )
        {
            alert("Please enter desired New Password.");
            document.getElementById(Master3RowPath + 'txtPassword').focus();
            return false;
        }

        if(isEmpty(Master3RowPath + 'txtPassword') != false && isEmpty(Master3RowPath + 'txtConfirmPassword') == false )
        {
            alert("Please enter New Password again for confirm.");
            document.getElementById(Master3RowPath + 'txtConfirmPassword').focus();
            return false;
        }

        if(document.getElementById(Master3RowPath + 'txtPassword').value != document.getElementById(Master3RowPath + 'txtConfirmPassword').value)
        {
            alert("Unmatched Password.\nPlease enter New Password again for confirm.");
            document.getElementById(Master3RowPath + 'txtPassword').focus();
            return false;
        }    

        // 업소 전화번호 체크 루틴
        if (isEmpty(Master3RowPath + 'txtPhoneNum') == false)
        {
            alert("Please enter Phone Number.");
            document.getElementById(Master3RowPath + 'txtPhoneNum').focus();
            return false;
        }
        else if(chkPhoneNum(Master3RowPath + 'txtPhoneNum') == false)
        {
            alert("Invalid Phone Number.\nPlease enter Phone Number.");
            document.getElementById(Master3RowPath + 'txtPhoneNum').focus();
            return false;
        } 

        //한국내 연락번호 체크 루틴
        if(chkPhoneNum(Master3RowPath + 'txtPhoneNumKor') == false)
        {
            alert("Invalid Toll Free Phone Number.\nPlease enter Phone Number.");
            document.getElementById(Master3RowPath + 'txtPhoneNumKor').focus();
            return false;
        } 

        // 팩스 번호 체크 루틴
        if(chkPhoneNum(Master3RowPath + 'txtFaxNum') == false)
        {
            alert("Invalid Fax Number, Please enter Fax Number.");
            document.getElementById(Master3RowPath + 'txtFaxNum').focus();
            return false;
        } 


        // 신청인 이름 체크 루틴
        if (isEmpty(Master3RowPath + 'txtRegName') == false)
        {
            alert("Please enter your Name.");
            document.getElementById(Master3RowPath + 'txtRegName').focus();
            return false;
        }      
        else if(chkEnglish(Master3RowPath + 'txtRegName') == false)
        {
            alert("Please enter your name in English.");
            document.getElementById(Master3RowPath + 'txtRegName').focus();
            return false;
        }   

        // 대표자 이름 체크 루틴
        if (chkEnglish(Master3RowPath + 'txtCEOName') == false)
        {
           alert("Please enter CEO's name in English.");
           document.getElementById(Master3RowPath + 'txtCEOName').focus();
           return false;
        } 
          

        // 예약 통지 이메일 체크 루틴
        if (isEmpty(Master3RowPath + 'txtResEmail') == false)
        {
            alert("Please enter E-Mail address for Booking Notice.");
            document.getElementById(Master3RowPath + 'txtResEmail').focus();
            return false;
        }

        else if(checkEmail(Master3RowPath + 'txtResEmail') == false)
        {
            alert("Invalid E-mail address.\nPlease enter E-Mail address for Booking Notice.");
            document.getElementById(Master3RowPath + 'txtResEmail').focus();
            return false;
        }
        
        if(isEmpty(Master3RowPath + 'txtEtcEmail') != false && checkEmail(Master3RowPath + 'txtEtcEmail') == false)
        {
            alert("Invalid E-mail address.\nPlease enter E-Mail address.");
            document.getElementById(Master3RowPath + 'txtEtcEmail').focus();
            return false;
        }

        return true;
}

////////////////////////////////////////////////////////////////////
// 업소 운영정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function lodgingManagerChkForm()
{
    // 메신져 주소형식을 체크한다
    if(isEmpty(Master3RowPath + 'txtMessenger') != false && checkEmail(Master3RowPath + 'txtMessenger') == false)
        {
            alert("Messenger type wrong.");
            document.getElementById(Master3RowPath + 'txtMessenger').focus();
            return false;
        }
        
    // 운영정보관리 정보를 체크한다.
    if (document.getElementById(Master3RowPath + 'ddlCheckInTime').value == 0)
    {
       alert("What time is the Check in available?");
       document.getElementById(Master3RowPath + 'ddlCheckInTime').focus();
       return false;
    }
    
    if (document.getElementById(Master3RowPath + 'ddlCheckOutTime').value == 0)
    {
       alert("What is the Check out time?");
       document.getElementById(Master3RowPath + 'ddlCheckOutTime').focus();
       return false;
    }
    
    if (document.getElementById(Master3RowPath + 'ddlOfficeHour').value == 0)
    {
       alert("Please select office open hours");
       document.getElementById(Master3RowPath + 'ddlOfficeHour').focus();
       return false;
    }

        return true;
}


////////////////////////////////////////////////////////////////////
// 업소 위치정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function lodgingDirectionChkForm()
{
        // 위치 설명정보 체크 루틴
        if (isEmpty(Master3RowPath + 'txtDirection') == false)
        {
            alert("Please enter Hotel Location Info.");
            document.getElementById(Master3RowPath + 'txtDirection').focus();
            return false;
        }

        // 메인공항에서 입력 폼 체크
        if ((document.getElementById(Master3RowPath + 'ddlToAirport').value == 0) && document.getElementById(Master3RowPath + 'txtToAirportMin').value != "")
        {
           alert("Please select a transportation means from Airport.");
           document.getElementById(Master3RowPath + 'ddlToAirport').focus();
           return false;
        } 
        else if ((document.getElementById(Master3RowPath + 'ddlToAirport').value > 1) && isEmpty(Master3RowPath + 'txtToAirportMin') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(Master3RowPath + 'txtToAirportMin').focus();
            return false;
        }
        
        if (isEmpty(Master3RowPath + 'txtToAirportMin') != false && chkOnlyNumber(Master3RowPath + 'txtToAirportMin') == false)
        {
            alert("Please enter only the number for minutes");
            document.getElementById(Master3RowPath + 'txtToAirportMin').focus();
            return false;
        }

        // 메인 기차정거장에서 입력 폼 체크
        if ((document.getElementById(Master3RowPath + 'ddlToTrainStat').value == 0) && document.getElementById(Master3RowPath + 'txtToTrainStatMin').value != "")
        {
           alert("Please select a transportation means from Train Station.");
           document.getElementById(Master3RowPath + 'ddlToTrainStat').focus();
           return false;
        } 
        else if ((document.getElementById(Master3RowPath + 'ddlToTrainStat').value > 1) && isEmpty(Master3RowPath + 'txtToTrainStatMin') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(Master3RowPath + 'txtToTrainStatMin').focus();
            return false;
        }
        
        if (isEmpty(Master3RowPath + 'txtToTrainStatMin') != false && chkOnlyNumber(Master3RowPath + 'txtToTrainStatMin') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(Master3RowPath + 'txtToTrainStatMin').focus();
            return false;
        }

        // 메인 버스 터미널에서 입력 폼 체크
        if ((document.getElementById(Master3RowPath + 'ddlToBusStation').value == 0) && document.getElementById(Master3RowPath + 'txtToBusStation').value != "")
        {
           alert("Please select a transportation means from Main Bus Terminal.");
           document.getElementById(Master3RowPath + 'ddlToBusStation').focus();
           return false;
        } 
        else if ((document.getElementById(Master3RowPath + 'ddlToBusStation').value > 1) && isEmpty(Master3RowPath + 'txtToBusStation') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(Master3RowPath + 'txtToBusStation').focus();
            return false;
        }
        
        if (isEmpty(Master3RowPath + 'txtToBusStation') != false && chkOnlyNumber(Master3RowPath + 'txtToBusStation') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(Master3RowPath + 'txtToBusStation').focus();
            return false;
        }

        // 버스 정류장 또는 지하철에서 입력 폼 체크
        if ((document.getElementById(Master3RowPath + 'ddlToBusStop').value == 0) && document.getElementById(Master3RowPath + 'txtToBusStopMin').value != "")
        {
           alert("Please select a transportation means from Bus Stop.");
           document.getElementById(Master3RowPath + 'ddlToBusStop').focus();
           return false;
        } 
        else if ((document.getElementById(Master3RowPath + 'ddlToBusStop').value > 1) && isEmpty(Master3RowPath + 'txtToBusStopMin') == false)
        {
            alert("You chose the way of transportation, but forgot to put minutes.");
            document.getElementById(Master3RowPath + 'txtToBusStopMin').focus();
            return false;
        }
        
        if (isEmpty(Master3RowPath + 'txtToBusStopMin') != false && chkOnlyNumber(Master3RowPath + 'txtToBusStopMin') == false)
        {
            alert("Please enter only the number for minutes.");
            document.getElementById(Master3RowPath + 'txtToBusStopMin').focus();
            return false;
        }

        // 업소 주변 관광지_1 설명 입력 폼 체크
        if ((isEmpty(Master3RowPath + 'txtTourName1') == false) && isEmpty(Master3RowPath + 'txtTourDesc1') != false)
        {
           alert("Please enter Main Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourName1').focus();
           return false;
        }
        else if ((isEmpty(Master3RowPath + 'txtTourName1') != false) && isEmpty(Master3RowPath + 'txtTourDesc1') == false)
        {
           alert("Please describe about Main Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourDesc1').focus();
           return false;
        }


        // 업소 주변 관광지_2 설명 입력 폼 체크
        if ((isEmpty(Master3RowPath + 'txtTourName2') == false) && isEmpty(Master3RowPath + 'txtTourDesc2') != false)
        {
           alert("Please enter another Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourName2').focus();
           return false;
        }
        else if ((isEmpty(Master3RowPath + 'txtTourName2') != false) && isEmpty(Master3RowPath + 'txtTourDesc2') == false)
        {
           alert("Please describe about another Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourDesc2').focus();
           return false;
        }

        // 업소 주변 관광지_3 설명 입력 폼 체크
        if ((isEmpty(Master3RowPath + 'txtTourName3') == false) && isEmpty(Master3RowPath + 'txtTourDesc3') != false)
        {
           alert("Please enter other Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourName3').focus();
           return false;
        }
        else if ((isEmpty(Master3RowPath + 'txtTourName3') != false) && isEmpty(Master3RowPath + 'txtTourDesc3') == false)
        {
           alert("Please describe about other Sightseeing Point near around your Hotel.");
           document.getElementById(Master3RowPath + 'txtTourDesc3').focus();
           return false;
        }   
        return true;
}

////////////////////////////////////////////////////////////////////
// 업소 설명정보 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function lodgingDescChkForm()
{
    if (isEmpty(Master3RowPath + 'txtIntroduction') == false)
    {
       alert("Please enter Hotel General Description.");
       document.getElementById(Master3RowPath + 'txtIntroduction').focus();
       return false;
    }
    
    if (isEmpty(Master3RowPath + 'txtSpecialty') == false)
    {
       alert("Please enter Hotel event Description Info.");
       document.getElementById(Master3RowPath + 'txtSpecialty').focus();
       return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 업소 예약환경 설정 페이지 폼 체크
////////////////////////////////////////////////////////////////////
function lodgingResEnvironmentChkForm()
{
    if (isEmpty(Master3RowPath + 'txtPolicy') == false)
    {
       alert("Please enter Booking Policy.");
       document.getElementById(Master3RowPath + 'txtPolicy').focus();
       return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 예약검색 페이지 폼 체크
////////////////////////////////////////////////////////////////////  
var Master2RowPath = 'ctl00_chpInbox_';

function searchBookingByResNum()
{
     // 예약번호 검색하기 폼 체크
    if (isEmpty(Master2RowPath + 'txtReserveNumber') == false)
    {
       alert("Please enter a reference number.");
       document.getElementById(Master2RowPath + 'txtReserveNumber').focus();
       return false;
    }
   else if(chkNumber(Master2RowPath + 'txtReserveNumber') == false)
   {
        alert("Please use numbers only into the reference number.");
        document.getElementById(Master2RowPath + 'txtReserveNumber').focus();
        return false;
   }
    return true;
}

function searchBookingByName()
{
    // 예약자 이름으로 검색하기 폼 체크
    if (isEmpty(Master2RowPath + 'txtFirstName') == false)
    {
       alert("Please enter the first name.");
       document.getElementById(Master2RowPath + 'txtFirstName').focus();
       return false;
    }
    else if(chkEnglish(Master2RowPath + 'txtFirstName') == false)
    {
       alert("Please use English Only into the first name.");
       document.getElementById(Master2RowPath + 'txtFirstName').focus();
       return false; 
    }
    
    if (isEmpty(Master2RowPath + 'txtLastName') == false)
    {
       alert("Please enter the last name.");
       document.getElementById(Master2RowPath + 'txtLastName').focus();
       return false;
    }
    else if(chkEnglish(Master2RowPath + 'txtLastName') == false)
    {
       alert("Please use English Only to the last name.");
       document.getElementById(Master2RowPath + 'txtLastName').focus();
       return false; 
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 객실 추가 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function addRoomChkForm()
{
    // 객실 종류 선택
    if(document.getElementById(Master2RowPath + 'ddlKindRoom').value == 0)
    {
        alert("Please choose a room category.");
        document.getElementById(Master2RowPath + 'ddlKindRoom').focus();
        return false;
    }
    
    // 객실 형태 선택
    if(document.getElementById(Master2RowPath + 'ddlRoomType').value == 0)
    {
        alert("Please choose a room type.");
        document.getElementById(Master2RowPath + 'ddlRoomType').focus();
        return false;
    }
    
    // 객실 이름 폼 체크
    if (isEmpty(Master2RowPath + 'txtRoomName') == false)
    {
       alert("Please enter a room name.");
       document.getElementById(Master2RowPath + 'txtRoomName').focus();
       return false;
    }
    
    // 주중가격 폼 체크
    if (isEmpty(Master2RowPath + 'txtWeekDayPrice') == false)
    {
       alert("Please enter the weekday rate.");
       document.getElementById(Master2RowPath + 'txtWeekDayPrice').focus();
       return false;
    }
    else if(chkNumber(Master2RowPath + 'txtWeekDayPrice') == false)
    {
       alert("Please use Numbers only into the weekday rate.");
       document.getElementById(Master2RowPath + 'txtWeekDayPrice').focus();
       return false;
    }
    
    // 주말가격 폼 체크
    if (isEmpty(Master2RowPath + 'txtWeekEndPrice') == false)
    {
       alert("Please enter the weekend rate.");
       document.getElementById(Master2RowPath + 'txtWeekEndPrice').focus();
       return false;
    }
    else if(chkNumber(Master2RowPath + 'txtWeekEndPrice') == false)
    {
       alert("Please use Numbers only into the weekend rate.");
       document.getElementById(Master2RowPath + 'txtWeekEndPrice').focus();
       return false;
    }
    
    // 객실설명 폼 체크
    if (isEmpty(Master2RowPath + 'txtRoomDescription') == false)
    {
       alert("Please enter a room description");
       document.getElementById(Master2RowPath + 'txtRoomDescription').focus();
       return false;
    }
    
    // 특별시즌 객실가격 적용 폼 체크
    for (var i=1;i< 8;i++)
    {
        if(document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice') != null || document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice') != null)
        {
            // 숫자로만 가격 입력 체크 폼
            if (chkNumber(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice') == false)
            {
                alert("Please use numbers only into the rates.");
                document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice').focus();
                return false;
            }
            
            if (chkNumber(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice') == false)
            {
                alert("Please use numbers only into the rates.");
                document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice').focus();
                return false;
            }
            
            // 주중/주말 가격 동시 업데이트 체크 폼
            if (isEmpty(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice') != false && isEmpty(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice') == false)
            {
                alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice').focus();
                return false;
            }
           
            if (isEmpty(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice') == false && isEmpty(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekEndPrice') != false)
            {
                alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                document.getElementById(Master2RowPath + 'rptSpecialSeason_ctl0' + i + '_txtssWeekDayPrice').focus();
                return false;
            }  
        }  
        i++;
    }
    
                  
    document.getElementById('addroomBody').style.display="none";
    
    var obj = document.getElementById('loadingBar');
    var objImg = document.getElementById("loadingImg"); 
    if (obj.style.display == "none")
    {
        obj.style.display = 'block';
        obj.innerHTML = "<table width='670' height='800' cellspacing='0'><tr><td align='center' valign='middle'><center><img src='/inbox/images/loading_indox_image_01.gif' /></center></td></tr></table>";
    }
    else
    {
        obj.style.display = 'none'
    }
    
      
    return true;
}

////////////////////////////////////////////////////////////////////
// 객실 디테일 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function roomDetailChkForm()
{
    // 객실 이름 폼 체크
    if (isEmpty(Master2RowPath + 'txtRoomName') == false)
    {
       alert("Please enter a room name");
       document.getElementById(Master2RowPath + 'txtRoomName').focus();
       return false;
    }  
    
    // 객실 설명 폼 체크
    if (isEmpty(Master2RowPath + 'txtRoomDescription') == false)
    {
       alert("Please enter a room description");
       document.getElementById(Master2RowPath + 'txtRoomDescription').focus();
       return false;
    }
    return true;
}


////////////////////////////////////////////////////////////////////
// 개별 객실 가격 및 어밸러티 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function setAvailabilityFormChk()
{
    // 기간설정 입력값 체크
    if ((isEmpty(Master2RowPath + 'txtFromDate') == false) || (document.getElementById(Master2RowPath + 'txtFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the beginning date.");
        document.getElementById(Master2RowPath + 'txtFromDate').focus();
        return false;
    }
    
    if ((isEmpty(Master2RowPath + 'txtToDate') == false) || (document.getElementById(Master2RowPath + 'txtToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the ending date.");
        document.getElementById(Master2RowPath + 'txtToDate').focus();
        return false;
    }
    
    if(compareDate(Master2RowPath + 'txtFromDate', Master2RowPath + 'txtToDate') == false)
    {
        return false;
    }
        
    // 객실 어벨러빌리티 가격 폼 값 체크
    if (isEmpty(Master2RowPath + 'txtRoomWeekDayPrice') == false)
    {
        alert("Please enter the weekday rate.");
        document.getElementById(Master2RowPath + 'txtRoomWeekDayPrice').focus();
        return false;
    } 
    else if(chkNumber(Master2RowPath + 'txtRoomWeekDayPrice') == false)
    {
       alert("Please use Numbers only into the weekday rate.");
       document.getElementById(Master2RowPath + 'txtRoomWeekDayPrice').focus();
       return false;
    }
    
    if (isEmpty(Master2RowPath + 'txtRoomWeekEndPrice') == false)
    {
        alert("Please enter the weekend rate.");
        document.getElementById(Master2RowPath + 'txtRoomWeekEndPrice').focus();
        return false;
    }
    else if(chkNumber(Master2RowPath + 'txtRoomWeekEndPrice') == false)
    {
       alert("Please use Numbers only into the weekend rate.");
       document.getElementById(Master2RowPath + 'txtRoomWeekEndPrice').focus();
       return false;
    }
       
    return true;
}

function delAvailabilityFormChk()
{    
    // 어벨러티 삭제 캘린더 폼 체크
    if ((isEmpty(Master2RowPath + 'txtDelFromDate') == false) || (document.getElementById(Master2RowPath + 'txtDelFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the beginning date.");
        document.getElementById(Master2RowPath + 'txtDelFromDate').focus();
        return false;
    }
    
    if ((isEmpty(Master2RowPath + 'txtDelToDate') == false) || (document.getElementById(Master2RowPath + 'txtDelToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the ending date.");
        document.getElementById(Master2RowPath + 'txtDelToDate').focus();
        return false;
    }
    
    if(compareDate(Master2RowPath + 'txtDelFromDate', Master2RowPath + 'txtDelToDate') == false)
    {
        return false;
    }
    
    return true;
}


////////////////////////////////////////////////////////////////////
// 특별시즌 관리 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function specialSeasonFormChk()
{
    // 특별 시즌 이름 폼 체크
    if (isEmpty(Master3RowPath + 'txtSpecialSeasonName') == false)
    {
       alert("Please enter the Nick name of special season.");
       document.getElementById(Master3RowPath + 'txtSpecialSeasonName').focus();
       return false;
    }
    
    // 스페셜 시즌 캘린더 입력값 체크    
    if ((isEmpty(Master3RowPath + 'txtFromDate') == false) || (document.getElementById(Master3RowPath + 'txtFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the period for special season.");
        document.getElementById(Master3RowPath + 'txtFromDate').focus();
        return false;
    }  
    
    if ((isEmpty(Master3RowPath + 'txtToDate') == false) || (document.getElementById(Master3RowPath + 'txtToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the period for special season.");
        document.getElementById(Master3RowPath + 'txtToDate').focus();
        return false;
    } 
    
    if(compareDate(Master3RowPath + 'txtFromDate', Master3RowPath + 'txtToDate') == false)
    {
        return false;
    }    
    
    return true;
}

function specialSeasonEditChkForm()
{
// 스페셜 시즌 객실 가격 동시 업데이트 체크
    for (i=1;i<10;i++)
    {    
        if (document.getElementById(Master3RowPath + 'dltSpecialSeason_ctl0' + i +'_txtSeasonName') != null)
        {
            if (isEmpty(Master3RowPath + 'dltSpecialSeason_ctl0' + i +'_txtSeasonName') == false)
            {
                alert("수정되는 특별시즌 이름을 입력해 주세요");
                document.getElementById(Master3RowPath + 'dltSpecialSeason_ctl0' + i +'_txtSeasonName').focus();
                return false;
            }
        }        
     
    }
    return true;
}


////////////////////////////////////////////////////////////////////
// 특별시즌 객실 가격관리 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function applySeasonRoomPriceChkForm()
{
    // 스페셜 시즌 객실 가격 동시 업데이트 체크
    for (i=1;i< 40;i++)
    {
      if (document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice') != null || document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice') != null)
      {
            if (i < 10 )
            {   
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice') != false && isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice') == false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice').focus();
                    return false;
                }
               
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice') == false && isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice') != false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice').focus();
                    return false;
                }  
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice') == false)
                {
                   alert("Please use Numbers only into the weekday rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonDayPrice').focus();
                   return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice') == false)
                {
                   alert("Please use Numbers only into the weekend rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtSeasonWeekPrice').focus();
                   return false;
                }         
                            
            }          
            else
            {
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonDayPrice') != false && isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonWeekPrice') == false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonWeekPrice').focus();
                    return false;
                }
               
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonDayPrice') == false && isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonWeekPrice') != false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonDayPrice').focus();
                    return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonDayPrice') == false)
                {
                   alert("Please use Numbers only into the weekday rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonDayPrice').focus();
                   return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonWeekPrice') == false)
                {
                   alert("Please use Numbers only into the weekend rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtSeasonWeekPrice').focus();
                   return false;
                }            
            } 
        }         
        //i++;        
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 선택한 객실 가격관리 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function availAllocationRoomPriceChkForm()
{
    // 캘린더 입력값 체크
    if ((isEmpty(Master2RowPath + 'txtFromDate') == false) || (document.getElementById(Master2RowPath + 'txtFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the beginning date.");
        document.getElementById(Master2RowPath + 'txtFromDate').focus();
        return false;
    }
    
    if ((isEmpty(Master2RowPath + 'txtToDate') == false) || (document.getElementById(Master2RowPath + 'txtToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the ending date.");
        document.getElementById(Master2RowPath + 'txtToDate').focus();
        return false;
    }
    
    if(compareDate(Master2RowPath + 'txtFromDate', Master2RowPath + 'txtToDate') == false)
    {
        return false;
    }
    
    // 스페셜 시즌 객실 가격 동시 업데이트 체크
    for (i=1;i< 21;i++)
    {
       if (document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice') != null || document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice') != null)
       {
            if (i < 10 )
            {   
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice') != false && isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice') == false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice').focus();
                    return false;
                }
               
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice') == false && isEmpty(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice') != false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice').focus();
                    return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice') == false)
                {
                   alert("Please use Numbers only into the weekday rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekDayPrice').focus();
                   return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice') == false)
                {
                   alert("Please use Numbers only into the weekend rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl0' + i +'_txtWeekEndPrice').focus();
                   return false;
                }
            }          
            else
            {
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekDayPrice') != false && isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekEndPrice') == false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekEndPrice').focus();
                    return false;
                }
               
                if (isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekDayPrice') == false && isEmpty(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekEndPrice') != false)
                {
                    alert("You must enter both weekday and weekend rate together.\nIf you do not want to modify, please leave them blank.");
                    document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekDayPrice').focus();
                    return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekDayPrice') == false)
                {
                   alert("Please use Numbers only into the weekday rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekDayPrice').focus();
                   return false;
                }
                
                if(chkNumber(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekEndPrice') == false)
                {
                   alert("Please use Numbers only into the weekend rate.");
                   document.getElementById(Master2RowPath + 'rptRoomList_ctl' + i +'_txtWeekEndPrice').focus();
                   return false;
                }
            }
        }          
        i++;
                
    }
    return true;
}


    
////////////////////////////////////////////////////////////////////
//  뉴스 및 Q&A 내용 작성 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function writeChkForm()
{
// 객실 이름 폼 체크
    if (isEmpty(Master2RowPath + 'txtTitle') == false)
    {
       alert("Please enter Title");
       document.getElementById(Master2RowPath + 'txtTitle').focus();
       return false;
    }  
    
    // 객실 설명 폼 체크
    if (isEmpty(Master2RowPath + 'txtContents') == false)
    {
       alert("Please enter contents");
       document.getElementById(Master2RowPath + 'txtContents').focus();
       return false;
    }
    return true;
}

////////////////////////////////////////////////////////////////////
// 선택한 객실 일정기간 삭제하기 페이지 폼 체크
//////////////////////////////////////////////////////////////////// 
function DelRoomsAvailabilityChkForm()
{
    // 캘린더 입력값 체크
    if ((isEmpty(Master2RowPath + 'txtFromDate') == false) || (document.getElementById(Master2RowPath + 'txtFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the beginning date.");
        document.getElementById(Master2RowPath + 'txtFromDate').focus();
        return false;
    }
    
    if ((isEmpty(Master2RowPath + 'txtToDate') == false) || (document.getElementById(Master2RowPath + 'txtToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the ending date.");
        document.getElementById(Master2RowPath + 'txtToDate').focus();
        return false;
    }
    
    if(compareDate(Master2RowPath + 'txtFromDate', Master2RowPath + 'txtToDate') == false)
    {
        return false;
    }
    
    if(confirm("Are you sure you want to delete selected rooms' availability?"))
    {
        return true;
    }
    else
    {   
        return false;
    }    
    return true;
}

////////////////////////////////////////////////////////////////////
// 특정 기간 동안 예약 수익 현황 보기 페이지 및 예약 검색 페이지
//////////////////////////////////////////////////////////////////// 
function bookingReportChkForm()
{
    // 캘린더 입력값 체크
    if ((isEmpty(Master2RowPath + 'txtFromDate') == false) || (document.getElementById(Master2RowPath + 'txtFromDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the beginning date.");
        document.getElementById(Master2RowPath + 'txtFromDate').focus();
        return false;
    }
    
    if ((isEmpty(Master2RowPath + 'txtToDate') == false) || (document.getElementById(Master2RowPath + 'txtToDate').value == "mm/dd/yyyy"))
    {
        alert("Please enter the ending date.");
        document.getElementById(Master2RowPath + 'txtToDate').focus();
        return false;
    }
    
    if(compareDate(Master2RowPath + 'txtFromDate', Master2RowPath + 'txtToDate') == false)
    {
        return false;
    }
}

////////////////////////////////////////////////////////////////////
// 객실 일자별 가격 업데이트 체크 폼
//////////////////////////////////////////////////////////////////// 
function ChkCurrencyForm()
{
   
    if (isEmpty('txtPrice') == false)
    {
        alert("Please, Enter a Price");
        document.getElementById('txtPrice').focus();
        return false;
    }
    
    if (isEmpty('txtPrice') != false && chkCurrencyNumber('txtPrice') == false)
    {
        alert("The price must be a positive number\nand it can include '.'.");
        document.getElementById('txtPrice').focus();
        return false;
    }
    
    return true;
}