var pmaWidgetInstance62fb965d524818ceae230f5f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8cd4c977ca6c5b93be01b70b58969ea0:197e9823a1809f1642fbc3dd619eecb4985a0a94a1ec95aebd0ab5f65ef27655e70fca4d818b6e6b8f23a077b4224de3e61bffdb07c0a788849f874390d54851f7b4aae99bdeea0c5c6e512a28fb864ab81500e09ad2a657882e12e03bc263ae9a1dae31f64763c9dc0143e249bcfbe6394632c1b1fe3c74e5df6f2ce458f924396badfff36669f6c44a1a36fb6d74ebaf173b137d07b90f5c32e5238aa4beacb066f14d33a6161c99fda2c40c64a01210089cc3964a68701baa371519cfcf8f", shop_name: "svetnapojov.sk", shop_logo: "https://y1.sk/t/s/130x50/4380.jpg", product_price: "18,30 €", product_shipping: "4,90 €", 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(){ pmaWidgetInstance62fb965d524818ceae230f5f.initWidget("62fb965d524818ceae230f5f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }