var pmaWidgetInstance610a87ac0067a2ef598e9f74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b6bdad2c80dcb3ebaef3f5af681dac28:aca68ee3f77038ae1bfd75eeaf6d82150a550e7a45fd80f0054c4f5dd87eaa0980cdd58f2357c36fd1df830cb3d5b9e15a3ba3b83d7c5e1ceac4c0194e6d91667d56f49ae7858a9281f27521a10f47ff6da7f6d9957af1e9c673a398a30a9a8ccb4bf7806a84de6419903a1c47ecc17faee9eb936f4c68cb63307c6e9448ac48aeadc2ac0bab31b67d792c0aa0fce0a75d98499ce9d0fcf00a176d546682e39e0858fc76b26f92c91f2ce71e1f85a4e9adb1fa0c96d92f448e622976c33d4f463bbd6fea5f81477a44f284f2f422a070", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "730,90 €", 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(){ pmaWidgetInstance610a87ac0067a2ef598e9f74.initWidget("610a87ac0067a2ef598e9f74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }