var pmaWidgetInstance6022c749d9685ed2720efcf6 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=bf20cf9a3818543e6b8a1b0a9474ebb2:7980dc8ded131631ee17af9c103bbcff270e16936bbde1ba9f541764288a179e4b4c73cb320f1fd6cd5b8c9c245b71bd0fc899ee8ff6a41435170af61a99527fa102d4af403940bec14a4ddba24afc77d31cec0a5f717ed9f5cfc7a387da76f325fc88f6ede14592a3b27ea58f9b58ceaa417b47169893e3633f3d3331f1721a11f3ec2f18a011ce04dad167f01387f1ec53584119a9a6f7bd26e32e82572c338ebc3ff0969736d8ad52ed91abb49f21ffd95d298a017e1a1262c1f5fc249611e96231ba1ad9ef79a4323d216b278707", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "97,95 €", product_shipping: "2,40 €", 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(){ pmaWidgetInstance6022c749d9685ed2720efcf6.initWidget("6022c749d9685ed2720efcf6"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }