var pmaWidgetInstance64ae74e4421832890530edca = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=78338b6dd9dc247a6edf74b384c1eda7:1c0c84bc07df694a20ed9cb4425942bec29d3849dcaa3ec4a10d8a5824ec790f056a578d7cef617e510284841ae0fc37978193cd9bf9bc5df4998e8e8cd9ff58a552310a20c2c2a533a1e5df36d2d37141dac7df49be2b2ca28de467fffafd3e23b53c2273e503914449e19f3345a929eb7223344c53e7fcb33946d087d8f2e96cf9296db79cbc25a278b04729839da12fdb26d2818c06692e9d61404f985c96fc7ef168154364347b4c66fdb12bd72cb490520899e3d293c124b89032089f5d31b1f34b654d0ed764d4e85dd59bc5f2", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "240,97 €", 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(){ pmaWidgetInstance64ae74e4421832890530edca.initWidget("64ae74e4421832890530edca"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }