var pmaWidgetInstance6017cebfd9685ed27299739f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b63ca1642ac1f91fc762ac22b8bdad81:da423bc5063449d347fa264831aa3eb4dd0d79248e2360f1d3bbd547d696c400ac9e6306bc258721689f6ec4e99e2f945d4f2bcf7ef772e1c424879972ae12149be92b3dea1d8e117891d51979250ad4ee755fdfb59ba996802a4662d4da8ab0149cbdc69a3a1cbb2b054ecbeea9f4d26c128bfa9582c13bc6c659ed61b843be1181bcfcf65c5c37da486a7f168bdc2dca3c4815fb81a125b75e7d2d23a17d5ce5971d4dbf10aad34d6cc26c7a1e8d2af560099cd8aeb87a46d2ca2720c4a7c80a02e4a219e9377223c0f6b637bbcad0", shop_name: "protein-gainer.sk", shop_logo: "https://y1.sk/t/s/130x50/51061.jpg", product_price: "19,51 €", 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(){ pmaWidgetInstance6017cebfd9685ed27299739f.initWidget("6017cebfd9685ed27299739f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }