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