var pmaWidgetInstance60b7453b0067a2ef59d40751 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3fa4426ed6233790ede8680caf68fe69:71783695213c2ed2f68cc157697f51f28d0409704a5c37fd675b2b3b1fc6e78914a0eec5dfb84d883dd69874bb17b5b81d94321a442521242b2c8ba34c91785e1778b92dff6110515b9a424790baf77a1040238a09f6df953c313a84f149abe37c3eeedbc39366ca486a561b185abf2bd0fc129ec400aacf7cd65a2612cb1614ab957af64de94a9e6479f6f1d75209781aaa7bcc5c7f5fa4568c5097fc5a56bd7dc93224af24400f6c670bd35e9b832a567a247d86e7271ae86f35f24002b7b0a00f0ec230684471bf4cf6563f3abf49", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "313,90 €", 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(){ pmaWidgetInstance60b7453b0067a2ef59d40751.initWidget("60b7453b0067a2ef59d40751"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }