var pmaWidgetInstance603e04eed9685ed272928dea = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=865f80210046a2d4faeb8ca29f2577c4:722467aebe70fc1e4b095ef5352df2d2f18b449e7d6f4bc5203ea4254b5ce86967ce64d3e897fb37dbef9906eaf827ac98e0a4eb3f6b74f52187470bb45906b3e4d863dd83cb6fe3277fd0055864e202626f62792a5ed9cd415d7bd7697d9cb67cfa1d8f0f0aca54e6e1f38c6851081bfb08ef7e4fde1e02e31588e6a6cad74e1e66141c816aa3754ef4a5b91460ae5a1f01d232ac6d0921828df05766ea7eb281ad23d4c1083b0766be6421732e000bef286d152569f601dabed244574a586d", shop_name: "knihyprekazdeho.sk", shop_logo: "https://y1.sk/t/s/130x50/56613.jpg", product_price: "6,00 €", product_shipping: "1,99 €", product_availability: "Skladom", initWidget: function(widgetId){ this.insertLinkToButton(widgetId); }, insertLinkToButton: function(widgetId){ const instance = this; const btns = this.findButtonWidgets(widgetId); for(var btn of btns){ instance.insertButtonVariables(btn); if(btn.tagName == "A"){ btn.href = this.exitLink; btn.target = "_blank"; btn.rel = "nofollow"; } else { btn.onclick = function(event){ event.stopPropagation(); window.open(instance.exitLink); } } } }, findButtonWidgets: function(widgetId){ var currentModalButtons = []; var modalButtons = document.getElementsByClassName(`pma-widget`); for(var modalButton of modalButtons){ if(modalButton.getAttribute('data-id') == widgetId){ currentModalButtons.push(modalButton); } } return currentModalButtons; }, insertButtonVariables: function(element){ element.innerHTML = element.innerHTML.replaceAll("{{shop_name}}",this.shop_name?this.shop_name:""); element.innerHTML = element.innerHTML.replaceAll("{{shop_logo}}",this.shop_logo?this.shop_logo:""); element.innerHTML = element.innerHTML.replaceAll("{{product_price}}",this.product_price?this.product_price:""); element.innerHTML = element.innerHTML.replaceAll("{{product_shipping}}",this.product_shipping?this.product_shipping:""); element.innerHTML = element.innerHTML.replaceAll("{{product_availability}}",this.product_availability?this.product_availability:""); } } docReady(function(){ pmaWidgetInstance603e04eed9685ed272928dea.initWidget("603e04eed9685ed272928dea"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }