var pmaWidgetInstance64ae74e4421832890530edca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=68a6dd26bdbdcaa524bbffcba86c41e5:5cd4083a1be982aa6bd06d3f65abeeb50f1e8471cd46ef9bead3543d13619a0c18b60b66a06c4975dd105ebd3be8d215320046dca1f2f8a6e3807fcc0c7ce6c3a739b8853bb3ec2a23dbcb31b09eeedb3c2dc7cce25c8041f93baf11ffe3785d8bf159879e562fe47a44e1959c85c51d1543e8a8e4bfdf9abe75b016d483a470d56f1fe570df1397729a3e0f263f8e12eecce3a1705d078ce2ee8ac580136ff2b7b293de7d2bce92c48c26149f5d315b7400a4bf34611c5bab340f1b81bf9ffc11cb0108fc62f82e872c8363ac5d3e8e", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "197,50 €", product_shipping: "4,40 €", 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(){ pmaWidgetInstance64ae74e4421832890530edca.initWidget("64ae74e4421832890530edca"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }