(function () { document.addEventListener("DOMContentLoaded", () => { var widgetScript = document.getElementById("ee-inquiry-form-widget"); if (widgetScript) { var providerHash = 'UDU4bjM2S2ZGNUUrWFB3VDNEeSt2akRISzJ6Y3Era3hWQTBHbm5lSFF2UTd3MU5GL2gwZCthQUZmZUpvbjVtSA'; var widgetOrigin = 'https://eventective.com'; var widgetSrc = widgetOrigin + '/providerwidget/widget/frame/' + providerHash; var widgetFrameWrapper = document.getElementById('ee-inquiry-form-widget-wrapper'); if (widgetFrameWrapper !== null) { widgetFrameWrapper.remove(); widgetFrameWrapper = null; } widgetFrameWrapper = document.createElement('div'); widgetFrameWrapper.setAttribute('id', 'ee-inquiry-form-widget-wrapper') widgetFrameWrapper.setAttribute('style', 'background-color: transparent; overflow: hidden;height: 550px;'); var widgetFrame = document.getElementById('ee-inquiry-form-widget-frame'); if (widgetFrame !== null) { widgetFrame.remove(); widgetFrame = null; } widgetFrame = document.createElement('iframe'); widgetFrame.setAttribute('id', 'ee-inquiry-form-widget-frame'); widgetFrame.setAttribute('src', widgetSrc); widgetFrame.setAttribute('allowtransparency', 'true'); widgetFrame.setAttribute('style', 'z-index:9999; display: block; inset: 0px; width: 100%; height: 100%; overflow-y: auto; border: 0px; margin: 0px; padding: 0px; background: transparent;'); widgetFrame.setAttribute('frameborder', '0'); widgetFrame.onload = (e) => { if (e && e.currentTarget && e.currentTarget.contentWindow) { e.currentTarget.contentWindow.postMessage('Message Pump Setup', widgetOrigin); // setup msg pump } } widgetFrameWrapper.append(widgetFrame); widgetScript.after(widgetFrameWrapper); window.addEventListener('message', (evt) => { if (evt.source === window) return; var origin = evt.origin.toLowerCase(); if (origin !== 'https://eventective.com' && origin !== 'http://eventective.com') return; try { var msg = JSON.parse(evt.data); if (msg) { if (msg.messageType) { if (msg.messageType === 'dialogClose') { var widgetFrameWrapper = document.getElementById('ee-inquiry-form-widget-wrapper'); if (widgetFrameWrapper !== null) { widgetFrameWrapper.remove(); } } else if (msg.messageType === 'formDisplayed') { var dataLayer = window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'EventectiveFormDisplayed'}); } else if (msg.messageType === 'formSubmitted') { var dataLayer = window.dataLayer = window.dataLayer || []; dataLayer.push({'event': 'EventectiveFormSubmitted'}); } } } } catch(e){} }); } }); })();