(function () { var func = Math.floor(Math.random() * 9999999999); var ref = document.getElementsByTagName("script"); for (var i = 0, len = ref.length; i < len; i++) { var script = ref[i]; var src = script.getAttribute("src"); if (src) { var matches = src.match(/promo_id=4320/); } if (src && !script.getAttribute("script-initialized") && matches) { script.setAttribute("script-initialized", true); function getParams() { var params = {}; script.src.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) { params[key] = value; }); return params; } var widget_src = src; var url_params = getParams(); widget_wrapper = document.createElement("div"); widget_wrapper.id = "myrentacar_searchform_wrapper" + func; script.parentElement.insertBefore(widget_wrapper, script); var js = document.createElement("script"); js.src = "https://static.localrent.com/widget/v3/app.js"; js.charset = "utf8"; js.setAttribute("data-mrc", "true"); js.setAttribute("data-affiliate", "634"); js.setAttribute("data-trace", "7912d2d2d8f54009bfa45bd83b-13674"); js.setAttribute("data-apikey", "travelpayouts"); js.setAttribute("data-apisign", "b1e775d64b7c13c7e655bada6f7072b5"); js.setAttribute("data-country", !url_params["country"] ? "124" : parseInt(url_params["country"])); js.setAttribute("data-city", !url_params["city"] ? "" : parseInt(url_params["city"])); js.setAttribute("data-lang", !url_params["lang"] ? "en" : decodeURIComponent(url_params["lang"])); js.setAttribute("data-width", (!url_params["width"] ? "100" : decodeURIComponent(url_params["width"])) + "%"); js.setAttribute( "data-background", !url_params["background"] ? "light" : decodeURIComponent(url_params["background"]) ); js.setAttribute("data-logo", !url_params["logo"] ? "true" : decodeURIComponent(url_params["logo"])); js.setAttribute("data-header", !url_params["header"] ? "true" : decodeURIComponent(url_params["header"])); js.setAttribute("data-gearbox", !url_params["gearbox"] ? "true" : decodeURIComponent(url_params["gearbox"])); js.setAttribute("data-cars", !url_params["cars"] ? "true" : decodeURIComponent(url_params["cars"])); js.setAttribute("data-border", !url_params["border"] ? "true" : decodeURIComponent(url_params["border"])); js.setAttribute("data-footer", !url_params["footer"] ? "true" : decodeURIComponent(url_params["footer"])); widget_wrapper.appendChild(js); break; } } function getCurrentPageUrl() { if (typeof window !== "undefined") { return window.location.origin + window.location.pathname; } return ""; } var currentPageUrl = encodeURIComponent(getCurrentPageUrl()); fetch("https://tpo.gg/bundle?trace_id=7912d2d2d8f54009bfa45bd83b-13674&type=brand_widget&page_url=" + currentPageUrl).catch(console.error); })();