var pmaWidgetInstance6357a196ac365ae37440ee84 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0ad33df444cbc98a96306b81ee376fc7:7c3effd550eca314bff75d414d81e44baeacd2603b38fc0828fa9c52912e98df8fca6c2e1f666fc285f5fbd0efba275b7f1a32c4a7aa6a7d45902f0483e920b3885b195012c5e020bb11806c79b755d35338be44073967bfe90abd082995cc295e9f60898890ada5ab752d6179b4fa31d2cec70520a1a48f3c87f2a1ec3b932503a4d90cd859ad8a01a2706a34b3195447396bb63b2b32fa0a42c357b5bbe143977cedf87e2c52ae53e6495db8ffe6a0c2f99b2d12cc2e7afefaf661c850493913e42efd7e32ebf4cef7af451a6db522", shop_name: "KNIHCENTRUM.sk", shop_logo: "https://y1.sk/t/s/130x50/6810.jpg", product_price: "10,36 €", 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(){ pmaWidgetInstance6357a196ac365ae37440ee84.initWidget("6357a196ac365ae37440ee84"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }