var pmaWidgetInstance603dd10ad9685ed2728e8e9f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=98171a062844d4451c34f7c26c02315e:dcd5fcc3be058a9175a66f0aed995d4c1c456f9b5446a349b1369f319476590ebf287bd3f2c5e32674c34ff8716ae38a0fc0bc85f6afd532a428c7d4c6afbb43ba58dc9b30a8c8a174716cc86113661f9e669ecc75f9e538d91d42a55eb6128c626758319f4740dfa6dbb8a4dff325bf066008466a91fe9f009a43fd12cbb1e0b4868cd4ed727a2c8d8b0ae1b6ec77f7a274e264c4c04abba0cba98b3a78f8ab22c9bb97be55509b034b01c96c9881756a68982bdc0d3ac682423faf6741fca79bad3b2edbb1856e6af4100b9ebaf36f", 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(){ pmaWidgetInstance603dd10ad9685ed2728e8e9f.initWidget("603dd10ad9685ed2728e8e9f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }