var pmaWidgetInstance6040c7d5d9685ed272edea88 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2cb2fb7b703550205699b92e7c9a0479:cb703ca36add49ce48a2973c4ed9a85148f2b3a237577f7f3c03f9b9323cd0144c006b32c23e041ae873c303528d0e440ff4f5f75c80447a5e283389ef5d8cc984808f1213e404af3d99c03d49fcba42a81296010a0004cb1438906db850e5e4d038cf88b74a6a45a3dd29270489b96c27e082bd696ce6a5186ac18af4c4c92b7b2d9bfed51dcc9c0d632bb5fb25e375f3ae312263e0479bde30ee24c0c26ccf1d9a039f0ac1e3a29e87341458a05a051a0e3b6dd3f4bd7b22b21f965e1d3c60d8f6fa235150129f10cf7c7b4cd7328b", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "61,14 €", 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(){ pmaWidgetInstance6040c7d5d9685ed272edea88.initWidget("6040c7d5d9685ed272edea88"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }