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