var pmaWidgetInstance6077eb32d9685ed272643a55 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=0039b984a3697525b76bff0e3b7629c4:a9857da804874d0c4e9db0d4871aad4f545081e700ab954b4687fcda7472765281c844991783f45b494c4dd925ee1a6a428dfea8a3bc1b401b6363b21e69f9a27df43611f42b94dea94dc2497d1338deda3311e208c4d50c64124be675b06549f1fecda5ba9120dcfde91caa7e4bf5b808adfd17854b9c99f37005b53db9df55fd332f6b2bc55bd7167e3b32c1a22b0e7eb8ef4ff11727367cec26036d6131cd169ce8c9988f9a8a5b536a87aa009cce9cb9ad678c35c96b1cf5767c055dcb8f652f8e252945ec5a3ce2da8318596428", shop_name: "elu.sk", shop_logo: "https://y1.sk/t/s/130x50/59355.jpg", product_price: "249,49 €", product_shipping: "0,00 €", 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(){ pmaWidgetInstance6077eb32d9685ed272643a55.initWidget("6077eb32d9685ed272643a55"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }