var pmaWidgetInstance63441d63ac365ae374fb0a6b = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=8b1d2790a5c6477f8e01dcf91801efe3:1e68475a3acaac47ca570883f3e1babb148e3276553b0b55492d0f20880b4a32754a95d69ddd1a5c322dbd97d5a384bb1a0dfc2f040136be0a43fe16acc241a01d3ae4a495141e1b50977799bb867d83f113380cf2ff7f9f12244458942ea80cf80d26c4f3ea7b0c142982242a0ec2044e696dbac3d6a1bf8663dec04b704d542c8fac6a13a86ae2264cd6bc62c068ef6e2ce16aa673b4ffe9de097f23535c867f67ec9686bc8e691a8b2aa292ff2010c54ea38797326a464e0c5d772273570d8da24e7c22888f5046bd098c7e4b39e1", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "742,90 €", product_shipping: "", 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(){ pmaWidgetInstance63441d63ac365ae374fb0a6b.initWidget("63441d63ac365ae374fb0a6b"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }