var pmaWidgetInstance601194c1d9685ed272c13b3d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d19e0bb5b1fb235e862af1659b1db81d:68717efe6c6c5f4d662a670fbf3b5310ea71288fdb8bfd073bc3a10c09dca5b72fa2aef102517021216c3df7246947ca452cec57e3fde3b25ee6f73f63ec412dbbdfc6b785a8a32d5807e48d658f4651badc39f069c5f131d0e421e62bbefbecb928ac745e8ad30e1e5536b616555fb4991b809e7d2f0c84e52ca1d7ade2f6a90e8054d06e409213b665ff8de421aa2a72c01dc6c3a49eb4fe263069edefe1563168a2f0ca4a85152f7900fc3548527417c1947cf0acb6ad92da3b71bfe09278", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "97,40 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance601194c1d9685ed272c13b3d.initWidget("601194c1d9685ed272c13b3d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }