var pmaWidgetInstance6054bdeed9685ed2725cc72d = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8b915d00142e59fef4dd63a006802e24:5e93998c98c29e3da8f798c44cf9a96f61dac5c1584201c75c79eae3ddf20460d7499b8b0d9bd7ded330615b18865fab4e4bd1bb0d68c4c34bedfbb4068b065692ee2777f3c500d5a8b2fcebc23ea33c5a10cc257915191d33737550f956f275fb4b2de915a59302b0fb06109a1190cbc6c2430ea5ed55bac1ab7e4f3276b76d9bf8cb96cc39cf0790f317d637d37aaf047fe94ebdf3b9d8bc3f1de8a39d3334a4d36175d162c3b7e0e2f3ed6b405c4e0825fcffe39e821979559549e4d66e1f", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "34,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(){ pmaWidgetInstance6054bdeed9685ed2725cc72d.initWidget("6054bdeed9685ed2725cc72d"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }