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