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