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