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