var pmaWidgetInstance603c9481d9685ed272e4f506 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4f31e577a404e63c1f72844cc83f5a04:dce9b0fdba6ad77d4148e46044d2858e1f62a9b22897137532e8ace37cf44d6f3fb6bf9fc23ec433efd13299d71725902cc6b0ffb333301293a9c9a70fa2a7dd31ff1508799c4ecf1a1c50889d4e1dd88f36a10221e74459c16d9cd4db4a77df431719e8d5bd5f3899d4bfef0c95cc5c0d3e2931a7219c5c080050c65571c99973e59be4510f2a5d1dacc1ee190178c6891e571a0bdb31aafbabc8d39a5b904146523da2887bc5062806c53feb13dbb540a2f33a900db1ed23b3025ea4f4187c1837f47948ccdaa256c6f47ccb5dfd5c", shop_name: "bi-xenony.sk", shop_logo: "https://y1.sk/t/s/130x50/52841.jpg", product_price: "17,40 €", product_shipping: "0,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(){ pmaWidgetInstance603c9481d9685ed272e4f506.initWidget("603c9481d9685ed272e4f506"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }