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