var pmaWidgetInstance608a70b43975337b9e6f9d5c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3d922b069b1ffdae1ee384b378d78db3:96a9e7cbe07077bf114ed267c9c4159d6edec99912e5764f11bd9d49798f2cb7c63d620b614233e062019961851eb49a857e9e9dace1350bb40b6ce3ac379adf3407e8df971a6a965d1ca82fbf91812b5cbb8413757a895fe81673104948774d347611392dedc7d885f5aeb78000ed2ae87d1dcb66841492da3a05eca75d84201af184fcb0c34cb9213427e37eb8a730106b2145bbee3b1f6e95d26be536313197fdc9ec8b60efb7a92e39abaeb11f067d06771896259eadd46b09a3da6c484c3f40a89ea28221b028ba4e84f93cb115", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "377,94 €", 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); } }