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