var pmaWidgetInstance60daf7910067a2ef59f7f3fc = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=747f3d0d4e52993375d4bf81a95336bf:3696eec5282f30ec3c0aa9c268ee88539f2c3c676601d5301d5d76ad3af431186967596b171ab546f77acb01476b3a6349b2d37d02daa181182db9d7efce460b14a4bd69ba2984e7c11643a6adc9a4c68dd1d00ef21d046ff4e8acb0d5f312648daeb0dbc784343f776b1b3230ad974b843be3d9f5a7254db35c42a52870c732a0c20c5e485c382473c323dce09024645499464006b4c0f7f8c432d00464a79071fb094389fa9e185510aa339e07e3113442298889e6063251f0407187a5aef188ca19f3ff97524a06f5811b4f0b05ac", shop_name: "drmax.sk", shop_logo: "https://y1.sk/t/s/130x50/52053.jpg", product_price: "474,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(){ pmaWidgetInstance60daf7910067a2ef59f7f3fc.initWidget("60daf7910067a2ef59f7f3fc"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }