var pmaWidgetInstance605cad3ad9685ed272754946 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f35443d303a1b877adb1821bb779a803:977b77e6fd50383e211555007fb549a24dbb4b0f0c473bf1a2ad54c605ee834a654d219672de27e0f060af684b3238c6aebae0d55c5f76f798e14197082e5c6c2ee591f75f1c9338042e9eeae4d446f66d5a134df4abee6be1e4785f2bc2258434ca7e1163ae956881b4cf3c206dbddfe8e86865d27d6fe46dda3c40c70dfb281cf818f7d07e60af9caed55110e383bd154f1c6550b9cf03e75284d00244698f6c41bb5342ebe3fb241703d272074568a15889aa771c63940db5249eb59db247882d5b40d25c7a6722b32f28f550d44c", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "754,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(){ pmaWidgetInstance605cad3ad9685ed272754946.initWidget("605cad3ad9685ed272754946"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }