var pmaWidgetInstance60409400d9685ed27203f334 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=19a5780356866adfb065b4bb73e60d88:75d203e01854c676bb628aaf0e96c8ce6c94a4d40924d6b48232ecca4ca2c14070a3a5d165fb900e2be2451af1299f317084a9116c6fbc7faf481f9f08702c39549ca937f16567a05fbfe1e2101f5c9ab2e224bafc7acf2795925432ff306332a9ba4d6c8ef6a3582ebc22658399c6f0c523a14e83cb606b9c3ccfc841fddabefa15624038ab13746dbc174b6f4386b4da9757c9e3feeafd75ec535678c8e20648fc457d9ec722b90615900744ac9be028138a5e9c238f8589f639bc51443b4f1c3ac3eed71182284a42e322fc780a24", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "138,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(){ pmaWidgetInstance60409400d9685ed27203f334.initWidget("60409400d9685ed27203f334"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }