var pmaWidgetInstance609e58430067a2ef5967e03a = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=b3fef58c3a89636687c1e8bb7472ec8a:e7ea5d952440ea4bb7c8dc56214ef3f5a0bf01cfe11e5303c4de16b5293454f8ec88abffe94c4fa512c299c7612b63e5a53b2dfe33643aa1545e5d6448d18d09af070960dd95f20412ddd71ce29933999d5430430454166521d2d1a76faa8e83f52b2f46b847aa86c0bf0ccd916510ce32ab37fe277b365573f6e27f7c39345e4a657a208572e82f81ef229068ec44a7844acfa37827f0beb7d5b38c58a97cff11f95be1644bdd8c00073dc61f5dda2c3a6cccac5d8a3d8bee2e2fc36bbfe717fcd812c424f540d9e42480da94e32015", shop_name: "nazahradu.sk", shop_logo: "https://y1.sk/t/s/130x50/59114.jpg", product_price: "399,00 €", 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(){ pmaWidgetInstance609e58430067a2ef5967e03a.initWidget("609e58430067a2ef5967e03a"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }