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