var pmaWidgetInstance608a72763975337b9e788617 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4ce30a7601f012f80401d5233e9bed41:72a1a2ee5230d2cb2d3ad4d3fb4098998016789e1c62111ce1fc25fe4517657d3de1d61ae1f72c1b820f0a96d6db9bfd84b3a2c362b1ee6b9e98ce0d39aac36ab7f1e2eca9e9e8977e217699aa989aed5eb395d48fbd8075df4eb143dc5abd62b999b5bba6de021e59f6153dd8af3918305a9defa0a02bf6a927099883852a6cb796fdba50d36dbff70a30b0fcb31178e56d081a583f473d7d059c394906d33834687cd451894ddf55d1016801a78360a661e831766ed770c5491d955a25be76478c587d9544fa2f61b9b756fc156f27", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "27,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(){ pmaWidgetInstance608a72763975337b9e788617.initWidget("608a72763975337b9e788617"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }