var pmaWidgetInstance603e0150d9685ed2727ce745 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=79fa95ac421bbe18b04ccc56b68cd03b:1ec7967d43cde17e71ed4b034cd4b3dea40a8e26b9b2b576595ea597da2a9e381c8521ddf9d99e6797ee158cdc11250705bbb5637121b2a0febe1a58bb3e4a8d6992ac52af15ccc6e70197e3e673b2362710cb55aa17fb43659d05e529fdfe4e3ac2bffe86261819a34193c93787f48dc75d75b583925266ad5870e8ff0c3858a7d7aa85beb8a0474a4638fff54b47a21e65b689f1443f80d9b95f50a6bd7dce43ce6eaddbe94e2b66e9c2c055c200e1a9bc70c8b3fcf01734fb4caadd4a8956", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "7,99 €", product_shipping: "", 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(){ pmaWidgetInstance603e0150d9685ed2727ce745.initWidget("603e0150d9685ed2727ce745"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }