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