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