var pmaWidgetInstance654cc94d4218328905064279 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=a96e948e891da2d5f5a857552ec516d7:314338524b422fdbdd67266ccee3bfed624fa1dece04cc2ce425b570dabc3e5bf9697f24c927fc5fbc90738728e08d7810aec8e65f75516293dd3dc3004bdc2030c688aed5ec93698be3427120fe6a066a106b4684704db7e4a8944b0f4acc42481af76f567fe431bbfb690ab321e2eeced7804607480a5f2262171ba0aa1b25cda112ac95b6da26ae4ee2e46d3eab7620a6a52d31f16da15db04c6b8f4624733f1e7af31e2bd20d6f330e76961cf790a8d78790a9bad46c2d6a8c5b9b2a2152e0b10557db7cb8d53a2d64dbb5cfadf3", shop_name: "Arada.sk", shop_logo: "https://y1.sk/t/s/130x50/59720.jpg", product_price: "11,18 €", product_shipping: "2,29 €", 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(){ pmaWidgetInstance654cc94d4218328905064279.initWidget("654cc94d4218328905064279"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }