
/**
 * Person form buttons
 */
$(function() {
    $('.bookingPersons.adults label').click(function(e) {
        $(this).find('input').attr('checked', 'checked');
        $('.bookingPersons.adults label').removeClass('checked');
        $(this).addClass('checked');
    });
    $('.bookingPersons.children label').click(function(e) {
        $(this).find('input').attr('checked', 'checked');
        $('.bookingPersons.children label').removeClass('checked');
        $(this).addClass('checked');
    });
});

/**
 * Pre select labels of radio buttons
 */
$(function() {
    $('.bookingPersons.adults input[checked]').parent("label").addClass('checked');
    $('.bookingPersons.children input[checked]').parent("label").addClass('checked');
});




function selectBookingDestination(value, text)
{
    $('#bookingDestination').val(value);
    $('#bookingDestinationText').val(text);
    $('#bookingDestinations').hide();
}

function showbookingDestinations()
{
    $('#bookingDestinations').show();
}

function selectPerson(num)
{
    labels = $('#bookingPersonLabels label');
    $(labels).removeClass('active');
    $(labels[num]).addClass('active');

    fields = $('#bookingPersonLabels input');
    $(fields[num]).attr('checked', 'checked');
}

function selectChild(num)
{
    labels = $('#bookingChildLabels label');
    $(labels).removeClass('active');
    $(labels[num]).addClass('active');

    fields = $('#bookingChildLabels input');
    $(fields[num]).attr('checked', 'checked');
}

function selectCategory(num)
{
    labels = $('#bookingCategoryLabels label');
    $(labels).removeClass('active');
    $(labels[num]).addClass('active');

    fields = $('#bookingCategoryLabels input');
    $(fields[num]).attr('checked', 'checked');
}