var pmaWidgetInstance5fc8edafd9685ed2720f7a75 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=132cd35f4e01bbee61d5e643656bb04e:78073930b2f21485dee3c4242eb61032333ddb343adb578b3cc58144f5e7447fe0bff62163a48e9d0377e698a15042989557bc9a09bb13e27de97e22f9d7122766d5a6080cdfe1f026c6661a699724f2b1415b2d1cf92403f0aa888316164cce88e45640f9484157eada5f8936c3c4bf459d8ba22ea42ce71e7f8a714cf6805b06ee384839ed369259937238d89234434c9d9cf81d0710ea06b9b2c2881232be924a87a0203900a00e2fb8d571a13c9c84b246ce2599cf4f62b307b63915d7b0", shop_name: "alterego.sk", shop_logo: "https://y1.sk/t/s/130x50/3040.jpg", product_price: "34,11 €", product_shipping: "4,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(){ pmaWidgetInstance5fc8edafd9685ed2720f7a75.initWidget("5fc8edafd9685ed2720f7a75"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }