var pmaWidgetInstance602e735ad9685ed27212f357 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=d6d2294f374e256950214c573d7614ce:5d72beee71de21d1f3aa20003659c65d81aa93d142a9d5588a1bbb04a196df02deff52d44a6af096e6e8c6c4a16acfd55ccdbe2853b69cd5f9f57c9ef72db4687a836d4954e0622078d21f5dfac622bd5a2700711e5f1713cd2cabe5fae09dde15591511859ca662e3175f41d15d4cbd3e0e40a90cc740810d2d4cc8dfe5ccdc0fb06130b1f94ed9ed23080ef825af39477387fbbae63aa5f4995e7c961fd5169068eb10313238027a005ccf8a1db25f39f6cf173866dea59bd42a209d194306", shop_name: "MALL.SK", shop_logo: "https://y1.sk/t/s/130x50/135.jpg", product_price: "99,00 €", product_shipping: "2,40 €", 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(){ pmaWidgetInstance602e735ad9685ed27212f357.initWidget("602e735ad9685ed27212f357"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }