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