var pmaWidgetInstance603dd10ad9685ed2728e8e9f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=66b494c59eb85651429088517c354eab:58894f40026da1491a0de5c4fab55db043331138f5c08b94333e20c5cde9395bfd027d3180df36de52dd8e50494f7ff9e6324eb15c5304d95fafca60d7b32368e2bdc043817d1bdcf0a7cfe13d29087b81e73305dad2c654bc371a3699facdf6f587acf9eac1a8cc185ec807db7a8d63cfac65ad65cfa06b2aa86443db67c4886c7e045025f72b28060e0eb35496c2176dca9427f980aea5d9ace928a006656256dc9cf8e3630a52fdd3d21e12f6cbf91574e71eb02494539f06214eb78a08fb21e027e1383e2cf6056ed609ea384332", 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); } }