var pmaWidgetInstance5ff3280ad9685ed272f6309a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=522a9b0e9c1bd1c587b8a201e76d8576:9580e9eda57dfadb3e877af703b70076088812675d51c1bf037faa4d0fca321206793e4d17b31481e53f72fa412d6a4b4963308f25028d40d174deda5a4edf6f69f0831582706fdacc1189cad2d1b3a10f794ee982174be674c539b13d3619e00b61ad9a010d6d218c3fb199aefcad9947c50d133bb6f64d07ed1e707cc95f256450d69ebb79bf6fa53d6368c22d4e2afdc090d88328f8460efdab5699d48451259c2dfd5512aa8880cd97453897509116c5a1a158b17ddfa919abaa4f3ac4aa", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "29,99 €", product_shipping: "2,00 €", 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(){ pmaWidgetInstance5ff3280ad9685ed272f6309a.initWidget("5ff3280ad9685ed272f6309a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }