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