var pmaWidgetInstance5ff41b03d9685ed272b32286 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0c19792173e344a91ecd9a8e95a65746:f74c61eee277c603024bf7b49ff66b763ed5dee20ed9d2a2d573f87eb0d4ee1a0464b447aec38d66ecd2d1d8747697734058442e4958dfb0bd63fbd3d838a15639d098ffe1948349eca8372c198722422b9bf25553c2425b0c2d0c62aa213e947e7083593954d89a7726abfc6ac1e3bf85d27590d3d86fbe716b35e5774e84c4c16e6c3c48f845c84993659138e6dd459f7b7ae6435f175477b7eba1ab56ccef25302f2ff1d0fac1533593e1fa0fb63aadec61aed6a6be70e5cb1db3914b0363", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "197,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(){ pmaWidgetInstance5ff41b03d9685ed272b32286.initWidget("5ff41b03d9685ed272b32286"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }