var pmaWidgetInstance5fcdf3c6d9685ed2721bd318 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b3a777a2175942efc09e38dd251201d9:b29745d5aa6f95fa3920289ed3cf55b14773bf786b0fe48c02854a86340fa070d6d14653c176bc8b0615f7719989b9b9db911edfb873075febf0c1b927d8656b8c871d6013e085c30f4fd814502e00fbf57bbf237a869ca5537aea3cdf1b3a3934136457597b6ac11b3ef4155745b3ac67c49623981dbab3fbba087d53779c034bad4d55f9ec8085395c3733b83d435a40cc33d5b53637b245dbec9f6e9b41a6a69bf6d523d11d144b526f77a1d171d96a56bb340a07f77675f2273661f96b26", shop_name: "agropol.sk", shop_logo: "https://y1.sk/t/s/130x50/52935.jpg", product_price: "21,50 €", product_shipping: "0,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(){ pmaWidgetInstance5fcdf3c6d9685ed2721bd318.initWidget("5fcdf3c6d9685ed2721bd318"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }