var pmaWidgetInstance609411dd0067a2ef59a23d1c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=ab3287bae89ed9b508be4d7b5bfb6df0:fad31093d6823e7c60c1b84a02b956af317797102858ffeac587ee8577d28a2c9b9528594b27a396c60639026c0fa454ac4c592e6fadd282a3332d3f4d723c9f1e8f6d184251cf0d0e6458017bd07e796d31f1d5dd6dd0c93496eb434ba06e03e12131095f4fb57801e8db81d594b0e77622a033ee2fe2f0540f2d98f5e84e5e9194cf3a040bddc9f88dfdcc070e7e644bad5d8dd50245eb7254707a0920196d7a09c449969fe19f9985dbdd779a7b3f3f67c1f7a71fe98c047d1f41c28adca93b028b3b7400b8bf22da5c4aa4c9c575", shop_name: "predomyazahrady.sk", shop_logo: "https://y1.sk/t/s/130x50/47035.jpg", product_price: "344,87 €", product_shipping: "", 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(){ pmaWidgetInstance609411dd0067a2ef59a23d1c.initWidget("609411dd0067a2ef59a23d1c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }