var pmaWidgetInstance63da5158ac365ae374d86837 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=008b507696422a6b164afde9b58d5e88:85096398f426b0c903d3536721ee2aef61f9d3895e33afd3a3e3971ab814fa8352b17c8e9ee131d3b26bbfd8e7347143d102ac0cca065f38624de1d4cd258edd0c2e3756debfcc3670b612d84bb11169d89c4b685b384cc55f8ab7a385cdc70a212ed12527768d585fd266d4fbf4af13410c45d2ddd7e4927a9be4b3efd3a49baca45cd81727e9192a2c73f78a2e7fcef43809671d299e77915fefa8e28598b0e5534cae6e341eeb6d509166401f0726f10da273737bdd053b38b054143a88feb50d5a46681ce9505240b2cfc3328f66", shop_name: "lacne-nakupy.sk ", shop_logo: "https://y1.sk/t/s/130x50/6164.jpg", product_price: "239,00 €", 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(){ pmaWidgetInstance63da5158ac365ae374d86837.initWidget("63da5158ac365ae374d86837"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }