var pmaWidgetInstance608a70b43975337b9e6f9d5c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b94994b817f89f3a83a7bb2d3821af48:1365bd86695a2315fa67e0cec63a68be2ff2731c15b2e84692225d870e5f6d2674cbbb40d8fa62085c7c430a00754a3e046f1380a6a0c9cd412938a1a276b87ec39b9cf8c229582d1e05d1a7623ae12077989e71eb6516b55f13aa52762002bab5007cef87aafc62f6ddb8ddfe1c75cc1cf2c5418fa68badb71585b1a97ab209458f2878a7366d747c50db56e31ddf7066a77dbfb92d4a421e9e06ca41d2442245ee22fa46aeb9868d006798ef9032e7d78a5a977f4f10e98163c9b330d8c8beb5cdd5ac544895dea3e432ec25be2176", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "376,23 €", 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(){ pmaWidgetInstance608a70b43975337b9e6f9d5c.initWidget("608a70b43975337b9e6f9d5c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }