Buscar
Cierra este cuadro de búsqueda.
Buscar
Cierra este cuadro de búsqueda.
Buscar
Cierra este cuadro de búsqueda.

Resiliencia energética en el valle de Roaring Fork

  1. Hogar
  2. Noticias
  3. Resiliencia energética en el valle de Roaring Fork

Autores: Emily Goldfield y Mark Dyson

En la tarde del 3 de julio de 2018, se desató un incendio forestal a media milla de la oficina del Rocky Mountain Institute en Basalt, Colorado. Este incendio, denominado Incendio del lago Christine—se extendió hasta abarcar más de 12,500 acres y se produjo a los pocos minutos de cortar el suministro eléctrico en la parte superior del valle de Roaring Fork. Tres de cada cuatro líneas de transmisión que llegan a Aspen cayeron; Si la cuarta línea se hubiera caído, podrían haber pasado días o semanas antes de que se restableciera el suministro eléctrico. El incendio comenzó justo a tiempo para el pico de la temporada turística, cuando miles de visitantes llenaron el valle durante la semana del 4 de julio, un factor que habría exacerbado el impacto de un corte de energía prolongado.

Este evento sirvió como un importante recordatorio para las partes interesadas de todo el valle sobre la importancia de la planificación de la resiliencia. Motivada por esta estrecha llamada, Holy Cross Energy (HCE), la cooperativa eléctrica local que presta servicios a la oficina de Basalt de RMI y a casi 45.000 otros miembros en los valles de Roaring Fork y Eagle River, se ha asociado con RMI para explorar soluciones para aumentar la resiliencia energética en las comunidades. sirven.

Sin embargo, los incendios forestales son sólo una de una multitud de amenazas al sistema energético que están motivando a las comunidades a considerar e invertir en esfuerzos adicionales de resiliencia; Otros fenómenos meteorológicos extremos, amenazas a la ciberseguridad y ataques físicos se encuentran entre otras preocupaciones. En un momento en el que la resiliencia energética es una prioridad para muchas comunidades de todo el mundo, los resultados de esta colaboración entre HCE y RMI pueden servir como modelo útil para comunidades igualmente vulnerables fuera del valle de Roaring Fork.

Las partes interesadas de Roaring Fork Valley se reúnen para identificar soluciones de resiliencia energética basadas en la comunidad

El esfuerzo de HCE y RMI se lleva a cabo en el contexto de innumerables esfuerzos continuos de HCE, sus miembros y otros socios para mitigar y adaptarse a los incendios y otros riesgos de resiliencia. HCE, por su parte, está invirtiendo en nuevas tecnologías y mejoras de infraestructura para fortalecer su sistema de transmisión, entre otras medidas para reducir el riesgo de incendios y desarrollar resiliencia. Paralelamente, muchos miembros de HCE y otros miembros de la comunidad de Roaring Fork Valley ya han invertido en generadores de respaldo que pueden alimentar sus instalaciones críticas en caso de un apagón prolongado.

La colaboración de RMI con HCE tiene como objetivo capturar las sinergias entre estos esfuerzos previamente desconectados y sentar las bases para proyectos de resiliencia que aprovechen las contribuciones tanto de la empresa de servicios públicos como de sus miembros. RMI y HCE están trabajando juntos para sacar a la luz y explorar las prioridades de las partes interesadas con respecto a la resiliencia, identificar oportunidades técnicas y económicas prometedoras y sentar las bases para una acción colaborativa a corto plazo. Durante los últimos meses, RMI ha estado colaborando con organizaciones comunitarias, incluidos servicios de salud y emergencia, gobiernos de ciudades y condados, distritos escolares, proveedores de transporte y empresas privadas, para comprender las prioridades actuales de uso de electricidad, los planes de respaldo que ya existen y las oportunidades para mejora en asociación con HCE u otros miembros de la comunidad.

el 3 de abrilterceroEl mes de enero de 2019, representantes de estas organizaciones se unieron al personal y al liderazgo de RMI y HCE para un taller centrado en encontrar soluciones colaborativas para los problemas de resiliencia del Alto Valle. A través de una serie de presentaciones, debates y sesiones de trabajo facilitadas, los participantes desarrollaron una comprensión compartida de los servicios críticos que dependen de la electricidad y exploraron opciones para soluciones de resiliencia eléctrica.

Al final del día, surgieron varias ideas como posibles proyectos de múltiples partes interesadas maduros para una mayor investigación y acción a corto plazo:

  • Microrredes comunitarias – Las microrredes permitirían a cada comunidad/barrio retener energía de forma independiente en caso de un corte de energía en la red. Este proyecto abarcará microrredes a nivel comunitario y probablemente se centrará inicialmente en el diseño de una microrred piloto en una pequeña región que ya contiene activos de generación.
  • Resiliencia del suministro a granel – Hay una serie de barreras contractuales y operativas que hacen que sea complicado y difícil para HCE y la ciudad de Aspen compartir recursos de generación de electricidad, incluso si una de las empresas de servicios públicos sufre una interrupción que podría ser respaldada por los recursos e infraestructura de la otra. Esta iniciativa involucrará a HCE y la ciudad de Aspen trabajando junto con sus proveedores mayoristas de energía para implementar acuerdos formales para abordar el suministro de energía contingente durante emergencias.
  • Suministro de respaldo para flota de generación móvil/centro de refugio – La mayoría de los centros de refugio/evacuación—particularmente los campus escolares—así como las “cargas críticas secundarias” no tienen energía de respaldo dedicada. Este grupo de trabajo desarrollará dos soluciones: crear un inventario de generadores móviles y un plan para su implementación en estas cargas críticas secundarias durante los cortes, y adquirir autobuses escolares eléctricos que podrían usarse como energía de respaldo para las escuelas.
  • Evaluación energética de servicios críticos – La eficiencia energética es un primer paso importante para cualquier inversión posterior en resiliencia. Este proyecto implicará diseñar un proceso para evaluar el uso de energía de servicios críticos y permitirá a estos proveedores de servicios identificar las medidas de eficiencia energética más efectivas a través de un marco de costos/ahorros/beneficios.
  • Resiliencia de la bomba de gasolina – Cuando se corta la energía, también lo hace la capacidad de bombear gasolina en la mayoría de las estaciones de servicio. Este proyecto explorará el uso de almacenamiento de batería y solar dedicado como energía de respaldo para las bombas de gas para permitir a los clientes continuar bombeando gas durante un apagón, lo que podría ser crítico en caso de una evacuación.
  • Solar de Woody Creek – Se propone desarrollar una granja solar en la región de Woody Creek del valle de Roaring Fork. Este proyecto exploraría oportunidades para diseñar la instalación solar de Woody Creek para brindar beneficios comunitarios resilientes, por ejemplo mediante la inclusión de almacenamiento de baterías o una microrred.
  • Construyendo códigos - Mejorar la eficiencia energética de los edificios reduciría la electricidad necesaria para mantenerlos en funcionamiento durante una emergencia o un apagón. Este grupo de trabajo propuesto investigaría oportunidades para actualizar los códigos de construcción para mejorar la eficiencia y la resiliencia del uso final crítico.

Encontrar oportunidades para obtener valor de “cielo azul” a partir de recursos de “cielo negro”

Una pregunta clave que se planteó a lo largo del taller es cómo HCE, las organizaciones asociadas y las comunidades pueden invertir en tecnologías y recursos que los respalden en caso de una emergencia y, al mismo tiempo, brinden beneficios durante todo el año. Muchos socorristas y otras organizaciones comunitarias informaron que tenían generadores de respaldo de diésel o gas natural; Si bien esta es una forma eficaz y sencilla de garantizar que las luces permanezcan encendidas, la mayoría de las partes interesadas informaron que solo las utilizan unos 30 minutos en total en un año normal.

Eficiencia energética y solar acoplado con almacenamiento Ambos son ejemplos de opciones de resiliencia que pueden proporcionar beneficios durante todo el año. Si bien la eficiencia del uso final no proporciona en sí misma energía durante un apagón, permite prestar servicios más críticos con una capacidad de generación limitada. Durante todo el año, una mayor eficiencia reduce la demanda y los costos de energía. La energía solar y el almacenamiento en el sitio pueden proporcionar energía de respaldo cuando la red falla y no depende del suministro de diésel o gas natural para continuar funcionando. El resto del año, estos sistemas pueden operar conectados a la red, proporcionando valor al reducir las facturas de energía para los propietarios del sistema y potencialmente brindando servicios de red como la regulación de frecuencia.

Este concepto central (la idea de que la resiliencia no se trata solo de preparación para emergencias, sino que debe tener en cuenta una variedad de consideraciones, desde días de cielo azul hasta días de cielo negro) se reflejó en muchas de las ideas que se desarrollaron en el taller, varias de las cuales se centran en sobre eficiencia, energía solar y almacenamiento en baterías.

¿Que sigue?

Muchas de las ideas que surgieron en el taller, descritas anteriormente, se avanzarán a través de grupos de trabajo de múltiples partes interesadas a lo largo de mayo y junio. Cada grupo de trabajo estará dirigido por un líder con el apoyo del personal de RMI y HCE. A mediados de junio, los participantes volverán a reunirse como grupo para presentar su progreso y recibir comentarios unos de otros.

A lo largo del trabajo de RMI en todo el mundo, las mejores y más efectivas soluciones involucran múltiples perspectivas y voces de las partes interesadas. Con suerte, este 4 de julio, la comunidad de Roaring Fork Valley podrá relajarse y disfrutar de las vacaciones sabiendo que sus esfuerzos comunitarios están haciendo que su hogar sea un poco más resiliente.

Si está interesado en mantenerse informado sobre las actualizaciones y los resultados del proyecto, comuníquese con Emily Goldfield en egoldfield@rmi.org.

Compartir:

Sin comentarios

Lo sentimos, el formulario de comentarios está cerrado en este momento.

Artículos Relacionados

Una hoja de ruta hacia una energía más limpia

Una hoja de ruta hacia una energía más limpia Observaciones del presidente y director ejecutivo de Holy Cross Energy, Bryan Hannegan Vea nuestra hoja de ruta de suministro de energía para 2023 (PDF) Recientemente, se han planteado preguntas sobre la capacidad de Holy Cross Energy para satisfacer la demanda de electricidad en nuestro territorio a medida que se produce la electrificación en todo nuestro territorio.

Leer más "

Holy Cross Energy anuncia la lotería para proyectos solares sostenibles calificados por ingresos para 2025/2026

Para publicación inmediata: Jenna Weatherred Vicepresidenta de Relaciones con los miembros y la comunidad 970-947-5470 jweatherred@holycross.com www.holycross.com Holy Cross Energy anuncia la lotería para el programa de energía solar sostenible para personas que califican por sus ingresos en 2025/2026 Glenwood Springs, CO, 1 de septiembre de 2024 – A partir de hoy, los miembros de Holy Cross Energy que califican por sus ingresos pueden enviar una solicitud de lotería para el programa de energía solar sostenible de la cooperativa eléctrica rural.

Leer más "

Holy Cross Energy anuncia los resultados de las elecciones de 2024

Para publicación inmediata: Jenna Weatherred Vicepresidenta, Relaciones con los miembros y la comunidad 970-947-5470 jweatherred@holycross.com www.holycross.com Holy Cross Energy anuncia los resultados de las elecciones de 2024 Glenwood Springs, CO, 7 de junio de 2024—Cooperativa eléctrica rural local Holy Cross Energy (HCE) celebró su reunión anual y elección de la Junta Directiva el 6 de junio.

Leer más "

Nuevos proyectos de energía limpia en 2024

Nuevos proyectos de energía limpia en 2024 2024 marca un hito importante en nuestro camino para proporcionar a nuestros miembros energía limpia 100% para 2030. Estos proyectos a gran escala no solo nos acercan a nuestros objetivos de energía limpia, sino que también conllevan un costo de suministro de energía significativo.

Leer más "

Artículos Relacionados

Una hoja de ruta hacia una energía más limpia

Una hoja de ruta hacia una energía más limpia Observaciones del presidente y director ejecutivo de Holy Cross Energy, Bryan Hannegan Vea nuestra hoja de ruta de suministro de energía para 2023 (PDF) Recientemente, se han planteado preguntas sobre la capacidad de Holy Cross Energy para satisfacer la demanda de electricidad en nuestro territorio a medida que se produce la electrificación en todo nuestro territorio.

Holy Cross Energy anuncia la lotería para proyectos solares sostenibles calificados por ingresos para 2025/2026

Para publicación inmediata: Jenna Weatherred Vicepresidenta de Relaciones con los miembros y la comunidad 970-947-5470 jweatherred@holycross.com www.holycross.com Holy Cross Energy anuncia la lotería para el programa de energía solar sostenible para personas que califican por sus ingresos en 2025/2026 Glenwood Springs, CO, 1 de septiembre de 2024 – A partir de hoy, los miembros de Holy Cross Energy que califican por sus ingresos pueden enviar una solicitud de lotería para el programa de energía solar sostenible de la cooperativa eléctrica rural.

Holy Cross Energy anuncia los resultados de las elecciones de 2024

Para publicación inmediata: Jenna Weatherred Vicepresidenta, Relaciones con los miembros y la comunidad 970-947-5470 jweatherred@holycross.com www.holycross.com Holy Cross Energy anuncia los resultados de las elecciones de 2024 Glenwood Springs, CO, 7 de junio de 2024—Cooperativa eléctrica rural local Holy Cross Energy (HCE) celebró su reunión anual y elección de la Junta Directiva el 6 de junio.

Nuevos proyectos de energía limpia en 2024

Nuevos proyectos de energía limpia en 2024 2024 marca un hito importante en nuestro camino para proporcionar a nuestros miembros energía limpia 100% para 2030. Estos proyectos a gran escala no solo nos acercan a nuestros objetivos de energía limpia, sino que también conllevan un costo de suministro de energía significativo.

" + "" + "" + //ENG-1082 "\"" + chatbtn_tooltip_text + "\""; /* " "; */ doc.getElementById("widgetlbtn").style.color = color; doc.getElementById("widgetlbtn").style.backgroundColor = msg.widgetcolor; doc.getElementById("widgetlbtn").style.display = 'block'; count = count != undefined ? count : 0; var chatbtn_badge_counter = IMILocalisation.getValue(msg.widget_lang, "badge_counter_unread_messages", "Livechat Button - {0} unread messages"); chatbtn_badge_counter = chatbtn_badge_counter.replace("{0}", count) doc.getElementById("spnwidgetlbtn").setAttribute("aria-label", chatbtn_badge_counter); doc.getElementById("widgetlbtn").addEventListener('click', function () { console.log("switchicon called"); if (parent.IMIChatInit != undefined) { parent.IMIChatInit.chatswitchicon(); } else { IMIChatInit.chatswitchicon(); } }); doc.getElementById("widgetlbtn").addEventListener('keydown', function (e) { if (e.key === 'Tab' && !e.shiftKey) { e.preventDefault(); var widgetmainIframe = window.parent.document.getElementById("iframechatwindow"); if (document.getElementById("divchatmain").style.display == "block") { widgetmainIframe.contentWindow.postMessage({ action: 'widgetbuttonkeypress', }, "*"); } this.blur(); } }); document.getElementById('imi-chatbutton').style.display = "block"; //console.log( doc.getElementById("widgetlbtn")); /*$('[data-toggle=\"tooltip\"]').tooltip();*/ // doc.close(); /* for test */ var launch_livechat_iframe_title = IMILocalisation.getValue(_IMIchat_widget_lang, "launch_livechat_iframe_title", "Launch Livechat"); var livechat_widget_iframe_title = IMILocalisation.getValue(_IMIchat_widget_lang, "livechat_widget_iframe_title", "Livechat widget"); $("iframe#imi-chatbutton").attr('title', launch_livechat_iframe_title); $("iframe#iframechatwindow").attr('title', livechat_widget_iframe_title); var doc1 = document.getElementById('chatunread-frame').contentWindow.document; // doc1.open(); doc1.head.innerHTML = "" + "" + ""; //ENG-985 doc1.body.innerHTML = "
"; // ""+ //"" + //""; //doc1.close(); doc1.getElementsByTagName('html')[0].classList.add('imichatmsgpreview'); doc1.getElementById("ancclearcards").addEventListener('click', function () { if (parent.IMIChatInit != undefined) { parent.IMIChatInit.clearmsgcards(); } else { IMIChatInit.clearmsgcards(); } }); doc1.getElementById("greetingancclearcards").addEventListener('click', function () { if (parent.IMIChatInit != undefined) { parent.IMIChatInit.cleargreetingmsgcards(); } else { IMIChatInit.cleargreetingmsgcards(); } }); document.getElementById('chatunread-frame').style.display = "block"; this.bindGreetingMessage(msg); IMIGeneral.storeLocal("style_" + document.getElementById("divicw").getAttribute("data-bind") + "_" + window.location.hostname, msg); document.getElementById('chatbutton').style.display = "block"; } else { document.getElementById("divicw").innerHTML = ''; } } catch (e1) { } }, bindGreetingMessage: function (data) { if (sessionStorage.getItem("webex_engage_greetingmessage_shown") != null && sessionStorage.getItem("webex_engage_greetingmessage_shown") != undefined) { return; } if (data.greetingmessage == undefined || data.greetingmessage == null || data.greetingmessage == '') { return; } var node = document.createElement("div"); var node1 = document.createElement("div"); var textnode = document.createTextNode(IMIChatInit.extractContent(data.greetingmessage)); node.className = "msg"; node.style = "cursor:pointer;"; node.setAttribute("tabindex", "0"); //ENG-1065 and ENG-3621 for tabindex node1.className = "msgclear"; node.id = "msg_greetingmessage"; // Create a text node node1.id = "msgclear_greetingmessage"; node1.style = "clear:both;"; node1.addEventListener('click', function () { console.log("switchicon called"); if (parent.IMIChatInit != undefined) { parent.IMIChatInit.chatswitchicon(); } else { IMIChatInit.chatswitchicon(); } }); node.addEventListener('click', function () { console.log("switchicon called"); if (parent.IMIChatInit != undefined) { parent.IMIChatInit.chatswitchicon(); } else { IMIChatInit.chatswitchicon(); } }); node1.addEventListener('keydown', function (e) { if (e.which != 13) return; console.log("switchicon called via keydown"); e.stopPropagation(); e.preventDefault(); node1.click(); }); node.addEventListener('keydown', function (e) { if (e.which != 13) return; console.log("switchicon called via keydown"); e.stopPropagation(); e.preventDefault(); node.click(); }); var span = document.createElement("span"); span.innerHTML = '' + data.name + ':'; node.appendChild(span); node.appendChild(textnode); var referenceNode = document.getElementById('chatunread-frame').contentWindow.document.getElementById("greeting-msg-list"); // document.querySelector('#some-element'); referenceNode.setAttribute("aria-label", "Chat message from"); referenceNode.appendChild(node); referenceNode.appendChild(node1); document.getElementsByClassName("main-unreadchat-cont")[0].style.height = "100%"; document.getElementById('chatunread-frame').contentWindow.document.getElementById("greetingancclearcards").style.display = "block"; sessionStorage.setItem("webex_engage_greetingmessage_shown", 1) }, bindCookieConsentGreetingMessage: function (hue, saturation, lightness1, lightness2) { if (sessionStorage.getItem("webex_engage_greetingmessage_shown") != null && sessionStorage.getItem("webex_engage_greetingmessage_shown") != undefined) { return; } if (cookieConsentWidgetOptions.greetingMessage == undefined || cookieConsentWidgetOptions.greetingMessage == null || cookieConsentWidgetOptions.greetingMessage == '') { return; } var doc1 = document.getElementById('chatunread-frame').contentWindow.document; doc1.head.innerHTML = "" + "" + ""; doc1.body.innerHTML = "
" + cookieConsentWidgetOptions.displayName + "" + cookieConsentWidgetOptions.greetingMessage + "
"; doc1.getElementsByTagName('html')[0].classList.add('imichatmsgpreview'); document.getElementById('chatunread-frame').style.display = "block"; document.getElementsByClassName("main-unreadchat-cont")[0].style.height = "100%"; document.getElementById('chatunread-frame').contentWindow.document.getElementById("greetingancclearcards").style.display = "block"; sessionStorage.setItem("webex_engage_greetingmessage_shown", 1); var node1 = doc1.getElementById('msgclear_greetingmessage'); var node = doc1.getElementById('msg_greetingmessage'); var referenceNode = doc1.getElementById('greeting-msg-list'); referenceNode.setAttribute("aria-label", "Chat message from"); node1.addEventListener('keydown', function (e) { if (e.which != 13) return; console.log("switchicon called via keydown"); e.stopPropagation(); e.preventDefault(); node1.click(); }); node.addEventListener('keydown', function (e) { if (e.which != 13) return; console.log("switchicon called via keydown"); e.stopPropagation(); e.preventDefault(); node.click(); }); }, loadCookieConsentWidgetStyles: function () { try { if (cookieConsentWidgetOptions != '' && cookieConsentWidgetOptions != undefined && cookieConsentWidgetOptions != null && cookieConsentWidgetOptions != 'null') { buttonType = cookieConsentWidgetOptions.buttonType; var color = "#ffffff"; var lightness1 = 0; var lightness = 0; try { var widgcolor = cookieConsentWidgetOptions.widgetColor; r = parseInt(widgcolor.substr(1, 2), 16); g = parseInt(widgcolor.substr(3, 2), 16); b = parseInt(widgcolor.substr(5, 2), 16); hue = IMIGeneral.rgbToHsl(r, g, b)[0] * 360; saturation = IMIGeneral.rgbToHsl(r, g, b)[1] * 100; lightness = IMIGeneral.rgbToHsl(r, g, b)[2] * 100; lightness1 = lightness + 10; lightness2 = 95; var lightness3 = 98; var lightness4 = lightness + 10; if (lightness > 80) { color = "#333333"; } } catch (e1) { } var badgecount = " {1} "; badgecount = badgecount.replace("{0}", "style=\"display:none;\"").replace("{1}", ""); var chatbtn_tooltip_text = IMILocalisation.getValue(cookieConsentWidgetOptions.widgetLang, "chat_button_tooltip", "Live Chat"); _IMIchat_widget_lang = cookieConsentWidgetOptions.widgetLang; var doc = document.getElementById('imi-chatbutton').contentWindow.document; doc.body.innerHTML = "" + "" + "" + "" + "" + ""; doc.getElementById("cookieconsentwidgetlbtn").style.color = color; doc.getElementById("cookieconsentwidgetlbtn").style.backgroundColor = cookieConsentWidgetOptions.widgetColor; doc.getElementById("cookieconsentwidgetlbtn").style.display = 'block'; doc.getElementById("cookieconsentwidgetlbtn").addEventListener('click', function () { if (parent.IMIChatInit != undefined) { parent.IMIChatInit.chatcookieconsentswitchicon(); } else { IMIChatInit.chatcookieconsentswitchicon(); } }); document.getElementById('imi-chatbutton').style.display = "block"; document.getElementById('chatunread-frame').style.display = "block"; doc.getElementById("cookieconsentwidgetlbtn").addEventListener('keydown', function (e) { if (e.key === 'Tab' && !e.shiftKey) { //debugger; e.preventDefault(); var widgetmainIframe = window.parent.document.getElementById("iframecookieconsentwindow"); if (document.getElementById("divchatmain").style.display == "block") { widgetmainIframe.contentWindow.postMessage({ action: 'cookieconsentbuttonkeypress', }, "*"); this.blur(); } } }); this.bindCookieConsentGreetingMessage(hue, saturation, lightness1, lightness2); var launch_livechat_iframe_title = IMILocalisation.getValue(_IMIchat_widget_lang, "launch_livechat_iframe_title", "Launch Livechat"); document.getElementById("imi-chatbutton").setAttribute('title', launch_livechat_iframe_title); var livechat_widget_iframe_title = IMILocalisation.getValue(_IMIchat_widget_lang, "livechat_widget_iframe_title", "Livechat widget"); document.getElementById("iframecookieconsentwindow").setAttribute('title', livechat_widget_iframe_title); document.getElementById('chatbutton').style.display = "block"; } else { document.getElementById("divicw").innerHTML = ''; } } catch (e1) { } }, acceptCookies: function (element) { if (IMIChatInit.checklocalStorage()) { localStorage.setItem("webex_engage_cookieconsent_accepted", 1); cookie_consent_accepted = 1; IMIChatInit.init(); } else { document.getElementById("divicw").innerHTML = "
\n \n \nError:
Cookies Disabled

We use cookies to enable best chat experience. Follow these directions to re-enable cookies specific to your browser type or re-open this website in a cookie-enabled browser.

"; console.log("Local storage not supported"); } }, chatswitchicon: function (type) { console.log("Chatswitchicon::" + type); try { var referenceNode = document.getElementById('chatunread-frame').contentWindow.document.getElementById("greeting-msg-list"); if (referenceNode != undefined && referenceNode != null) referenceNode.removeAttribute('aria-label'); /*type=1-max and 0- min */ var isMobile = "0"; // if (window.innerWidth > 768) { // document.getElementById('divchatmain').className = 'main-chat-cont'; // } else { // document.getElementById('divchatmain').className = 'main-chat-cont chatmobile'; // isMobile="1"; // } if ((navigator.userAgent.indexOf("Mobile")) != -1) { isMobile = "1"; } sessionStorage.setItem("webex_engage_data-bind", document.getElementById("divicw").getAttribute("data-bind")); sessionStorage.setItem("webex_engage_data-org", document.getElementById("divicw").getAttribute("data-org")); var iframe = document.getElementById('imi-chatbutton'); if (iframe == null || iframe == undefined) return; var innerDoc = iframe.contentDocument || iframe.contentWindow.document; //Open Widget if (document.getElementById("divchatmain").style.display === 'none' && (type == 1 || type == 2 || type == undefined)) { document.getElementById("divchatmain").style.display = "block"; IMIGeneral.checkmobile(); var widgetmain = document.getElementById("iframechatwindow");//ENG-1034 widgetmain.contentWindow.focus();//ENG-1034 widgetmain.contentWindow.postMessage({ action: 'widgetbuttonkeypress', }, "*"); //if ((window.outerWidth < 497) && (document.documentElement.classList.contains('imichatmobile-active') == false) && document.getElementById("divchatmain").style.display == "block") { var className = " " + document.documentElement.className + " "; if ((window.outerWidth < 700) && (" " + className + " ").replace(/[\n\t]/g, " ").indexOf("imichatmobile-active") > -1 && document.getElementById("divchatmain").style.display == "block") { // if((document.documentElement.classList.value.split(/\s+|\./).filter(word => word === 'imichatmobile-active').length==1) == false){ document.documentElement.classList.remove("imichatmobile-active"); document.documentElement.className = document.documentElement.className + " imichatmobile-active"; // } } else { document.documentElement.className = document.documentElement.className.replace(' imichatmobile-active', ''); } document.getElementById('chatunread-frame').style.display = "none"; innerDoc.getElementById("widgetlbtn").setAttribute("class", "open-btn state1 " + buttonType + " close-btn"); // innerDoc.getElementById("widgetlbtn").setAttribute("aria-label", "Close web chat"); innerDoc.getElementById("widgetlbtn").setAttribute("aria-expanded", "true"); document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").style.display = "none"; document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").innerText = ""; localStorage.setItem(fingerprint + "_" + _skey + "_badgecount", 0); localStorage.setItem(fingerprint + "_" + _skey + "_cardcount", 0); var clear_badgecounter = IMILocalisation.getValue(_IMIchat_widget_lang, "badge_counter_unread_messages", "Livechat Button - {0} unread messages").replace("{0}",0); innerDoc.getElementById("spnwidgetlbtn").setAttribute("aria-label", clear_badgecounter); IMIChatInit.clearmsgcards(); IMIChatInit.cleargreetingmsgcards(); // if (IMIGeneral.getBrowserName() == "safari") { // if (IMIGeneral.detectIOS()) { // document.body.classList.add('chatnoscroll'); // } // } if (type === undefined) { var destination = document.getElementById('iframechatwindow').contentWindow; msg = { "action": "showiframe", "host": window.location.hostname, "chatmobile": isMobile }; destination.postMessage(msg, domainUrl); document.getElementById("iframechatwindow").setAttribute("aria-hidden", "false"); } return; } //Close Widget if (document.getElementById("divchatmain").style.display === 'block' && (type == 0 || type == 2 || type == undefined)) { document.documentElement.className = document.documentElement.className.replace(' imichatmobile-active', ''); //document.body.classList.remove('chatnoscroll'); document.getElementById("divchatmain").style.display = "none"; innerDoc.getElementById("widgetlbtn").setAttribute("class", "open-btn state " + buttonType); innerDoc.getElementById("widgetlbtn").setAttribute("aria-expanded", "false"); innerDoc.getElementById("widgetlbtn").focus(); innerDoc.getElementById("cookieconsentwidgetlbtn").focus(); document.getElementById('chatunread-frame').style.display = "block"; localStorage.setItem(fingerprint + "_" + _skey + "_cardcount", 0); document.getElementById("iframechatwindow").setAttribute("aria-hidden", "true"); return; } //var iframeEl = document.getElementById("iframechatwindow"); // Make sure you are sending a string, and to stringify JSON // iframeEl.contentWindow.postMessage("hello", '*'); return; } catch (e) { console.log("LaunchProactiveMsgManager:" + e.msg); } }, chatcookieconsentswitchicon: function (type) { try { var referenceNode = document.getElementById('chatunread-frame').contentWindow.document.getElementById("greeting-msg-list"); if (referenceNode != undefined && referenceNode != null) referenceNode.removeAttribute('aria-label'); var isMobile = "0"; if ((navigator.userAgent.indexOf("Mobile")) != -1) { isMobile = "1"; } var iframe = document.getElementById('imi-chatbutton'); if (iframe == null || iframe == undefined) return; var innerDoc = iframe.contentDocument || iframe.contentWindow.document; //Open Widget if (document.getElementById("divchatmain").style.display === 'none' && (type == 1 || type == 2 || type == undefined)) { document.getElementById("divchatmain").style.display = "block"; IMIGeneral.checkmobile(); var widgetcookieconsent = document.getElementById('iframecookieconsentwindow').contentWindow; widgetcookieconsent.postMessage({ action: 'cookieconsentbuttonkeypress', }, "*"); var className = " " + document.documentElement.className + " "; //if ((window.outerWidth < 700) && (" " + className + " ").replace(/[\n\t]/g, " ").indexOf("imichatmobile-active") > -1 && document.getElementById("divchatmain").style.display == "block") { // // if((document.documentElement.classList.value.split(/\s+|\./).filter(word => word === 'imichatmobile-active').length==1) == false){ // document.documentElement.classList.remove("imichatmobile-active"); // document.documentElement.className = document.documentElement.className + " imichatmobile-active"; // // } //} else { // document.documentElement.className = document.documentElement.className.replace(' imichatmobile-active', ''); //} document.getElementById('chatunread-frame').style.display = "none"; innerDoc.getElementById("cookieconsentwidgetlbtn").setAttribute("class", "open-btn state1 " + buttonType + " close-btn"); innerDoc.getElementById("cookieconsentwidgetlbtn").setAttribute("aria-expanded", "true"); document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").style.display = "none"; document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").innerText = ""; //IMIChatInit.clearmsgcards(); if (type === undefined) { var destination = document.getElementById('iframecookieconsentwindow').contentWindow; msg = { "action": "showiframe", "host": window.location.hostname, "chatmobile": isMobile }; destination.postMessage(msg, domainUrl); document.getElementById("iframecookieconsentwindow").setAttribute("aria-hidden", "false"); } IMIChatInit.cleargreetingmsgcards(); return; } //Close Widget if (document.getElementById("divchatmain").style.display === 'block' && (type == 0 || type == 2 || type == undefined)) { document.documentElement.className = document.documentElement.className.replace(' imichatmobile-active', ''); document.getElementById("divchatmain").style.display = "none"; innerDoc.getElementById("cookieconsentwidgetlbtn").setAttribute("class", "open-btn state " + buttonType); innerDoc.getElementById("cookieconsentwidgetlbtn").setAttribute("aria-expanded", "false"); if (innerDoc.getElementById("cookieconsentwidgetlbtn")) { innerDoc.getElementById("cookieconsentwidgetlbtn").focus(); document.addEventListener('keydown', function (event) { if (event.key === "Tab") { event.preventDefault(); if (innerDoc.getElementById("ancclearcards")) { innerDoc.getElementById("ancclearcards").focus(); } else if (innerDoc.getElementById("greetingancclearcards")) { innerDoc.getElementById("greetingancclearcards").focus(); } } }); } document.getElementById('chatunread-frame').style.display = "block"; document.getElementById("iframecookieconsentwindow").setAttribute("aria-hidden", "true"); return; } return; } catch (e) { console.log("LaunchProactiveMsgManager:" + e.msg); } }, clearmsgcards: function () { document.getElementById('chatunread-frame').contentWindow.document.getElementById("msg-list").innerHTML = ""; document.getElementById('chatunread-frame').contentWindow.document.getElementById("ancclearcards").style.display = "none"; //document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").style.display = "none"; //document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").innerText == ""; localStorage.setItem(fingerprint + "_" + _skey + "_cardcount", 0); }, cleargreetingmsgcards: function () { document.getElementById('chatunread-frame').contentWindow.document.getElementById("greeting-msg-list").innerHTML = ""; document.getElementById('chatunread-frame').contentWindow.document.getElementById("greetingancclearcards").style.display = "none"; }, openchat: function (event) { document.getElementById('imichat-fullscreen-modal').className = 'imichat-fullscreen-modal'; document.getElementById('imichat-fullscreen-modal').removeAttribute('tabindex'); document.getElementById('imichat-fullscreen-modal').removeAttribute('aria-hidden'); var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'openchat', threadid: event.data.threadid, proactive_id: event.data.proactive_id }, '*'); if (parent.IMIChatInit != undefined) { parent.IMIChatInit.chatswitchicon(2); } else { IMIChatInit.chatswitchicon(2); } }, extractContent: function (s) { var span = document.createElement('span'); span.innerHTML = s; return span.textContent || span.innerText; }, badgecount: function (event) { try { if (document.getElementById("divchatmain").style.display === 'none') { var count = document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").innerText; if (count == 0 || count == "") { count = 1; } else { count = parseInt(count) + 1; } var duplicate = 0; var innerDivs; var innerDivsCount = 0; var refChild; IMIChatInit.clearmsgcards(); var containerDiv = document.getElementById('chatunread-frame').contentWindow.document.getElementById("msg-list"); if (count > 1) { innerDivs = containerDiv.getElementsByClassName("msg"); if (innerDivs != undefined) { innerDivsCount = innerDivs.length; for (var i = 0; i < innerDivs.length; i++) { if ("msg_" + event.data.msgtransid == innerDivs[i].id) { duplicate = 1; } } refChild = innerDivs[0]; } } var cardcount; var checkbadgecount; if (innerDivs == undefined) { localStorage.setItem(event.data.fingerprint + "_" + _skey + "_cardcount", 1); } document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").style.display = "block"; if (duplicate == 0) { if (parseInt(innerDivsCount) == 5) { containerDiv.removeChild(document.getElementById('chatunread-frame').contentWindow.document.getElementsByClassName('msg')[4]); containerDiv.removeChild(document.getElementById('chatunread-frame').contentWindow.document.getElementsByClassName('msgclear')[4]); innerDivsCount = innerDivsCount - 1; } if ((parseInt(innerDivsCount) < 1 && event.data.badge_type === undefined) || event.data.badge_type === 2 || event.data.badge_type === 3) { var node = document.createElement("div"); var node1 = document.createElement("div"); var textnode = document.createTextNode(IMIChatInit.extractContent(event.data.msg)); if (textnode.data.length > 45) { if (event.data.badge_type === undefined || event.data.badge_type === 2) { textnode.data = textnode.data.substr(0, 45) + "..."; } else { textnode.data = textnode.data; } } node.className = "msg"; node.style = "cursor:pointer;"; node.setAttribute("tabindex", "0"); //ENG-1065 and ENG-3621 for tabindex node1.className = "msgclear"; node.id = "msg_" + event.data.msgtransid; // Create a text node node1.id = "msgclear_" + event.data.msgtransid; node1.style = "clear:both;"; node.addEventListener("click", function () { window.parent.postMessage({ action: 'openchat', threadid: event.data.threadid, proactive_id: event.data.proactive_id }, '*'); }); node1.addEventListener("click", function () { window.parent.postMessage({ action: 'openchat', threadid: event.data.threadid, proactive_id: event.data.proactive_id }, '*'); }); if (event.data.msg_from !== undefined && event.data.msg_from !== "") { var span = document.createElement("span"); //var span span.innerHTML = '' + event.data.msg_from + ':'; node.appendChild(span); } else if (event.data.msg_from === undefined || event.data.msg_from == "") { var span = document.createElement("span"); //var span span.innerHTML = 'New Conversation:'; node.appendChild(span); } node.appendChild(textnode); var height = document.getElementsByClassName('main-unreadchat-cont')[0].style.height; if (height == "") { height = 70; } if (innerDivsCount == 0) { height = document.getElementsByClassName('main-unreadchat-cont')[0].style.height = "100%"; } /* else if (innerDivsCount == 2) { height = document.getElementsByClassName('main-unreadchat-cont')[0].style.height = "150px"; } else if (innerDivsCount > 2) {*/ else { document.getElementsByClassName('main-unreadchat-cont')[0].style.height = parseInt(height) + 60 + "px"; } var referenceNode = document.getElementById('chatunread-frame').contentWindow.document.getElementById("msg-list"); // document.querySelector('#some-element'); if (innerDivsCount == 0) { referenceNode.appendChild(node); referenceNode.appendChild(node1); } else { referenceNode.insertBefore(node, refChild); referenceNode.insertBefore(node1, refChild); if ((window.innerHeight + 100) < (document.getElementsByClassName("main-unreadchat-cont")[0].style.height)) { var frame = document.getElementById('chatunread-frame'); var c = frame.contentDocument || frame.contentWindow.document; c.getElementsByTagName("body")[0].offsetHeight = '80%'; c.getElementsByTagName("body")[0].style.overflow = "auto"; } } if (event.data.badge_type === 3) { document.getElementsByClassName("main-unreadchat-cont")[0].style.height = "100%"; var frame = document.getElementById('chatunread-frame'); var c = frame.contentDocument || frame.contentWindow.document; c.getElementsByClassName("msg")[0].style.maxHeight = "unset"; var frameheight = c.getElementsByTagName("body")[0].offsetHeight; document.getElementsByClassName("main-unreadchat-cont")[0].style.height = frameheight + "px"; } } else if (event.data.badge_type === 4) { var fullscreen_modal = document.getElementById('imichat-fullscreen-modal'); fullscreen_modal.className = 'imichat-fullscreen-modal imichat-open'; fullscreen_modal.contentWindow.postMessage({ action: 'bind_data', proactive_id: event.data.proactive_id, threadid: event.data.threadid, msg_from: event.data.msg_from, msg: event.data.msg, btn_chat_now_open: IMILocalisation.getValue(_IMIchat_widget_lang, "proactive_poupup_chat_now_button", "Chat Now"), btn_chat_now_close: IMILocalisation.getValue(_IMIchat_widget_lang, "proactive_poupup_close_button", "Close") }, "*"); } cardcount = parseInt(localStorage.getItem(event.data.fingerprint + "_" + _skey + "_cardcount")) + 1; localStorage.setItem(event.data.fingerprint + "_" + _skey + "_cardcount", cardcount); localStorage.setItem("fingerprint", event.data.fingerprint); localStorage.setItem(event.data.fingerprint + "_" + _skey + "_badgecount", count); document.getElementById('imi-chatbutton').contentWindow.document.getElementById("chattotalbadge").innerText = count; var chatbtn_badge_counter = IMILocalisation.getValue(_IMIchat_widget_lang, "badge_counter_unread_messages", "Livechat Button - {0} unread messages"); chatbtn_badge_counter = chatbtn_badge_counter.replace("{0}", count); if (count > 0) { //to do for ENG-1082 get localisation for chat button tooltip with count //ENG-1055 document.getElementById('imi-chatbutton').contentWindow.document.getElementById("spnwidgetlbtn").setAttribute("aria-label", chatbtn_badge_counter); //ENG-1082 } else { document.getElementById('imi-chatbutton').contentWindow.document.getElementById("spnwidgetlbtn").setAttribute("aria-label", chatbtn_badge_counter); //ENG-1082 } } document.getElementById('chatunread-frame').style.display = (event.data.badge_type === undefined || (event.data.badge_type === 2 || event.data.badge_type === 3)) ? "block" : "none"; document.getElementById('chatunread-frame').contentWindow.document.getElementById("ancclearcards").style.display = (event.data.badge_type === undefined || (event.data.badge_type === 2 || event.data.badge_type === 3)) ? "block" : "none"; } } catch (e) { console.log("badgecount:" + e.msg); } }, message: function (event) { try { if (event.data.action != null) { if (event.data.action == 'openchat') { IMIChatInit.openchat(event); } if (event.data.action == 'badgecount') { IMIChatInit.badgecount(event); } if (event.data.action == 'chatswitchicon') { IMIChatInit.chatswitchicon(); //event } if (event.data.action == 'Cookiechatswitchicon') { IMIChatInit.chatcookieconsentswitchicon(); //event } if (event.data.action == 'imichat_custom_chat_fields') { if (event.data.type == 'add') { if (_IMIchat_callback_dic['imichat-widget:custom_chat_fields_init'] !== undefined) { _IMIchat_callback_dic['imichat-widget:custom_chat_fields_init'](event.data.response); } } else if (event.data.type == 'update') { if (_IMIchat_callback_dic['imichat-widget:custom_chat_fields_update'] !== undefined) { _IMIchat_callback_dic['imichat-widget:custom_chat_fields_update'](event.data.response); } }//event } if (event.data.action == 'acceptCookies') { IMIChatInit.acceptCookies(); } if (event.data.action == 'widgettabkeypress') { var forkeyboard = document.getElementById('imi-chatbutton').contentWindow.document; forkeyboard.getElementById("widgetlbtn").focus(); } if (event.data.action == 'cookieconsenttabkeypress') { var forkeyboard = document.getElementById('imi-chatbutton').contentWindow.document; forkeyboard.getElementById("cookieconsentwidgetlbtn").focus(); } if (event.data.action == 'loadcookieconsentwidgetstyles') { IMIChatInit.loadCookieConsentWidgetStyles(); } if (event.data.action == 'loadstyles') { IMIChatInit.loadJQuery(_wxengage_domain_name, function () { IMIChatInit.loadwidgetStyles(event.data.message); try { if (event.data.message != null) { if (_IMIchat_callback_dic['imichat-widget:ready'] !== undefined) { _IMIchat_callback_dic['imichat-widget:ready'](_wxengage_attr_key); console.log("imichat-widget:ready fired"); } //eval('imichatWidgetLoaded();'); if (_IMIchat_callback_dic['imichat-widget:custom_chat_fields_init'] !== undefined) { _IMIchat_callback_dic['imichat-widget:custom_chat_fields_init'](); }// debugger; var widget_data = JSON.parse(event.data.message); hdr_bfp = widget_data.hdr_bfp; hdr_xtoken = widget_data.hdr_xtoken; hdr_tid = widget_data.hdr_tid; is_abandonded = widget_data.abandon_chats } } catch (e) { } IMIChatInit.LaunchProactiveMsgManager(_wxengage_domain_name, function () { }); IMIChatInit.handleAbandonedChats(); if (cookie_consent_accepted == 1) { var cookiefocus = document.getElementById('imi-chatbutton').contentWindow.document; cookiefocus.getElementById("widgetlbtn").focus(); } }); } if (event.data.action == 'closemodelpopup') { document.getElementById('imichat-fullscreen-modal').className = 'imichat-fullscreen-modal'; document.getElementById('imichat-fullscreen-modal').setAttribute('tabindex', '-1'); document.getElementById('imichat-fullscreen-modal').setAttribute('aria-hidden', 'true'); } if (event.data.action == 'setsession') { sessionStorage.setItem(event.data.key, event.data.value); } if (event.data.action == 'setlocal') { localStorage.setItem(event.data.key, event.data.value); } if (event.data.action == 'browserstorage') { document.getElementById("divicw").innerHTML = "
\n \n \nError:
Cookies Disabled

We use cookies to enable best chat experience. Follow these directions to re-enable cookies specific to your browser type or re-open this website in a cookie-enabled browser.

"; console.log("Local storage not supported"); } if (event.data.action == 'clearallsessionkeys') { sessionStorage.clear(); } if (event.data.action == 'clearalllocalstoragekeys') { localStorage.clear(); } if (event.data.action == 'cookierejectreload') { IMIChatInit.removeStorageKeysWhenCookieRejected(); IMIChatInit.init(); } } } catch (e) { } }, resize: function () { try { var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'resize', width: window.outerWidth //window.innerWidth//screen.width // document.body.clientWidth }, "*"); IMIGeneral.checkmobile(); } catch (e) { } }, removeStorageKeysWhenCookieRejected: function () { sessionStorage.removeItem(_wxengage_attr_key + "_imichat-reload-check"); sessionStorage.removeItem("webex_engage_data-bind"); sessionStorage.removeItem("webex_engage_data-org"); sessionStorage.removeItem("webex_engage_greetingmessage_shown") localStorage.removeItem(fingerprint + "_" + _skey + "_badgecount"); localStorage.removeItem(fingerprint + "_" + _skey + "_cardcount"); localStorage.removeItem("style_" + document.getElementById("divicw").getAttribute("data-bind") + "_" + window.location.hostname); localStorage.removeItem("webex_engage_customer_first_seen"); localStorage.removeItem("webex_engage_customer_last_seen"); localStorage.removeItem("webex_engage_customer_last_seen_interval_id"); localStorage.removeItem("webex_engage_executed_proactive_ids"); localStorage.removeItem("fingerprint"); localStorage.removeItem("webex_engage_repeat_customer"); sessionStorage.removeItem("webex_engage_imichat_hasinitconvexist"); localStorage.removeItem("webex_engage_cookieconsent_accepted"); cookie_consent_accepted = 0; }, clearBrowserStorage: function () { try { IMIChatInit.removeStorageKeysWhenCookieRejected(); var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'clearbrowserstorage', width: window.outerWidth //window.innerWidth//screen.width // document.body.clientWidth }, "*"); IMIChatInit.verifyCookieConsent(); console.log("browser storage cleared"); } catch (e) { } }, LaunchProactiveMsgManager: function (domainName, callback) { try { var widget_styles = localStorage.getItem("style_" + document.getElementById("divicw").getAttribute("data-bind") + "_" + window.location.hostname); if (widget_styles == null && !JSON.parse(widget_styles).enable_proactive) { callback(); return; } var body = document.getElementsByTagName('body')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = IMIChatInit.domainName() + '/js/proactive-msg-manager.js'; body.appendChild(script); script.addEventListener('load', function (event) { console.log('proactive manager loaded;'); var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'proactive-manager-loaded', attrkey: document.getElementById("divicw").getAttribute("data-bind"), host: window.location.hostname }, "*"); callback(); }); } catch (e) { console.log("LaunchProactiveMsgManager:" + e.msg); } }, processAbandonedChats: function (type) { if (!imichatwidget.hasInitiatedChat()) { return; } if (is_abandonded == false) { return; } var browser_fingerprint = localStorage.getItem("fingerprint"); var url = IMIGeneral.profileUrl() + "livechats/" + _wxengage_attr_key + "/customers/" + browser_fingerprint + "/abandoned?host=" + window.document.URL; url = url + "&type=" + type; var body = JSON.stringify({ "is_reloaded": false, "is_closechat": true }); var headers = { 'type': 'application/json', 'fpid': hdr_bfp, 'Tid': hdr_tid, 'X-Token': hdr_xtoken }; var blob = new Blob([body], headers); navigator.sendBeacon(url); }, handleAbandonedChats: function () { // Attach the event keypress to exclude the F5 refresh //jQuery(window).on('keydown', function (e) { window.addEventListener('keydown', function (e) { if (e.keyCode == 116) { _IMIchat_IsValidNavigation = true; } }); window.addEventListener("beforeunload", function (e) { sessionStorage.setItem(_wxengage_attr_key + "_imichat-reload-check", document.referrer); console.log(document.referrer); //sessionStorage.setItem("imi_tabid", Math.random().toString(16).slice(2)); if (_IMIchat_IsValidNavigation !== undefined && !_IMIchat_IsValidNavigation) { IMIChatInit.processAbandonedChats("unload"); } }); if (window.performance.navigation.type == 1) { IMIChatInit.processAbandonedChats("load"); } }, loadJQuery: function (domainName, callback) { if (typeof (jQuery) !== 'undefined') { callback(); return; } var body = document.getElementsByTagName('body')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = domainName + '/js/jquery.min.js'; body.appendChild(script); script.addEventListener('load', function (event) { callback(); }); return; }, on: function (func_name, callback) { if (typeof callback != 'function') { console.error('function was expected.'); return; } switch (func_name) { case 'imichat-widget:ready': _IMIchat_callback_dic['imichat-widget:ready'] = callback; break; } }, checklocalStorage: function () { var test = 'test'; try { localStorage.setItem(test, test); localStorage.removeItem(test); return true; } catch (e) { return false; } }, call_previous_chats: function () { try { var destination = document.getElementById('iframechatwindow').contentWindow; msg = { "action": "showiframe", "host": window.location.hostname, "chatmobile": ((navigator.userAgent.indexOf("Mobile")) != -1) ? "1" : "0" }; destination.postMessage(msg, domainUrl); } catch (e) { } }, check_clear_session_chats: function () { if (document.referrer == sessionStorage.getItem(_wxengage_attr_key + "_imichat-reload-check")) { return false; } else if (sessionStorage.getItem(_wxengage_attr_key + "_imichat-reload-check") == undefined) { return true; } else { console.log("Hey, Thanks for visiting again"); return false; } }, verifyCookieConsent: function () { var isCookieConsent = typeof cookieConsentWidgetOptions === 'undefined' ? false : true; if (isCookieConsent != undefined && isCookieConsent != null && isCookieConsent && localStorage.getItem("webex_engage_cookieconsent_accepted") != "1") { try { var body = document.getElementsByTagName('body')[0]; var script = document.currentScript || (function () { var scripts = document.getElementsByTagName('script'); return scripts[scripts.length - 1]; })(); var generalscript = document.createElement('script'); generalscript.src = IMIChatInit.domainName() + "/js/imichatgeneral.js"; generalscript.type = 'text/javascript'; body.appendChild(generalscript); generalscript.addEventListener('load', function (event) { document.getElementById("divicw").innerHTML = "" + "" + "" + "
" + "
" + "" + "
" + ""; var iframeMainDoc = document.getElementById("iframecookieconsentwindow"); iframeMainDoc.addEventListener('load', function () { IMIChatInit.onCookieConsentWidgetIconIframeLoad(); }); iframeMainDoc.src = IMIGeneral.domainName() + "/cookieconsent.html"; window.removeEventListener('message', IMIChatInit.message); window.addEventListener('message', IMIChatInit.message); }); } catch (e) { console.log("LaunchProactiveMsgManager:" + e.msg); } } else { if (IMIChatInit.checklocalStorage()) { IMIChatInit.init(); } else { document.getElementById("divicw").innerHTML = "
\n \n \nError:
Cookies Disabled

