var pmaWidgetInstance634fcaf9ac365ae374549395 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=37148dc95a6574900d6eebb2263b64ec:6e06c1e40824f1ca85a4f4ca2e016113695e5f04305bbb730762cbf36967932f42705bf0e5e9fbfe4903c48e90e02d8ce50ada4ed70f7b8154c8e7a8392ef6f9a9814b92b9838c0eae9251d50f6c340a70055de7edf47fa6d4d70e32330f68b2acb42c944eca413241bdc824bec884d7cdab11c8211a23c5558fdddb0fb37693fa4c7351b740dfb154dc80983fd614450d9b9e4e7716ccaa1b6fb9b215fc761f43b3705cc88fa886aa896f0e2a3c478a3637a9217973cd19f8924aec17f72415b51519c910bda1222c495134f7ef6a29", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "302,40 €", product_shipping: "2,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(){ pmaWidgetInstance634fcaf9ac365ae374549395.initWidget("634fcaf9ac365ae374549395"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }