var hotelWidgetController = function () { return { config: { style: "//muni-kyoto-dot-bear-luxe.appspot.com/static_1/css/booking_0_landing.css?v=1.3", base_url: "//muni-kyoto-dot-bear-luxe.appspot.com", language: $("html").attr("lang"), widget_html: "" }, init: function () { this.prepare_dependencies(); }, prepare_dependencies: function () { $('head').append($('').attr('href', hotelWidgetController.config.style)); var url_ajax = hotelWidgetController.config.base_url + "/bearluxehotels/" + hotelWidgetController.config.language + "/"; $.get(url_ajax, function (e) { hotelWidgetController.config.widget_html = e; }).done(function () { $("#paraty_hotels_list_wrapper").html(hotelWidgetController.config.widget_html); }); }, }; }(); function open_map(button) { var data = $(button).data(); if (data['map']) { $("#popup_maps_hotel iframe").attr("src", data['map']); $("#popup_maps_hotel, #map_overlay").fadeIn("fast"); } } function close_map() { $("#popup_maps_hotel, #map_overlay").fadeOut("fast"); } hotelWidgetController.init();