var pmaWidgetInstance64c0bf8942183289051f336c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3590f92b5b277c8f57bde8700139b928:704cdb7da78527cf85e4a449bfcebf8aa4359c1ad1e1805481f5d07ebbfe65189de89a84f70c8f04c51a0617979b3f196af70f92931b8c76a0ad4af523ab9d58f43745bf4a04f3609d5a51b76122d9fd3dac4917795cf1c8c6e92905ca76aa4c28d3d3c1e398d9ca5bb29217c0029b545e70af141718229a3510f389ad516586f91dc1f10b409939a3ec89055b7ce201bfa0eb27786ac70ea39a86c91f600de7d2559ca61f7aeb3773150a6140c7c5aace11db1c5da24ddb3e54540c2f236f46663bd97a478e3af751b7f6989fc5431e", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "143,53 €", product_shipping: "3,90 €", 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(){ pmaWidgetInstance64c0bf8942183289051f336c.initWidget("64c0bf8942183289051f336c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }