var pmaWidgetInstance6022ca97d9685ed272114fb8 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=42ddc839a7e4dd9955b30253259a825c:5280a7fee776df8760b29a95bcffd34f466f5c467cda6fc0b45e9b8776bc6628c341d50486212099e11c625b20951f6cba047ef789c57213024b1bda1504369dbc3fe703e289f73f6163a8073bc0dd65f37c2259a8598c7bb4f96b939529bc2a39e0f02d01c2a49c1912d5cf1fa8f5f6e4aca295a0350d29020cbc3ee377016adaafe9fccd3ecaf13c6a80fffbf294d41dd429e212c32ac42e7f858a4a0ebda33e17000447f785636851bc683e63421e31b960095cb65766d75ef513598b918ca5217d191f6fe72bb76ca319976cc46d", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "300,19 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance6022ca97d9685ed272114fb8.initWidget("6022ca97d9685ed272114fb8"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }