var pmaWidgetInstance611d52af0067a2ef597e376e = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4b5cc6a7492ac35ea8d4748aa43ebc3a:6d0eecc5ce5138d56dc8c2fcd1e1995185aae29790518132867f883b2d4193d4a21cf6b88bd00032977ffe74ecce1cd75abe74b34da389dc04ff708e80ee19c102c4f8a442f53258aac8cb8dc640c81f92f6f6d4b14480fb3a1d91c42e1130655aefee4a1b31627ee8edced6adb939d555d798eccea74cfbcdf3802350eb079de839e43844641054bae9bb313b220907b67cfa60481493d453352d6c092a668da9e06af367e777710827919fcebfb4a8c21b5176e7fc231d52e09e0047a72f9ee80e11b36d4da4b02e83798115d2a67b", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "311,90 €", 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(){ pmaWidgetInstance611d52af0067a2ef597e376e.initWidget("611d52af0067a2ef597e376e"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }