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