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