var pmaWidgetInstance650970284218328905615673 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=64c20b5f3dbe81781a6ae17ffc7c7496:3de0c171851367360dd2e2546ecf0c271290508097d6726aa4e117e48f85d6a6e872d736a6cccdeb5584c78626b32573418d8bd74fb3e9977029f1fc48760e23b0176a1960fd673d65e5652159280d93beb61c7b2b2b5da44b06717b5466065fb47a442e6adba19108b18818c22f1ca441a6b387a5d2371a23acef9fbc46ecd112dc1edb36b01ad9ca3b7613c163dff221eb71fa26e02e0deae488a65b234997daa920f15a0265c15ab2ca1bc7b45abcd70eb4589e0b04f3886c858415eea7366d99981d2ce933eb1b9d6984a9af36f6", shop_name: "stavbaeu.sk", shop_logo: "https://y1.sk/t/s/130x50/45871.jpg", product_price: "383,38 €", product_shipping: "29,90 €", 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(){ pmaWidgetInstance650970284218328905615673.initWidget("650970284218328905615673"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }