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