var pmaWidgetInstance603e4122d9685ed27262577f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f02d479b6f936f49759d4d350b084e3e:453267cb248c35c05708c8dcdc72a860314690f6abac7bcad43e4a4b60ef79cdfcf7f060b9711f19b0503f80ea4760e72a5dee620a4aa04966878dd8dd8e87766ea401f16edf1565c8a0b8f06c0bf6b450a439c16ec1028241b947b598715c75277ceaaef10e374385b330497513b98fc7201da042f3cbb35b6019e19820ac6a27ed19c23fb2ddca22440b13dc2818ce0fa25e6c5fe0cb9909ac05974bf6a1e019560ee6cbc356abacf1eb303ee02ed2f2cae9776f3da203a0bcdce071f44f14", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "10,12 €", 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(){ pmaWidgetInstance603e4122d9685ed27262577f.initWidget("603e4122d9685ed27262577f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }