var pmaWidgetInstance5fbfadf2d9685ed272c61225 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a1cc6ce8de87d90c63a99c92964ae197:66d7c0e1e9945de654f12025219e4fc866038c8559de52cb60618b09684d64bef755e939c6d670f05b8f8cb7bd01577dfdaba9b83b7524ff35a744d091ba1799c7eb42269f85a1d2084bbe4789698a0dbb9e20e0cf9d86ad6eae04802869de156de2dd3abcab87fefaa4db21e1621e9d58f52db2729ffbcf20048500cb95ce98557f08615cbebdf8509519b8d78c71c48c0b090d0c1802755faf26ddcbf2f0e8f37f3d7d66661f2f304146fefd3fb0952179a180f1641ae928367f310d8adb16", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "82,75 €", 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(){ pmaWidgetInstance5fbfadf2d9685ed272c61225.initWidget("5fbfadf2d9685ed272c61225"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }