var pmaWidgetInstance6040c7d5d9685ed272edea88 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c2b1bcc0276b3b5fabe4eb2568008c2a:312baa9f3e88b0fdc7cd08c165ad657189d64098dc67a28df82455b4dafc73f67f0058659365527fdda1414b2d91b2b8e45f2791cdb08e50459a262cd8bc9b8287c77a31f710681eac99352d3e35a7d10cced8ef6a590f6196d8550f261c2c7a5867b5fbeb8c3ad8767101a76fa4d762d4aa148d36474b2e9b22415ca03b7e71e08a555083eef7d390a39c3cc28f553815bd9e941cd2bf14f51f9e6f874700bd54b5ff9472d85b4c9e38589861fbf046c3fb62bc2bf90262250fea0c384afbbdefc4cb3e143c79bd579fe74f8a1c014e", 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); } }