var pmaWidgetInstance6038e84ad9685ed27250bc0f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b9539f745a250305035382421b121784:d43c49f9d79e0d76a56d450034fa29cb11b9b19da037bb56dbe5b118eee7ca8dfa1c0b6d771a15bb7f89cfd390c107ff92ab34807a7f2c5919db9a17c2a552f5e1f9d5f691cf3a4ead93e8e4a732fa5795e6298b8f1523a30de5f079ecbcf7f657fc0c3efe36a70d0eee820f8f79546c6eb3ea3a404082f7283c0057f9b9d57e893b0113a8e65d05bb4c5bb48b200bda6e8af04c9745737cc7f655a71fa6d8045a8fe6b37554896f65f640e64bcde683e46b6eeb6c1cb9a96d5a9fade8fe7ef9", shop_name: "Helveti.sk", shop_logo: "https://y1.sk/t/s/130x50/59442.jpg", product_price: "735,69 €", 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(){ pmaWidgetInstance6038e84ad9685ed27250bc0f.initWidget("6038e84ad9685ed27250bc0f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }