var pmaWidgetInstance6075913fd9685ed272852327 = { debug: false, baseUrl: "https://public.pricemania.sk", exitLink: "https://www.pricemania.sk/exitv2/?data=15a73d1e5a5fd402464a92b6e2de9a41:724573ae689bd5195bf02a66d486a2315a726e1c01d3cda87caf496e5ca140dd90bd43163b4d0135bd0d0e7db09e1a9f9e7458fa213ec3716645edd5c29a94b4e19337613b1a8b901fd4b0fad031e76b9f36bbcfcb32aad030c8831cf297569eea630131a6eb79884648f344daf480be1a93123060a729a34b5f636a50e8d92f947eb2d4adc36fa0279e51f24d317af684fbbba1036df7cbe03ca48ef88ac205d6e063a6fc931845ecf440ce3634565e655a1ee5d2604caad4c205ab62fb824aefc99d48c459354ac9cc8e58d5ff9a01", shop_name: "madmat.sk", shop_logo: "https://y1.sk/t/s/130x50/903.jpg", product_price: "291,50 €", 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(){ pmaWidgetInstance6075913fd9685ed272852327.initWidget("6075913fd9685ed272852327"); }) function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }