$ = jQuery;
if (typeof jQuery != "undefined") {
$ = jQuery;
}
function format_time(hour, minute) {
var h = hour > 9 ? "" + hour: "0" + hour;
var m = minute > 9 ? "" + minute: "0" + minute;
return h+":"+m;
}
var bookingWidgetController = function () {
return {
config: {
language: $("html").attr("lang") ? $("html").attr("lang").replace(/[-_].*/, '') : $("html").attr("xml:lang").replace(/[-_].*/, ''),
base_url: "//q10-etxarri-dot-q10-campings.appspot.com",
widget_url: "//q10-etxarri-dot-q10-campings.appspot.com/q10widget/",
only_adults: "",
local: false,
dependcencies_added: typeof(bookingWidgetController) == "undefined" ? false : bookingWidgetController.config.dependcencies_added,
datepicker_added: false,
dependencies: [
'jquery-ui',
'main_web_skeleton',
'selectric',
'jquery-i18n'
],
css_list : [
"https://cdn.paraty.es/static_files/common/plugins/dates-selector/css/datepicker_ext_inf.css?v=1.07",
"//q10-etxarri-dot-q10-campings.appspot.com/static_1/css/q10-corpo/booking_widget_q10-corpo.css?v=1.07",
"//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css",
"https://cdn.paraty.es/static_files/common/plugins/pricescalendar/styles.css?v=1.07",
"https://cdn.paraty.es/static_files/common/css/datepicker.redmond/jquery-ui-1.8.16.custom.min.css?v=1.07"
],
/*Special configs*/
avoid_guest_autoclose_click: false
},
init: function () {
this.prepare_dependencies();
},
_getScript: function (url) {
if (this.config.local) {
url = url.replace("https://cdn.paraty.es", "http://localhost:8090");
url = url.replace("/static_files/common/", "/static_1/");
}
return $.getScript(url);
},
prepare_dependencies: function () {
var base_url = bookingWidgetController.config.base_url,
lang = bookingWidgetController.config.language;
if (!bookingWidgetController.config.dependcencies_added) {
let dependenciesToLoad = [];
for (let dependency of bookingWidgetController.config.dependencies) {
switch (dependency) {
case 'jquery-ui':
dependenciesToLoad.push(bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/lib/jquery-ui-1.10.1.custom.min.modified.js?v=1.07"));
break;
case 'main_web_skeleton':
dependenciesToLoad.push(bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/js/mainWebSkeletonAux_injection.js?v=1.07"));
break;
case 'selectric':
dependenciesToLoad.push(bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/lib/selectric/jquery.selectric.1.8.js?v=1.07"));
break;
case 'jquery-i18n':
dependenciesToLoad.push(bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/lib/jquery-i18n-1.1.1/jquery.i18n.js?v=1.07").then(function () {
return bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/i18n/messages_" + lang + ".js?v=1.07").then(function () {
$.i18n.load(messages);
});
}));
break;
default:
console.debug(`[Paraty Injection] Unknown dependency: ${dependency}`);
break;
}
}
$.when(...dependenciesToLoad).done(function () {
bookingWidgetController.get_booking_widget_html();
bookingWidgetController.config.dependcencies_added = true;
});
}
},
get_booking_widget_html: function () {
bookingWidgetController.load_css();
var language_widget = bookingWidgetController.config.language;
$("html").attr("lang", language_widget);
$.get(bookingWidgetController.config.widget_url + bookingWidgetController.config.language, function (e) {
bookingWidgetController.config.widget_html = $("
").html(e);
}).done(function () {
bookingWidgetController.add_widget_html();
bookingWidgetController.add_button_mobile_version_html();
bookingWidgetController.adding_tags_to_config();
bookingWidgetController.load_datepicker();
bookingWidgetController.open_widget();
bookingWidgetController.close_widget();
bookingWidgetController.click_listeners();
if ($("#add_analytics_campaings_tracking") && $("#add_analytics_campaings_tracking").length > 0) {
injectionCampaignsController.init()
}
});
},
load_css: function () {
var list_css = bookingWidgetController.config.css_list;
for (var i = 0; i < list_css.length; i++) {
$('head').append($('').attr('href', list_css[i]));
}
},
add_widget_html: function() {
},
add_button_mobile_version_html: function() {
let target_container = $("#widget_paraty").length ? $("#widget_paraty") : $("#widget-paraty");
target_container.append($("").html($.i18n._("reserva_ahora")));
target_container.find("#full_wrapper_booking").append($(""));
},
load_datepicker: function () {
var lang = bookingWidgetController.config.language,
base_url = bookingWidgetController.config.base_url;
// Refactor in a external function
if (!bookingWidgetController.config.datepicker_added) {
const callback = function () {
bookingWidgetController.after_load_booking_script();
bookingWidgetController.custom_functions();
bookingWidgetController.config.datepicker_added = true;
}
if (bookingWidgetController.config.dependencies.includes('jquery-ui')) {
bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/plugins/pricescalendar/calendar.plugin.js?v=1.07");
bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/js/datepicker/jquery.ui.datepicker-" + lang + ".js?v=1.07").done(function () {
bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/plugins/dates-selector/datepicker_v1.js").done(function () {
_set_datepicker_regional($);
bookingWidgetController.datepicker_configuration();
bookingWidgetController._getScript("https://cdn.paraty.es/static_files/common/scripts/booking_7.js?v=1.07").done(callback);
});
});
} else {
callback();
}
}
},
after_load_booking_script: function() {
if (bookingWidgetController.config.dependencies.includes('jquery-ui')) {
_set_datepicker_regional($);
DP_extend_info.init();
bookingWidgetController.update_date_by_timezone();
}
if (bookingWidgetController.config.dependencies.includes('selectric')) {
$(".room_selector").selectric({disableOnMobile: false});
$(".rooms_number").selectric({disableOnMobile: false});
}
bookingWidgetController.prepare_guest_selector();
bookingWidgetController.adding_room_tag_selector();
bookingWidgetController.set_occupancy_number();
},
update_date_by_timezone: function() {
if ($("#timeLimit").length>0) {
var _limit = $("#timeLimit").val();
var _now = new Date();
var _hour = format_time(_now.getHours(), _now.getMinutes());
if (_hour > _limit) {
_now.setUTCDate(_now.getUTCDate() + 1);
}
var datepicker_sd = $('.' + DP_extend_info.config.class_datepicker_sd);
datepicker_sd.datepicker('option', 'minDate', new Date(_now.getFullYear(),_now.getMonth(),_now.getDate()));
var datestart = _now.getDate()+"/"+(_now.getMonth()+1)+"/"+_now.getFullYear();
updateDates(datestart);
$("input[name='startDate']").val(datestart);
_set_start_date(datestart);
_now.setUTCDate(_now.getUTCDate() + 1);
datepicker_departure_date = $.datepicker.formatDate("dd-mm-yy", _now);
datepicker_departure_date = datepicker_departure_date.replace(new RegExp("-", "g"), '/');
$("input[name='endDate']").val(datepicker_departure_date);
_set_end_date(datepicker_departure_date);
$('.departure_datepicker').datepicker('option', 'minDate', _now);
}
},
datepicker_configuration: function() {
DP_extend_info.config.booking_version = '5';
DP_extend_info.config.hotel_path_endpoint = bookingWidgetController.config.base_url;
bookingWidgetController.separate_entry_departure_datepicker();
DP_extend_info.config.custom_format_day_month = bookingWidgetController.custom_format_date;
},
separate_entry_departure_datepicker: function() {
DP_extend_info.config.start_date_selector = ".entry_date_wrapper";
DP_extend_info.config.end_date_selector = ".departure_date_wrapper";
DP_extend_info.config.start_datepicker_span = ".entry_date_wrapper .date_day";
DP_extend_info.config.end_datepicker_span = ".departure_date_wrapper .date_day";
},
custom_format_date: function(dateComponents) {
dateComponents = dateComponents.split("/");
var month_names = $.datepicker._defaults.monthNames,
html_date = "%d
%m
%y
",
month = (parseInt(dateComponents[1]) - 1);
return html_date.replace("%d", dateComponents[0]).replace("%m", month_names[month]).replace("%y", dateComponents[2]);
},
prepare_guest_selector: function () {
$("select.room_selector").unbind("change");
$("select.room_selector, select.rooms_number").change(function () {
bookingWidgetController.set_occupancy_number();
});
},
adding_room_tag_selector: function () {
$("select.rooms_number option").each(function (index, element) {
var room_tag = parseInt($(element).val()) === 1 ? bookingWidgetController.config.room_tag : bookingWidgetController.config.rooms_tag;
$(element).text($(element).text() + " " + room_tag);
});
if (bookingWidgetController.config.dependencies.includes('selectric')) {
$("select.rooms_number").selectric("refresh");
}
},
set_occupancy_number: function () {
var number_of_rooms = $("select[name='numRooms']").val(),
adults_number = 0,
kids_number = 0,
babies_number = 0;
if (number_of_rooms) {
for (var room_loop = 1; room_loop <= number_of_rooms; room_loop++) {
var actual_select_adults = $("select[name='adultsRoom" + room_loop + "']").val(),
actual_select_kids = $("select[name='childrenRoom" + room_loop + "']").val(),
actual_select_baby = $("select[name='babiesRoom" + room_loop + "']").val();
adults_number += parseInt(actual_select_adults);
kids_number += parseInt(actual_select_kids);
babies_number += parseInt(actual_select_baby);
}
}
var target_placeholder = $(".guest_selector .placeholder_text"),
placeholder_string = bookingWidgetController.occupancy_format_html();
var room_tag = number_of_rooms === 1 ?
bookingWidgetController.config.room_tag : bookingWidgetController.config.rooms_tag;
var adult_tag = adults_number === 1 ?
bookingWidgetController.config.adult_text : bookingWidgetController.config.adults_text;
var kid_tag = kids_number === 1 ?
bookingWidgetController.config.kid_text : bookingWidgetController.config.kids_text;
var baby_tag = babies_number === 1 ?
bookingWidgetController.config.baby_text : bookingWidgetController.config.babies_text;
placeholder_string = placeholder_string.replace("@@N_R@@", number_of_rooms).replace("@@T_R@@", room_tag)
.replace("@@N_A@@", adults_number).replace("@@T_A@@", adult_tag)
.replace("@@N_C@@", kids_number).replace("@@T_C@@", kid_tag)
.replace("@@N_B@@", babies_number).replace("@@T_B@@", baby_tag);
target_placeholder.html(placeholder_string);
},
occupancy_format_html: function() {
var occupancy_string = '';
if (this.config.only_adults) {
occupancy_string = "@@N_A@@ @@T_A@@";
} else {
occupancy_string = "@@N_A@@ @@T_A@@ / @@N_C@@ @@T_C@@";
}
return occupancy_string;
},
open_widget: function () {
$("#floating_button").click(function () {
$("#full_wrapper_booking").fadeIn();
});
},
close_widget: function () {
$("i.fa-times.close_widget").click(function () {
$("#full_wrapper_booking").fadeOut();
});
},
click_listeners: function () {
if (!this.config.avoid_guest_autoclose_click) {
$("html").click(function (event) {
var event_target = $(event.target);
if (!event_target.closest(".room_list_wrapper").length && !event_target.closest(".guest_selector").length) {
$(".room_list_wrapper").slideUp();
}
});
}
},
adding_tags_to_config: function () {
bookingWidgetController.config.adults_text = $("#adults_tag").val();
bookingWidgetController.config.adult_text = $("#adult_tag").val();
bookingWidgetController.config.kids_text = $("#kids_tag").val();
bookingWidgetController.config.kid_text = $("#kid_tag").val();
bookingWidgetController.config.babies_text = $("#babies_tag").val();
bookingWidgetController.config.baby_text = $("#baby_tag").val();
bookingWidgetController.config.room_tag = $("#room_tag").val();
bookingWidgetController.config.rooms_tag = $("#rooms_tag").val();
},
force_start_date: function (forcedStartDateInput) {
function parseDate(dateString) {
const [day, month, year] = dateString.split("/").map(Number);
return new Date(year, month - 1, day);
}
function formatDate(date) {
return date.toLocaleDateString('en-GB'); // Formats as DD/MM/YYYY
}
const inputDateString = forcedStartDateInput.val();
if (!inputDateString) {
console.error("Invalid input date.");
return;
}
const startDate = parseDate(inputDateString);
if (isNaN(startDate.getTime())) {
console.error("Unable to parse the start date.");
return;
}
const endDate = new Date(startDate);
endDate.setDate(endDate.getDate() + 1);
const formattedStartDate = formatDate(startDate);
const formattedEndDate = formatDate(endDate);
const startDateInput = $("input[name='startDate']");
const endDateInput = $("input[name='endDate']");
startDateInput.val(formattedStartDate).trigger("change");
endDateInput.val(formattedEndDate).trigger("change");
window.updateDates(formattedStartDate);
const monthToSearch = startDate.getMonth();
const yearToSearch = startDate.getFullYear();
const price_calendar_v2 = $("#price_calendar_v2") && $("#price_calendar_v2").length;
if (price_calendar_v2) {
document.dispatchEvent(new CustomEvent('updateMonth.price_calendar_v2', {
detail: { month: monthToSearch, year: yearToSearch }
}));
}
},
custom_functions: function(){
}
};
}();
const injectionCampaignsController = (function () {
return {
init() {
this.processCampaignInfo();
},
getUrlParameter(sParam) {
const sPageURL = decodeURIComponent(window.location.search.substring(1));
const sURLVariables = sPageURL.split('&');
for (const sVariable of sURLVariables) {
const [key, value] = sVariable.split('=');
if (key === sParam) {
return value === undefined ? true : value;
}
}
return undefined;
},
createCookie(key, value, durationInDays = 365) {
const targetExpiryDate = new Date();
targetExpiryDate.setDate(targetExpiryDate.getDate() + durationInDays);
document.cookie = `${key}=${value};path=/;expires=${targetExpiryDate.toUTCString()};`;
},
searchCookie(key) {
const cookies = document.cookie.split(';');
for (const cookie of cookies) {
const [cookieKey, cookieValue] = cookie.trim().split('=');
if (cookieKey === key) {
return cookieValue;
}
}
return undefined;
},
saveCampaignInfo() {
const availableCampaignParams = [
'utm_source', 'utm_medium', 'utm_campaign', 'utm_term',
'utm_content', 'utm_id', 'partner'
];
const cookieToSet = {};
availableCampaignParams.forEach(param => {
const retrievedParam = this.getUrlParameter(param);
if (retrievedParam) {
cookieToSet[param] = retrievedParam;
}
});
if (!$.isEmptyObject(cookieToSet)) {
const cookieToSetJson = JSON.stringify(cookieToSet);
this.createCookie("analytics_campaign", cookieToSetJson);
}
},
addCampaignToWidget() {
const retrievedCookie = this.searchCookie('analytics_campaign');
if (!retrievedCookie) return;
const loadedCookie = JSON.parse(retrievedCookie);
$(".paraty-booking-form").each(function () {
for (const [keyCampaign, value] of Object.entries(loadedCookie)) {
const inputToAppend = $("").attr({
name: keyCampaign,
value: value
});
$(this).append(inputToAppend);
}
});
},
processCampaignInfo() {
this.saveCampaignInfo();
this.addCampaignToWidget();
}
};
})();
bookingWidgetController.add_widget_html = function () {
var paraty_widget = bookingWidgetController.config.widget_html;
if (!$("#widget-paraty").length) {
$("body").append($(""));
}
$("#widget-paraty").html(paraty_widget);
$("#widget-paraty #full_wrapper_booking .booking_form_title").append($(".cancel_booking_link"));
const extra_widget_class = $("#widget-paraty input#extra_widget_class").val();
if (extra_widget_class) {
$("#widget-paraty").addClass(extra_widget_class);
}
};
bookingWidgetController.add_button_mobile_version_html = function () {
let target_container = $("#widget_paraty").length ? $("#widget_paraty") : $("#widget-paraty");
target_container.append($("").html($.i18n._("reserva_ahora")));
$("#widget-paraty").find("#full_wrapper_booking").append($(""));
};
bookingWidgetController.occupancy_format_html = function () {
return "@@N_A@@/@@N_C@@/@@N_B@@";
};
bookingWidgetController.custom_format_date = function (dateComponents) {
dateComponents = dateComponents.split("/");
var month_names = $.datepicker._defaults.monthNamesShort,
html_date = "%d
%m
%y
",
month = (parseInt(dateComponents[1]) - 1);
return html_date.replace("%d", dateComponents[0]).replace("%m", month_names[month]).replace("%y", dateComponents[2]);
},
bookingWidgetController.adding_room_tag_selector = function () {
$("select.rooms_number option").each(function (index, element) {
$(element).text($(element).text());
});
$("select.rooms_number").selectric("refresh");
},
bookingWidgetController.close_widget = function () {
$("i.fa-times.close_widget").click(function () {
let booking_wrapper = $("#full_wrapper_booking");
booking_wrapper.parent('#widget-paraty.popup').removeClass('opened');
booking_wrapper.fadeOut(function () {
booking_wrapper.parent('#widget-paraty').removeClass('popup');
});
});
};
function searchCookie(key) {
var encontrado = -1;
var x = document.cookie;
if (x) {
var y = x.split(";");
for (var i = 0; i < y.length; i++) {
encontrado = y[i].search(key);
if (encontrado > -1) {
resultado = y[i].split("=");
return resultado[1];
}
}
}
}
bookingWidgetController.custom_functions = function () {
prepare_guests_selector();
set_occupancy_number();
bookingWidgetController.config.languages = {
"es": "SPANISH",
"en": "ENGLISH"
};
try {
create_link_booking();
} catch (error) {
console.log("[Paraty Widget] Error trying to get the url to booking engine");
}
$('.open_booking_popup').on('click', function () {
let widget_paraty = $('#widget-paraty')
widget_paraty.addClass('popup').addClass('opened');
widget_paraty.find('#full_wrapper_booking').fadeIn();
});
hotel_selector_controller();
filter_selector_controller();
};
bookingWidgetController.config.avoid_guest_autoclose_click = true;
function create_link_booking() {
var link_booking = bookingWidgetController.config.base_url + "/booking1?numRooms=1&adultsRoom1=2" +
"&adultsRoom2=0&adultsRoom3=0&childrenRoom1=0&childrenRoom2=0&childrenRoom3=0&babiesRoom1=0&" +
"babiesRoom2=0&babiesRoom3=0&fromCountry=&language=" +
bookingWidgetController.config.languages[bookingWidgetController.config.language];
$(".paraty-booking-link").each(function () {
$(this).attr("href", link_booking);
});
}
function hotel_selector_controller() {
$("#widget-paraty .destination_wrapper").click(function () {
$("#widget-paraty .hotel_selector").toggleClass("active");
$(this).toggleClass("active");
});
$("#widget-paraty .hotel_selector_option").click(function () {
const hotel_selector = $(this).closest(".hotel_selector");
hotel_selector.removeClass("active");
$("#widget-paraty .destination_wrapper").removeClass("active");
hotel_selector_click($(this));
});
}
function filter_selector_controller() {
$("#widget-paraty .filter_wrapper").click(function () {
$("#widget-paraty .filter_selector").toggleClass("active");
$(this).toggleClass("active");
});
$("#widget-paraty .filter_selector_option").click(function () {
const filter_selector = $(this).closest(".filter_selector");
filter_selector.removeClass("active");
$("#widget-paraty .filter_wrapper").removeClass("active");
filter_selector_click($(this));
});
}
function hotel_selector_click(hotel) {
let hotel_name = hotel.find('.title_selector').text(),
hotel_id = hotel.attr('id'),
hotel_url = $('#url_booking_' + hotel_id).val(),
hotel_namespace = $('#namespace_' + hotel_id).val(),
destination_wrapper = $("#widget-paraty .destination"),
form_wrapper = hotel.closest(".booking_form"),
booking_logo_link = $('#booking_logo_link_' + hotel_id).val();
if (hotel_namespace && hotel_url) {
form_wrapper.attr("action", hotel_url);
form_wrapper.find("#namespace").val(hotel_namespace);
destination_wrapper.val(hotel_name);
}
if (booking_logo_link) {
form_wrapper.find('input[name="custom_logo_link"]').remove();
$('', {
type: 'hidden',
id: 'custom_logo_link',
name: 'custom_logo_link',
value: booking_logo_link
}).appendTo(form_wrapper);
}
}
function filter_selector_click(filter) {
let title_selector = filter.find('.title_selector').text(),
data_filter = filter.attr('data-filters'),
filters_input = $("#widget-paraty input[name='advanced_filters']"),
filters_field = $("#widget-paraty .filters");
if (filters_input) {
filters_field.text(title_selector);
filters_input.val(data_filter);
}
}
function add_room() {
var number_rooms = parseInt($("select.rooms_number").val());
if (number_rooms < 3) {
$($(".selectric-rooms_number .selectricItems li").get(number_rooms)).trigger("click");
set_occupancy_number();
$(".add_remove_room_wrapper .remove_room").removeClass("disabled");
}
if (number_rooms >= 2) {
$(this).addClass("disabled");
}
}
function remove_room() {
var number_rooms = parseInt($("select.rooms_number").val());
if (number_rooms > 1) {
$($(".selectric-rooms_number .selectricItems li").get(number_rooms - 2)).trigger("click");
set_occupancy_number();
$(".add_remove_room_wrapper .add_room").removeClass("disabled");
}
if (number_rooms <= 2) {
$(this).addClass("disabled");
}
}
function prepare_guests_selector() {
$('body').on('click', '.guest_selector, .close_room_selector', function () {
toggle_guest_selector();
});
$("select.room_selector").unbind("change");
$(".room_selector").selectric('destroy');
$(".room_selector").selectric({disableOnMobile: false});
$("select.room_selector, select.rooms_number").change(function () {
set_occupancy_number();
});
var add_room_html = "" + $.i18n._("add_room") + "
" + $.i18n._("T_eliminar") + "
",
close_room_selector = "";
$(".room_list_wrapper").append(add_room_html).append(close_room_selector);
$(".add_remove_room_wrapper .add_room").click(add_room);
$(".add_remove_room_wrapper .remove_room").click(remove_room);
$(".adults_selector .selectric-room_selector .label").click(function () {
plus_room_selector($(this), 0, 8);
});
$(".adults_selector .selectric-room_selector .button").click(function () {
minus_room_selector($(this), 1, 9);
});
$(".children_selector .selectric-room_selector .label").click(function () {
plus_room_selector($(this), -1, 4);
});
$(".children_selector .selectric-room_selector .button").click(function () {
minus_room_selector($(this), 0, 5);
});
$(".babies_selector .selectric-room_selector .button").click(function () {
minus_room_selector($(this), 0, 3);
});
$(".babies_selector .selectric-room_selector .label").click(function () {
plus_room_selector($(this), -1, 2);
});
}
function plus_room_selector(element, min_val, max_val) {
var selectric_element = element.closest(".selectric-room_selector").find("select.room_selector");
if (parseInt(selectric_element.val()) > min_val &&
parseInt(selectric_element.val()) < max_val) {
var new_select_val = parseInt(selectric_element.val()) + 1;
selectric_element.val(new_select_val);
selectric_element.selectric('refresh');
set_occupancy_number();
}
}
function minus_room_selector(element, min_val, max_val) {
var selectric_element = element.closest(".selectric-room_selector").find("select.room_selector");
if (parseInt(selectric_element.val()) > min_val &&
parseInt(selectric_element.val()) < max_val) {
var new_select_val = parseInt(selectric_element.val()) - 1;
selectric_element.val(new_select_val);
selectric_element.selectric('refresh');
set_occupancy_number();
}
}
function toggle_guest_selector() {
var target_room_wrapper = $(".room_list_wrapper");
if (!target_room_wrapper.hasClass('active')) {
target_room_wrapper.addClass('active');
target_room_wrapper.show();
} else {
target_room_wrapper.removeClass('active');
target_room_wrapper.hide();
}
set_occupancy_number();
}
function set_occupancy_number() {
var number_of_rooms = $("select[name='numRooms']").val(),
adults_number = 0,
kids_number = 0,
babies_number = 0;
if (number_of_rooms) {
for (var room_loop = 1; room_loop <= number_of_rooms; room_loop++) {
var actual_select_adults = $("select[name='adultsRoom" + room_loop + "']").val(),
actual_select_kids = $("select[name='childrenRoom" + room_loop + "']").val(),
actual_select_baby = $("select[name='babiesRoom" + room_loop + "']").val();
if (actual_select_adults || actual_select_kids || actual_select_baby) {
adults_number += parseInt(actual_select_adults);
kids_number += parseInt(actual_select_kids);
babies_number += parseInt(actual_select_baby);
}
}
}
var target_placeholder = $(".guest_selector .placeholder_text"),
placeholder_string = "";
adults_number = parseInt(adults_number);
kids_number = parseInt(kids_number);
babies_number = parseInt(babies_number);
placeholder_string += "" + adults_number + " " + $.i18n._('T_adultos') + " / " + kids_number + " " + $.i18n._('T_ninos');
if (babies_number) {
placeholder_string += + " / " + babies_number + " " + $.i18n._('T_bebes');
}
placeholder_string += "";
target_placeholder.html(placeholder_string);
}
if (typeof (booking_widget_initialized) === 'undefined') {
var booking_widget_initialized = true;
bookingWidgetController.init();
}