var pmaWidgetInstance6305e77e524818ceae27879b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=003d3ed4155536679e43c2df68d699a5:4e1905a1d09ebe8b7a526590c3e49c2a2b4902826177e68495afaa8232845366b24a369f35bdc43d70f8fba93152c653f5bd1afbbc434593a041e8c0e69ecf9db5f3ca555a4454e88ea29bdce6a0b4057fdcf4a4258b505317de3b571fb1d6a71db7fcdcc81bd44bb5151a4ea6fb4ef9d16e66e2f9b1d84692e613a03b8397f1fee6a7b110b33860a24b5f2af59bf263633007fc6c8f1a0574e69d98014634fb7a6671d640df29c73f3042c6a45f70c4ed354edbe574fd0b8dfe6c2e27d594af948044b3a150a62d8b32565551dcc8b4", shop_name: "parfumerka.eu", shop_logo: "https://y1.sk/t/s/130x50/5810.jpg", product_price: "59,90 €", product_shipping: "2,59 €", 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(){ pmaWidgetInstance6305e77e524818ceae27879b.initWidget("6305e77e524818ceae27879b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }