var pmaWidgetInstance6037bb37d9685ed272719cfd = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=51ede26a642e4e6d0708c51249c1d8a8:d341b062753525d53b43e48ebd60b8f64c42e395c5ea1a7169637abbbb78d5effe28bc371f6ca72125086f1af6decb39d45b4ab65c27bc679dcf6073ef525b59aa9eb37f8fece88a39e7d33ffa3f25cc7c297ece4e54512d87a99d0ee26c903614c39e29ba217deb99713606801ded13bc363349816f01c9491141c82453c7f4de1002ca2b2a19099459d1ae978debf392d628d021cf8621f1a01e69167ee61ad39417cef0ae792a21bd21f5d4f41d1fc79352ef66aea5a2ce5b20af555a620fcf7d4a3068d81c7410a38e909edaad0c", shop_name: "najlepsiemobily.sk", shop_logo: "https://y1.sk/t/s/130x50/60405.jpg", product_price: "704,00 €", 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(){ pmaWidgetInstance6037bb37d9685ed272719cfd.initWidget("6037bb37d9685ed272719cfd"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }