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