var pmaWidgetInstance60489342d9685ed2729ebd67 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9935157c979f6d3d4e9c8fac3c7f8f14:2e64b22945d3a5c8302b3009f35b75d183c5d63bdb92539758c7110f8675f2f58c9904ff4f5cb41dc7be18de4e730f5a6a5aca21c331be43f3586f3e688acb576722ed7c8a548f23acd195580eb6c87644f105149ea7ecfe3b79d70ff91220615adc02aa8d0b8b614c7e02975bb416efba86149438238320b89e6a27b073cd31eb52d55895dae83645288589a89b87faccfff49bce3140d15a066feb3a302b5dec8cd48fb833875447f579cf0300f857af3bf3ab4ad07e92d600ed114c56374d3088563b25d91f421156370324b755f4", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "488,99 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance60489342d9685ed2729ebd67.initWidget("60489342d9685ed2729ebd67"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }