var pmaWidgetInstance63fc7afc4218328905a87f46 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=4816842a8dd3b2517efe008653b507a1:161507a46fb354eaed41c59f15fcbf3a091326e605f175f969117a7309b4b5ccd5ee8772ebf0a74e6e005cbd0784aff643f7bc5130e57b7ee0cfd2f4ce6dadabb5cc8b30fa3c154aa5079493558afc8e22acf50d570835c657403f603be02dc74b722a3db664e2bd99995682ccd9a1b8385f4f4d786450d5f93f1493c1e4c062e35db2e257bb77d5768e17c928cb75fa4c504ea6e7504e296ae298c9f19fac8113deeec8da15f77c8c14cb7a39ffb42fd7060d195dd636ab24c95a38839810b0a48c453a278e1d3222768e59fabc6446", shop_name: "tpd.sk", shop_logo: "https://y1.sk/t/s/130x50/313.jpg", product_price: "1099 €", product_shipping: "0,00 €", product_availability: "", 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(){ pmaWidgetInstance63fc7afc4218328905a87f46.initWidget("63fc7afc4218328905a87f46"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }