var pmaWidgetInstance6033c49ad9685ed2720c53d1 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=790f5ce5f325178cd5840ac4f2f916bc:e1b273242bd44c9be2ff3f29cc58d643a2e5a576d8bb750e0a108d445ff584bbaf47482e736a50f3570602e2c357f6406c690dd13e759c5d7d6ffc4498a0bb5cb69b6b1b81bf04e4cf8f09237b25219092c65f49bb928a97764be6aac332c4d6f6e48fb58aaaf3145126920e672954e0f6bb61c467eb1b7935ebfb31f7fc40f1af34fb6c720153b0416b58a66164fd4a86e12fa3f93aa574c954fbdcbe9289edd1b8c32dc90f16df0766582d5af10925038436432512d29d52f13c0bc364c84a4d238bbc56acf6554fc34496995c9555", shop_name: "arco.sk", shop_logo: "https://y1.sk/t/s/130x50/45797.jpg", product_price: "249,20 €", 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(){ pmaWidgetInstance6033c49ad9685ed2720c53d1.initWidget("6033c49ad9685ed2720c53d1"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }