var pmaWidgetInstance5fcbe9ded9685ed272ed4337 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2d5c3a5577803670ffb1afae23ce7658:c450a137a910acc151ff0163c1646eb362df22adbf889ab6828ca41e2865db0c8a7c4b42e588c05faddd92fa9e0cac032552a9291fb9fe058b1a8061955b49ac89d3d7415c781c9e265237523f626a5d4ecb0572d93fd6d2824afa82bda3d7d772e15fac830af32c3e065dc05e9ec7c622a3691162ff834536bc6a84e78c9b3918c7d6f7061780026f4e20028c1c714dc221ce91a00b1dbfb33ecd8dd5eff319fddeebce246c18b5aa2e21e978378fceeee8e2b48475a3cd28f2b64a65325a69", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "55,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(){ pmaWidgetInstance5fcbe9ded9685ed272ed4337.initWidget("5fcbe9ded9685ed272ed4337"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }