var pmaWidgetInstance63612ca3ac365ae374943cf5 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=26b05d91cf0e396bac43805e4542586a:a3be606c971785ee02ae607b996d9fb41c25708d8e5d029bbce2c7bbc059a8a1b2c176443392782c9863d473eda434b8b0d41c8a42a9c7981084d80f833ca0c7fd53bd805a0a112d8184f095c6f3dd38893bed0fb3e9f11903eee31102f833f3c8aa025ac97f3e61d42502b173721e330449f7c38c3fff8e06637a86c9642f5629fc5be863fea0cb893ef80597cfa8b9d4d03b20683ebfc57246a8a6cb6f5e734a1ccd4e99601f97b3dfd99860b5013d72c216bae17003634f4b40479a31c26899cf7f14f025094defce071b36521cf5", shop_name: "najpneu.com", shop_logo: "https://y1.sk/t/s/130x50/4568.jpg", product_price: "113,21 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance63612ca3ac365ae374943cf5.initWidget("63612ca3ac365ae374943cf5"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }