var pmaWidgetInstance611d52780067a2ef597d4454 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2babaeac166560eaef2cd008195fe8da:7647a8a4efcd3394bbe52031448f92293b77754faf67603a21ff944e1f4a88d384bbdd3b551268496992146178999eb11b4d629abf2f32c7149b902f3192fc778e407274a3ec728eb1f08c8f33369dd30bf1b0d8dbf5f15bb6446d296a165fae09ef44748ccd9275b28495995f686a028e941371bb573496eecae22461a490aac1130acd56c0aa36db6e87199dfa2d97d6766c0348a630cd685b8fc060510491f167e694fbb8827c7145dfeb22ea1e22f3820dd51160e3c402ff800684443683f4b9ffdfd2062a5b7ff6ff408215b218", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "1000 €", 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(){ pmaWidgetInstance611d52780067a2ef597d4454.initWidget("611d52780067a2ef597d4454"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }