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