var pmaWidgetInstance608a6a013975337b9e4ccec9 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f7cb1ab22e85dc100af2783a76f9c2f8:16a28e78db1bb9a59366f016d9ff9162160f90da85331878477b0b16e7ff190437ef6f697d69938fefcf146a839bdad42247d0fa7b39a554a2fa424e50c02309f79f1ee243a29f090158a2422d7d99a3c597808cc1932e3e7c6f6f0289477b0e4cc81352501d94e86bc49d7c39a4a2b57e38b6cd50e7b0836995b010a592a2e082616876f38e9eabfce55684b602c57a275edeca14995f4d8076bee5cf3e721c64c05a30126c48ef8ba9cf93c1113f0ea32a33e6b61a479b0e0ee3dbce8eac28e481347bfc3ae48c3da5495f4a6a3dbf", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "202,95 €", 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(){ pmaWidgetInstance608a6a013975337b9e4ccec9.initWidget("608a6a013975337b9e4ccec9"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }