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