var pmaWidgetInstance603f6635d9685ed27240136c = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=3c52d8f9e7130ec7462ddaacd078b8ac:02c6091e61cca6ffb3293742d841bab3a8693fb7e2607494c7feeadb97c7d3ea08352533cd0df0f16f3d15f56799b668e50a6e3d42b91e67035b8c8b2e488267f3b7e49d051d281dd045c8388529989f18c7270cae74a5102288acd2407575d32f85905db02fc04b9a655eec9d90c9979a618ec9ffbf72566598854b3e1814c3653e988ee8e61af245e4074840a1730ee02738760e6947fc6993b91524c621e1bd81dd7f33640f1032b7892d62a8696059e3e5f6acc9c43a99b6258345b94ddf", shop_name: "krmiva.sk", shop_logo: "https://y1.sk/t/s/130x50/10049.jpg", product_price: "82,90 €", product_shipping: "", 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(){ pmaWidgetInstance603f6635d9685ed27240136c.initWidget("603f6635d9685ed27240136c"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }