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