var pmaWidgetInstance61fd4774069a975de59d1606 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bc3996b8e4539d61dc4e47a91b6423d9:3088125acb0a7c650fc1942c9a0b05ead0eb35624a509e112509c7f1665572d12b502ceba27ca77637481f9a5b33332004e6872cebec63da01b439cdaac73f081525ea7ea8f941f82d52fb9c3c4e030437b11228e3c377f26a17db5cc3682eae484bbfe50a3009a5e30a6a695e8b75be2369d7f8ecbd82aa1b2bc4f0e4a9eea23a58b1be22522202e71d9de116ba8d26bb3e9074b5d05bb967d3d51cadaca15ab719d39060098a79db09ccfd427f3925b1e9bb5a4aab161e2463276d72189784ea30a102533f7c4c3774d81d8df40555", shop_name: "obchod.zaciatocnici.sk", shop_logo: "https://y1.sk/t/s/130x50/7879.jpg", product_price: "18,24 €", 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(){ pmaWidgetInstance61fd4774069a975de59d1606.initWidget("61fd4774069a975de59d1606"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }