var pmaWidgetInstance6069bd60d9685ed272492d17 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a269d8b2a3dd2abc5d97d0372b2681c6:8803e51b035fc7694c7e5f5b4db2891c6e8060e5caef67d1dbbcaaafeb571ca4938c04efea9620f01620cde2a13789d9b5f3c5903cbab0b8948bb13bd81bc3aa7b05fc32064909baa33a79a5e5defd5f880eec00ef8af173ec6b5027242df09d0a013864740983c3886a9d64f565da8bedf599dcb8fa4b52996c04f572fd327f303aaca2051527ca9c2f19fbdf014e9e6975f449fce65fa1f975fa010db02da7648898a54c125b24c8fcd99484f03db1f6beecf72d1f1778d2deebce8108b20189086295ab53842aff209c023be557b9", 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(){ pmaWidgetInstance6069bd60d9685ed272492d17.initWidget("6069bd60d9685ed272492d17"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }