var pmaWidgetInstance6038efa8d9685ed27265bc79 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=f8feebe1c0e1f06528e22ca73d49ae8b:fb4089c6960044e449ada4a6d0093026e21d587a89eb736ab2621582b699cdecd3adf9d69a0241b1ebbc439297a5b3ce449f43d1915760bd9219bfa0357ac3e6f648fcff5064628f8a523103f3becf2b104dcf647a20fee532c9e2b40c9a0772e7b94cb5a5065cc948e0f03fdce58fc70d503a3ab7fd474d51d3e68a41be591535d95b3253f4d8eac2c2b23993a5efb2529f2aab771efd8f5f04e79400a51ae4a93b3bb1cdeb9ba3e4fd0f99a52e33267daeddcd6e441f6f42d2c5f55733be8482c070e81e4b84975144a3891799a691", shop_name: "alza.sk", shop_logo: "https://y1.sk/t/s/130x50/215.jpg", product_price: "83,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); } }