var pmaWidgetInstance65098bd24218328905e0cc8f = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=9a32fad215cdde1ef7fa7f33549845fb:876fbe0453a0ab993260d3393c053038d6a17d197bd92cd258ac9f2ffa88230a02ae5ddaf94725137df51d67212941cc8b16b55e7dff21750834a45d68d5c2da84b3bf762c760b856950708b98bf281f28a04f4ac9dcb69641400a116838c9b4675c3756a23f419881f1644cc5020f868303a2fc3695e0c2d566a61d36c81f548267b4e111517a1b08504ace6cf383ebdf266043cd30ce704f6ce2d2f396762c16c6f1e573ecd67fd435be60b77891d4390288e93cd48a5be2bf7d36c71e65f1f6d09c29bf18abd6b07c3c3246d1ec33", shop_name: "kotollacno.sk", shop_logo: "https://y1.sk/t/s/130x50/52905.jpg", product_price: "1936 €", 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(){ pmaWidgetInstance65098bd24218328905e0cc8f.initWidget("65098bd24218328905e0cc8f"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }