var pmaWidgetInstance5fce1aefd9685ed27261d056 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=c8918b81f477439d5ffaa4910855b552:383fe162a75e7fd80892b00d4a7090277fe3343186174a4d25ba840378b007e69bc0c40f22ee687659c85d2957a63d88eab4a540b515a252eb775efc1cfd6703c6d5241b3eea79e0bc1f6aa2d67edb1ceb1ea692ddb0b547fcd52e93b1cec3a023970295b805839d100c8054a35a1d8fe1942c1dbf3c51ac3afb38606e50771eb3e7cd950c8cb7d11196706787fb11b033a48080ac33d95b2fbd744a12ac7166a173aa72246ebe9fda5ecf057b1fca15a90626fb49e2f386ee5891ecf78e2403", shop_name: "Guttashop.sk", shop_logo: "https://y1.sk/t/s/130x50/60403.jpg", product_price: "23,35 €", product_shipping: "43,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(){ pmaWidgetInstance5fce1aefd9685ed27261d056.initWidget("5fce1aefd9685ed27261d056"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }