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