var pmaWidgetInstance603f65aad9685ed2723d4d74 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=2944b0b6c494a8bcab8622e9225f73d8:401263d72042d7f49eca6ae6d82beae7f8911bd1f631b16192c2e790a3acc5ce692d15503b28a70420482852cf65be3d095a5266b2b8171464ccae9e7efd46785e9e31c46e612fed3b6e4fd0fb524c00a140b93f2fe3c575a2913bee6d784439761270e092f3892a40781414c05bd95d8902ac831f24a1da814da3c2a5b0ee1fcda74f404bbc0ab8ff85e091e1be29345a2d32d4939002ee3984d0dfb62ac492de876e3485b71742ea682d7035138f6d46d54e32bd8b8ddf867349e0ff3e1d99", shop_name: "krmiva.sk", shop_logo: "https://y1.sk/t/s/130x50/10049.jpg", product_price: "49,90 €", 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(){ pmaWidgetInstance603f65aad9685ed2723d4d74.initWidget("603f65aad9685ed2723d4d74"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }