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