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