var pmaWidgetInstance64c0bf8942183289051f336c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=56127ad71f9be7a87af778392954edf2:76600cd52614dcfefd5c04f035852523916b5ba92ef55c964c4132689c9d7583b8a2636c8f85439309dd770a04b6f5bb2b4b13b722208297533c09f7258d6bc4b3204105af8e7aa24fe12e757148a1ed9194b60eeaafea844a020c2c9c178e8b84094448a6adaa8b6ecdb2086d6960cf7e38d87aa15db1a8cfce6a42dfb15719709dbc5680a3c63f123b0cf12667eb78a5833e73d49af1be319ada0a2cb25c986d17306c09b054a11ef47f35fd6492abdaaf5ad72aec0f8f3ea3e6a0aad982ccad2823091c8e8c871e1854a767ddca96", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "145,82 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance64c0bf8942183289051f336c.initWidget("64c0bf8942183289051f336c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }