var pmaWidgetInstance6101037a0067a2ef593eca74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4ad5734ad904caa25e8c4d4e1a359bb6:fe09555a917c724c01ecbe81a1b511141ff06fed84c95dc10b75d48568e4556951ff0733af08da7eedcd569b7f45022d8b185039a031b793a55deca96e0f177394caf3fa3af0d5ad789462f9af53f3266dbf0c5af2d19ba45bc6535fdc2378f35edba9281e3e4b5582032665162e9e5638c7a96f8f2c4010dab210c1ddbd7642c5d075dacd5f4d99234c902a200abeda1ca1051e52eee31cf42a172ed9a2a8132145ec6547e94959b67dcb77a751d71384c24d00ab4034a5c39fd152f9c7c8f072f9a5c6bbdd32b7719f6ed23d126b68", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "474,99 €", product_shipping: "0,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(){ pmaWidgetInstance6101037a0067a2ef593eca74.initWidget("6101037a0067a2ef593eca74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }