var pmaWidgetInstance64dc746642183289057f3d11 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b866abe59bf671072a8e1ff9277331d4:f018ade7fa01d8ef050810edd418b0d2f5771c7542823298b892322dd51bd1874aac7d43b36604af4c6c42a1efcf041fdff975d30082d8dd0ea4db3fff508a18ddea5b120e45e761a7e0caa96293ba3bf0350bb79675ae5572f903626df6ab903355bb7892e807c34d8e840f646b47e32dbffa52b79b0c1d58db5ec759c97c1ea39fdd5607f8951868f668eea674a10f74175c63e8b0ac6f09ea09bf845ccbb1827f5e7c169ad0da75e1a4f4bd4cf507d051821d7e573bcb0efc9049303e7a4930011bff794634a658617b7bef0467a3", shop_name: "alterego.sk", shop_logo: "https://y1.sk/t/s/130x50/3040.jpg", product_price: "15,92 €", product_shipping: "3,00 €", 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(){ pmaWidgetInstance64dc746642183289057f3d11.initWidget("64dc746642183289057f3d11"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }