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