var pmaWidgetInstance603fde45d9685ed272a7eb46 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=5e7529383ffdd1045392c5e2e90dec68:1690bf0a3dc2151e741ab316c7c963cbea600f0f51dbe85310f0ce79109faf35ea7967d361ec533f47a22a83af7e1619eb3bdb64941addad8226b3be3dca21389fb55e4df7b0f0c0ae7dfe2e9f81f9c03ec8390bf5152782d74541b7cce455871547b051dbe695daae07b193cdbe019d7778ed07d10c52be0e1a918d4233b5c8f3835f906e9749d19d9cd38f0128b484d9954c00addf3ead0f1833c3f4a07d7bad458ff85375d7cb356e5d50cc6c2b1dc6dddb4a2d15b36460eea7921dcaa427a636cfc1b1c0f49af7b37f1d5c770b82", 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(){ pmaWidgetInstance603fde45d9685ed272a7eb46.initWidget("603fde45d9685ed272a7eb46"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }