var pmaWidgetInstance63441d63ac365ae374fb0a6b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c46c8e4adcb495de8e0e0fb068eb01fd:12cca2bf05affb3fa185bb4e11f06a4f0c1bdf3d2caaca2b50b735d30284db4abe1cd9241b581f7952403fabe3db0922685a33522d9e4c9887257d11872333af242bb0ab27fa1442cf6657d9a081d652cd01d74cb226e512c6864031ea26cb45c690f901788a621b55cd988c9285a1a126ce753b5d9a75672335f476036c6c8f10f21757931030f3ce2f12972ac13e29f5e90ab414f021afa6e32eac44559b2d221f232800e63642cff254ad71c7bb842988fad11d2fab7721ab805bea0e3b10eea57b9b43e5558c02c560aef125cdbf", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "679,20 €", product_shipping: "", 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(){ pmaWidgetInstance63441d63ac365ae374fb0a6b.initWidget("63441d63ac365ae374fb0a6b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }