var pmaWidgetInstance612532420067a2ef59c44ae4 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=6ab1f8e9ae260365ba5daf233d246b57:585777604c0b07edc7f19fbc497857b99e32d405de2fb97a4fb34eb63a8dcf8eade3ee01c69969948a54d599378417437943655a7d6b1fd35b60d2b0bc30bc962207b5bf2f3adf6b27fc4d5da1b489681881b518819ccf64b440a9700f4c6b458f3878db80f39fa8ce14d7c8a0cbfef3c45cd802c4df6f252c34b6dc35b6c66673d69b6dfc5ad4378d054f2bbdfaca6ef9df6fab12c02af2c2105a494554093a6a53c6dc014e112a6c408605bd19e1b2187022acbb4346e6326336ecdf42d0b0", shop_name: "MobilPC.sk", shop_logo: "https://y1.sk/t/s/130x50/46049.jpg", product_price: "211,30 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance612532420067a2ef59c44ae4.initWidget("612532420067a2ef59c44ae4"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }