var pmaWidgetInstance6051bd25d9685ed27281a3bf = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=27d81edf07c5c76709f9e635168452e4:f1a4f2954a02b3abc113620930a2d8d0aeec972866e58e7310a630037e657fcc0cd7b038893feb0dcbc18fa5721a25d129fa685c3a703d7f2e02ba00282a2f458a02bef67ef803d3d4e3d5a4bde787694e72f1eb748c62a8eee65ea003cc4b14d621e14a367b084cbeb0efc528a5e6dd68ab214f313a800e4fbb8000538617095659485411e71b4708abd563bc87dbe5f8855ce9ca654e61fed4e6bcca74fb58bab2e627f3483ad1aacb7ee9101dc8400b57c9fb9d4b38b68b1355bbdbdd06f6", shop_name: "MADER.sk", shop_logo: "https://y1.sk/t/s/130x50/9499.jpg", product_price: "160,12 €", product_shipping: "3,99 €", product_availability: "", 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(){ pmaWidgetInstance6051bd25d9685ed27281a3bf.initWidget("6051bd25d9685ed27281a3bf"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }