var ajax = new sack();

function setFlightChildAge(childCount)
{
    // if ajax is launched hide included getRooms file
    ajax.onLoading = showWaitMessageFlightChild;
    // Specifying which file to get
    ajax.requestFile = '/includes/getFlightChildAge.php?childCount='+childCount;
    // Specify function that will be executed after file has been found
    ajax.onCompletion = createFlightChildAge;
    // Execute AJAX function
    ajax.runAJAX();
}

function setInfantAgeSearch(infantCount, type)
{
    // if ajax is launched hide included getRooms file
    ajax.onLoading = showWaitMessageFlightInfant;
    // Specifying which file to get
    ajax.requestFile = '/includes/getInfantAge.php?infantCount='+infantCount+'&type='+type;
    // Specify function that will be executed after file has been found
    ajax.onCompletion = createFlightInfantAge;
    // Execute AJAX function
    ajax.runAJAX();
}

function setHotelRoom(rooms_no, which)
{
        // if ajax is launched hide included getRooms file
        
        ajax.onLoading = showWaitMessageHotel;
        ajax.requestFile = '/includes/getHotelRoomsMain.php?which='+which+'&rooms_number='+rooms_no;    // Specifying which file to get
        ajax.onCompletion = createHotelRooms;   // Specify function that will be executed after file has been found
        ajax.runAJAX();     // Execute AJAX function
}

function setVillaRoom(rooms_no, which)
{
        // if ajax is launched hide included getRooms file
        
        ajax.onLoading = showWaitMessageVilla;
        ajax.requestFile = '/includes/getVillaRoomsMain.php?which='+which+'&rooms_number='+rooms_no; // Specifying which file to get
        ajax.onCompletion = createVillaRooms;   // Specify function that will be executed after file has been found
        ajax.runAJAX();     // Execute AJAX function
}

function setPackageRoom(rooms_no, which)
{
        // if ajax is launched hide included getRooms file
        
        ajax.onLoading = showWaitMessagePackage;
        ajax.requestFile = '/includes/getPackageRoomsMain.php?which='+which+'&rooms_number='+rooms_no;  // Specifying which file to get
        ajax.onCompletion = createPackageRooms; // Specify function that will be executed after file has been found
        ajax.runAJAX();     // Execute AJAX function
}

function createFlightChildAge()
{
    document.getElementById('flightChildAges').innerHTML = ajax.response;
}

function createFlightInfantAge()
{
    document.getElementById('flightInfantAges').innerHTML = ajax.response;
}

function createHotelRooms()
{
  document.getElementById('roomsHotelGroup').innerHTML = ajax.response;
  hide_package_room1();
}

function createVillaRooms()
{
  document.getElementById('roomsVillaGroup').innerHTML = ajax.response;
  hide_package_room3();
}

function createPackageRooms()
{
  document.getElementById('roomsPackageGroup').innerHTML = ajax.response;
  hide_package_room2();
}

function showWaitMessageFlightChild()
{
    document.getElementById('flightChildAges').innerHTML = 'Loading... Please wait';
}

function showWaitMessageFlightInfant()
{
    document.getElementById('flightInfantAges').innerHTML = 'Loading... Please wait';
}

function showWaitMessageHotel()
{
document.getElementById('roomsHotelGroup').innerHTML = 'Loading... Please wait';
}

function showWaitMessageVilla()
{
document.getElementById('roomsVillaGroup').innerHTML = 'Loading... Please wait';
}

function showWaitMessagePackage()
{
document.getElementById('roomsPackageGroup').innerHTML = 'Loading... Please wait';
}