var pmaWidgetInstance609e17ac0067a2ef59138392 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=cc331efbffdb41d9ddc821e3fa7c9686:5dbadaf99f0bca592d480cd124547f83e1bf1edaa14bff5d7babb6e6912169715094807079aa50fb5af66a9587e03ddb1193dc18fa9dc863ced0b036ab616c2cec2e21310ac33b0eecbfb7f8b8532844a9386e477a610eb2a7f5b944db6e123cf11d2cbbf152ddf1e9c0fc0f1bf6bd12eae1e8c408063824775b68b5acbf7417a9225d37b2482c189221758d07321d7d9afb2dfc7ccb286ffd6c0403ca84be09ec1501d74b4af935bac3c584bb4aab7e0bf31844039bf9fcc0fe2576b3b57ddecb0a34670c518276e3cb99eb0c375de5", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", 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(){ pmaWidgetInstance609e17ac0067a2ef59138392.initWidget("609e17ac0067a2ef59138392"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }