 const htmlEntities=(str)=>String(str).replace(/[&<>"]/g,(c)=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',})[c]);const getHostName=(url)=>{const match=url.match(/:\/\/(?:www[0-9]?\.)?([^/:]+)/i);return match?.[1]|| null};const getDomain=(url)=>{const parts=getHostName(url)?.split('.').reverse();return parts?.length> 1 ?`${parts[1]}.${parts[0]}`:null};const waitForElm=(selector)=>new Promise((resolve)=>{if(document.querySelector(selector)) return resolve(document.querySelector(selector));new MutationObserver((_,obs)=>{const el=document.querySelector(selector);if(el){obs.disconnect();resolve(el)}}).observe(document.body,{childList:true,subtree:true})});const isInViewport=(el)=>{const rect=el.getBoundingClientRect();return rect.top - window.innerHeight < 500 && rect.bottom> -50};const isMobileDevice=()=>/iPhone|webOS|Android|iPad|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent);function getAffiliate(){const params=new URLSearchParams(location.search);return (params.get('utm_content') || params.get('affiliates') || Cookies.get('irid') || Cookies.get(' irid') || Cookies.get('affiliates') || Cookies.get(' affiliates'))}const animateScroll=(offset)=>window.scroll({behavior:'smooth',left:0,top:offset});function openChatPopup(el){let attach=el?.getAttribute('data-value') || 'none';let url=`https://secure1.inmotionhosting.com/amp/chat/survey?option=${attach}`;if(el?.getAttribute('data-value')=='sales' && el.hasAttribute('data-prodvalue')){url+=`&hosting=${el.getAttribute('data-prodvalue')}`}url+=`&url=${escape(location.href).replace('%3A',':')}`;if(el?.hasAttribute('data-recomendation')) url+=`#${el.getAttribute('data-recomendation')}`;const width=Math.max(0.25 * screen.width,520),height=Math.min(0.78 * screen.availHeight,850);window.open(url,'Amp Chat',`toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=1,width=${width},height=${height}`)}const gtagReportConversion=(url)=>{gtag('event','conversion',{send_to:'AW-1071887445/N9zpCKuqvKgBENXojv8D',event_callback:()=>url && (window.location=url),});return false};const openCpanelDemo=()=>location.assign(`${location.host}/cpanel-demo`);document.addEventListener('click',(e)=>{const t=e.target;const has=(cls)=>t.classList.contains(cls);const parentHas=(cls)=>t.parentElement?.classList.contains(cls) || t.parentElement?.parentElement?.classList.contains(cls);if(has('atc') && !has('disabled') && !has('central-atc')){e.preventDefault();t.querySelector('label')?.hide();t.innerHTML='<span class="imh-spinner"></span>';t.disabled=true;openCheckout(t)}if((has('atc') || has('cta')) && !has('disabled')) gtagReportConversion(t.href);if(has('chat-btn-popup') || parentHas('chat-btn-popup')){e.preventDefault();openChatPopup(t.closest('.chat-btn-popup'))}if(has('imh-modal-open') || t.parentElement?.classList.contains('imh-modal-open')){e.preventDefault();const id=t.getAttribute('imh-modal-id') || t.parentElement.getAttribute('imh-modal-id');['body','html','main'].forEach((sel)=>document.querySelector(sel).classList.add('modal-open'));document.getElementById(id)?.classList.remove('hide')}if(has('imh-modal-close') || t.parentElement?.classList.contains('imh-modal-close')){e.preventDefault();const id=t.getAttribute('imh-modal-id') || t.parentElement.getAttribute('imh-modal-id');['body','html','main'].forEach((sel)=>document.querySelector(sel).classList.remove('modal-open'));document.getElementById(id)?.classList.add('hide')}if(has('imh-modal-container')){e.preventDefault();t.classList.add('hide');['body','html','main'].forEach((sel)=>document.querySelector(sel).classList.remove('modal-open'))}});document.addEventListener('keydown',(e)=>{if(e.key=='Escape'){document.querySelectorAll('.imh-modal-container').forEach((m)=>m.classList.add('hide'));['body','html','main'].forEach((sel)=>document.querySelector(sel).classList.remove('modal-open'))}});document.addEventListener('DOMContentLoaded',()=>{const ids=new Set();document.querySelectorAll('.imh-modal-container').forEach((modal)=>{const id=modal.id;if(ids.has(id)) modal.remove();else ids.add(id)});document.querySelectorAll('p').forEach((p)=>{if(p.innerHTML.trim()=='' && p.children.length==0) p.remove()});document.querySelectorAll('.reserved').forEach((e)=>e.remove());waitForElm('img[src*="t.co"],img[src*="analytics.twitter.com"]').then((img)=>img.setAttribute('alt',''));document.querySelectorAll('.edu-mini-nav a').forEach((link)=>{if(link.href.includes(location.pathname)) link.classList.add('active')});const prod=document .querySelector('[pricing-product-class],[product-class-1],[spec-table-product-class-1]') ?.getAttribute('pricing-product-class') ?.toLowerCase().replaceAll(' ','-') || 'business';document .querySelectorAll('.chat-btn-popup:not(.chat-btn-header):not(.imh-footer-nav-chat)').forEach((btn,i)=>{btn.setAttribute('data-value',btn.getAttribute('data-value') || 'sales');const flyoutChat=document.querySelector('.imh-flyout-chat .chat-btn-popup') || document.querySelector('.imh-chat-bubble.chat-btn-popup');let prodValue=btn.getAttribute('data-prodvalue') ||`${prod}-hosting`;prodValue=(flyoutChat) ? flyoutChat.getAttribute('data-prodvalue') :prodValue;btn.setAttribute('data-prodvalue',prodValue);btn.setAttribute('aria-label',btn.getAttribute('aria-label') ||`Chat with us ${i+1}`)});document.querySelectorAll('a[href^="#"]:not(.imh-accordion)').forEach((a)=>{a.addEventListener('click',(e)=>{const href=a.getAttribute('href');if(!href || href=='#'){return}e.preventDefault();let target;try {target=document.querySelector(href)}catch (err){return}if(!target) return;const offset=target.offsetTop;if(Number.isFinite(offset)){animateScroll(offset)}})});setTimeout(()=>{document.querySelectorAll('.imh-accordion-container:not(.no-click)').forEach((acc)=>{const toggle=acc.querySelector('.imh-accordion');const chevron=acc.querySelector('.chevron');const content=acc.querySelector('.imh-accordion-content');toggle?.addEventListener('click',(e)=>{e.preventDefault();const show=!content.classList.contains('show');content.classList.toggle('show',show);content.setAttribute('aria-hidden',!show);chevron?.classList.toggle('rotate',show)})})},3000)});(()=>{document.querySelectorAll('img').forEach((img)=>{const h=img.height || 100;const w=img.width || 100;if(img.getAttribute('width')=='auto') img.style.width='auto';if(img.getAttribute('height')=='auto') img.style.height='auto';img.setAttribute('width',w);img.setAttribute('height',h)})})();(()=>{const questionIcon='<i class="fa fa-imh-question question"></i>';const triangleSVG=`<svg style="transform:rotate(0deg) translateY(10px) rotate(45deg);" xml:space="preserve"><title>Triangle Icon Pointing Up</title><defs><path id="path-tt" d="M0 0 C0 0 15 0 15 0 C15 0 15 15 15 15 C15 15 0 15 0 15 C0 15 0 0 0 0 Z"></path><filter height="300%" id="filter-tt" width="300%" x="-100%" y="-100%"><feFlood flood-opacity="0" result="backgroundFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dx="1" dy="2"/><feGaussianBlur stdDeviation="1.167"/><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"/><feColorMatrix type="matrix" values="0 0 0 0 00 0 0 0 00 0 0 0 00 0 0 0.3 0"/><feBlend in2="backgroundFix" mode="normal" result="shadowInner_1"/></filter></defs><g><path d="M0 0 C0 0 15 0 15 0 C15 0 15 15 15 15 C15 15 0 15 0 15 C0 15 0 0 0 0 Z" style="stroke:rgb(140,140,140);stroke-width:0;" fill="currentColor"/><use xlink:href="#path-tt" filter="url(#filter-tt)"/></g></svg>`;const baseUrl=`${location.protocol}//${location.hostname}/wp-content/themes/imh-responsive/js/inc`;const timeStamp=new Date(new Date().setMinutes(0,0,0)).getTime();const tooltipFiles={'.tooltips-rostrum':`${baseUrl}/tooltips-rostrum.json?cb=${timeStamp}`,'.tooltips-table':`${baseUrl}/tooltips-table.json?cb=${timeStamp}`,'.tooltips-page-icon':`${baseUrl}/tooltips-page-icon.json?cb=${timeStamp}`,'.tooltips-table-icon':`${baseUrl}/tooltips-table.json?cb=${timeStamp}`,};const sanitizeKey=(key)=>'imh-tt-'+key .toLowerCase().replace(/\s/g,'-').replace(/&/g,'and').replace(/[<>'%*,+$]/g,'').replace(/--/g,'-');const htmlEntities=(str)=>str.replace(/</g,'&lt;').replace(/>/g,'&gt;');Object.entries(tooltipFiles).forEach(([selector,jsonURL])=>{const elements=document.querySelectorAll(selector);if(!elements.length) return;fetch(jsonURL).then((res)=>res.json()).then((ttList)=>{Object.values(ttList).forEach(({keyphrase,tooltiptext})=>{const key=keyphrase.trim();const tip=htmlEntities(tooltiptext);const id=sanitizeKey(key);elements.forEach((el)=>{if(el.querySelector('.tooltip')) return;const temp=el.cloneNode(true);temp.querySelectorAll('no-tooltip')?.forEach((n)=>n.remove());const hasMatch=temp.innerHTML.toLowerCase().includes(key.toLowerCase());if(!hasMatch) return;const wrap=selector.includes('icon') ?`<span class="tooltip icon" imh-tooltip-id="${id}" imh-tooltip-text="${tip}">${questionIcon}</span>`:`<span class="tooltip" imh-tooltip-id="${id}" imh-tooltip-text="${tip}">${key}</span>`;el.innerHTML=selector.includes('icon') ? el.innerHTML+wrap :el.innerHTML.replace(key,wrap)})})}).catch(console.error)});function tooltipControl(){const isDesktop=window.innerWidth> 1200;document.querySelectorAll('.imhtooltip')?.forEach((t)=>t.remove());const tooltips=document.querySelectorAll('.tooltip');if(!tooltips.length) return;if(isDesktop){tooltips.forEach((tt)=>{const id=tt.getAttribute('imh-tooltip-id');const tip=tt.getAttribute('imh-tooltip-text');tt.addEventListener('mouseenter',()=>{const tipHTML=`<div id="${id}" class="imhtooltip" style="position:absolute;top:${tt.offsetHeight}px;opacity:0;"><span class="triangle">${triangleSVG}</span><span class="tip-text">${tip}</span></div>`;tt.insertAdjacentHTML('beforeend',tipHTML);const tipEl=tt.querySelector('.imhtooltip');const tipWidth=tipEl.offsetWidth;const triangle=tipEl.querySelector('.triangle');tipEl.style.left=`${tt.offsetWidth / 2 - tipWidth / 2}px`;triangle.style.left=`${tipWidth / 2 - triangle.offsetWidth / 2}px`;const rect=tipEl.getBoundingClientRect();if(rect.left < 0){tipEl.style.left='-16px';triangle.style.left='10px'}tipEl.style.opacity=1});tt.addEventListener('mouseleave',()=>document.querySelector(`#${id}`)?.remove())})}else{let ttAdded=false;tooltips.forEach((tt)=>{tt.addEventListener('click',()=>{const id=tt.getAttribute('imh-tooltip-id');const tip=tt.getAttribute('imh-tooltip-text');if(ttAdded){document.querySelector(`#${id}`)?.remove();ttAdded=false}else{const tipHTML=`<div id="${id}" class="imhtooltip" style="position:absolute;top:${tt.offsetHeight}px;opacity:0;"><span class="triangle">${triangleSVG}</span><span class="tip-text">${tip}</span></div>`;tt.insertAdjacentHTML('beforeend',tipHTML);const tipEl=tt.querySelector('.imhtooltip');const tipWidth=tipEl.offsetWidth;const triangle=tipEl.querySelector('.triangle');tipEl.style.left=`${tt.offsetWidth / 2 - tipWidth / 2}px`;triangle.style.left=`${tipWidth / 2 - triangle.offsetWidth / 2}px`;const rect=tipEl.getBoundingClientRect();if(rect.left < 0){tipEl.style.left='-16px';triangle.style.left='10px'}tipEl.style.opacity=1;ttAdded=true}})})}}setTimeout(tooltipControl,1000)})();