We use cookies to enable best chat experience. Follow these directions to re-enable cookies specific to your browser type or re-open this website in a cookie-enabled browser.

"; console.log("Local storage not supported"); } } } }; }(); IMIChatInit.verifyCookieConsent(); var imichatwidget = { // get hasInitiatedConversation() { // if (sessionStorage.getItem("webex_engage_imichat_hasinitconvexist") == null) // return false; // if (sessionStorage.getItem("webex_engage_imichat_hasinitconvexist") == "1") { // return true; // } else { // return false; // } // }, hasInitiatedChat: function () { if (sessionStorage.getItem("webex_engage_imichat_hasinitconvexist") == null) return false; if (sessionStorage.getItem("webex_engage_imichat_hasinitconvexist") == "1") { return true; } else { return false; } }, show: function () { //$("#divicw").show();return; document.getElementById("divicw").style.display = 'block'; }, hide: function () { // $("#divicw").hide();return; document.getElementById("divicw").style.display = 'none'; }, /* test:function() { if(sessionStorage.getItem("webex_engage_imichat_hasinitconvexist")==null) return false; if(sessionStorage.getItem("webex_engage_imichat_hasinitconvexist")=="1") { return true; } else { return false; } },*/ maximizeWindow: function () { IMIChatInit.chatswitchicon(1); IMIChatInit.resize(); IMIChatInit.call_previous_chats(); return; }, minimizeWindow: function () { return IMIChatInit.chatswitchicon(0); }, init: function (jsondata, callback) { if (typeof callback != 'function') { console.error('function was expected.'); return; } var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'imichat_custom_chat_fields', data: jsondata, type: 'add' }, '*'); _IMIchat_callback_dic['imichat-widget:custom_chat_fields_init'] = callback; }, update: function (jsondata, callback) { if (typeof callback != 'function') { console.error('function was expected.'); return; } var destination = document.getElementById('iframechatwindow').contentWindow; destination.postMessage({ action: 'imichat_custom_chat_fields', data: jsondata, type: 'update' }, '*'); _IMIchat_callback_dic['imichat-widget:custom_chat_fields_update'] = callback; }, on: function (func_name, callback) { if (typeof callback != 'function') { console.error('function was expected.'); return; } switch (func_name) { case 'imichat-widget:ready': _IMIchat_callback_dic['imichat-widget:ready'] = callback; break; } }, clearBrowserStorage: function () { IMIChatInit.clearBrowserStorage(); } }; /* function imichatWidgetLoaded(){imi imichatwidget.maximizeWindow(); }*/