var pmaWidgetInstance63579710ac365ae374e6cbab = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bcabf28d354b4366badc6972ee328c8f:cf78d7851736703b43aad43062f8c392b21af925c5126d07fc18bb66504f601c13597c734567bb1ad6a0b31a90fee5ef4b94cf49813e82ebb5e14444250861200bd34128928727b633adbfd66d62d67c3f67248e3743882e3b19ccfd0216b52de4f7c7729eb9b25f7eae99f9abe5ac3806a79d3ab620616e1ac741619e6a4d56a094a1404d3afe8910f0cd0ad937c0554aa9c26837f838da80dddcd2d3bf692c520726807b6375a0606f34de519633bd1ea7df5b62e6612bd2aee30aeb7b8b015faaa2f8031859dc00a30be5ed81120f", shop_name: "bux.sk", shop_logo: "https://y1.sk/t/s/130x50/528.jpg", product_price: "17,11 €", product_shipping: "", product_availability: "", 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(){ pmaWidgetInstance63579710ac365ae374e6cbab.initWidget("63579710ac365ae374e6cbab"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }