var pmaWidgetInstance6357dd2cac365ae374cd066d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=36a33a3d30f011331146f836f569f6dd:501e2e8029b68fcb78b6a31a12b12bcda5bd24e0b1265d8480550f532f97dafa7334b9443b1d1edb7c036a91cc7c8a6f4391df9eec7c523304c432662de52c6a925b2032d1ae2789983ee07ef11db8b309dbb47673cb2ff99fe0b8cc5519c29cffb8fb4e64cf41fa42dac352e8d5a258caaf3729d48bba96f88d53e3c38d78bf252e5747885d82cd9d15bd164e7ddc17bb2a6507686ecb243fc61389973e798ba6ffe1e49838aca1851fca186e48994c04a1c868f1810ea30bf9cf37b18b0e93ff0facf31b772816cdc834e7c8b79fdd", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "18,68 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6357dd2cac365ae374cd066d.initWidget("6357dd2cac365ae374cd066d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }