var pmaWidgetInstance5fc8e6fdd9685ed272077a32 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=53d8d8a9163d1d19ec8568b8c3d47675:4cdec6f41f5588b82ae286c045cc9019b40ea8dad42b32c54d4c58e6574b0ea21a755f86c3e3f771eca141118f79eb2fff59d433e1d3f181bd438d9c14f94f4b82e2474e5c1265fcb63758cba312add32caf145be0b8d3c536e048e5769ebf5de34eabb2095594c4e8051f52fca42016956508677e9a28f627f920ca60b5e0d140a0301c04b6967b1058bed5085fa3b520dd9d7d8687d33eaca14e7c9ce3c1d34d4bf3a7791de61086d9f56ac77a4c3a4274b8b687b3af4340e607ea33dc8999", shop_name: "andreashop.sk", shop_logo: "https://y1.sk/t/s/130x50/530.jpg", product_price: "164,59 €", 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(){ pmaWidgetInstance5fc8e6fdd9685ed272077a32.initWidget("5fc8e6fdd9685ed272077a32"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }