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