var pmaWidgetInstance6038efa8d9685ed27265bc79 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b1d6a6bec6f9ddf854bdfb9ca5b32d53:e3a85e136e3722b604a3f2b0a4cead423e67ae1cfd2aae2366ed4ef37eec421e365914ea3d8d86de53082d34522e8f355022240c4d955ccefd9bee7ba5171d6db07cba4a96d15cf6299b9bde1fc467d09530706faa2e1f872d87c056553b2b3f8811aeeea4c6494cc4bd54dcfc28aedf60f65b2d7809e4adc15303cf50112ff1312702bbd0d8dd57c097b7f8d779f90a113e009fc6499ece361c3e13546ccd4f6d4ef80f81458b2cf77704c51e6ef4c08130ca2753977ac9e3f36b3e4466e441", shop_name: "Extranaradie.sk", shop_logo: "https://y1.sk/t/s/130x50/6646.jpg", product_price: "95,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(){ pmaWidgetInstance6038efa8d9685ed27265bc79.initWidget("6038efa8d9685ed27265bc79"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }