Skip to main content if (!(window.location.href.indexOf(.magnolia) > -1) && !(window.location.href.indexOf(mgnlPreview) > -1) && !(window.location.href.indexOf(mgnlChannel) > -1) && !(window.location.href.indexOf(/dam/) > -1) ) var lang; if (GetCookie(currentLanguage)) lang = getCookieValue(currentLanguage); else lang = en; var contextPath = ; var mapping = /ca; var siteName = applus_ca if (lang !== && window.location.pathname.match(/(/global/)/g) && !window.location.pathname.match(/(/global/[a-z]2/|/global/[a-z]2$|/global/[a-z]2;|/global/[a-z]2)/g)) var pathNameSanitizied = window.location.pathname.replace(contextPath, ); var pathNameSplitted = pathNameSanitizied.split(/(/global/)/); if(pathNameSplitted[0].includes(lang)) pathNameSplitted[0] = pathNameSplitted[0].replace(lang, ); pathNameSanitizied = pathNameSplitted[0] + pathNameSplitted[1] + lang + / + pathNameSplitted[2]; var newPathname = contextPath + pathNameSanitizied if(newPathname.indexOf(//) > -1) newPathname = newPathname.replace(//, /); window.location = window.location.origin + newPathname + window.location.search; else if(lang !== && !window.location.pathname.match(/(/[a-z]2/)|(/[a-z]2$)|(//[a-z]2$)/g) && (window.location.pathname.indexOf(applus_formacion) == -1 && window.location.pathname.indexOf(kit-digital) == -1 && window.location.pathname.indexOf(lem) == -1 && window.location.pathname.indexOf(historical-records) == -1)) var pathNameSanitizied = window.location.pathname.replace(contextPath, ); pathNameSanitizied = pathNameSanitizied.replace(/(/[a-z]2/)|(/[a-z]2$)/g, /); var newPathname = contextPath + pathNameSanitizied + / + lang + /; if(newPathname.indexOf(//) > -1) newPathname = newPathname.replace(//, /); window.location = window.location.origin + newPathname + window.location.search; else if(lang !== && !window.location.pathname.match(/(/[a-z]2/)|(/[a-z]2$)|(//[a-z]2$)/g) && ((window.location.pathname.indexOf(applus_formacion) != -1) || (window.location.pathname.indexOf(kit-digital) != -1) || (window.location.pathname.indexOf(lem) != -1) || (window.location.pathname.indexOf(historical-records) != -1))) var pathNameSanitizied = window.location.pathname.replace(contextPath, ); if(window.location.pathname.indexOf(applus_formacion) != -1) var pathNameSplitted = pathNameSanitizied.split(/(/applus_formacion/)/); if(pathNameSplitted[0].includes(lang)) pathNameSplitted[0] = pathNameSplitted[0].replace(lang, ); pathNameSanitizied = pathNameSplitted[0] + pathNameSplitted[1] + / + lang + /+ pathNameSplitted[2]; if(window.location.pathname.indexOf(kit-digital) != -1) var pathNameSplitted = pathNameSanitizied.split(/(/kit-digital/)/); if(pathNameSplitted[0].includes(lang)) pathNameSplitted[0] = pathNameSplitted[0].replace(lang, ); pathNameSanitizied = pathNameSplitted[0] + pathNameSplitted[1] + / + lang + /+ pathNameSplitted[2]; if(window.location.pathname.indexOf(lem) != -1) var pathNameSplitted = pathNameSanitizied.split(/(/lem/)/); if(pathNameSplitted[0].includes(lang)) pathNameSplitted[0] = pathNameSplitted[0].replace(lang, ); pathNameSanitizied = pathNameSplitted[0] + pathNameSplitted[1] + / + lang + /+ pathNameSplitted[2]; if(window.location.pathname.indexOf(historical-records) != -1) var pathNameSplitted = pathNameSanitizied.split(/(/historical-records/)/); if(pathNameSplitted[0].includes(lang)) pathNameSplitted[0] = pathNameSplitted[0].replace(lang, ); pathNameSanitizied = pathNameSplitted[0] + pathNameSplitted[1] + / + lang + /+ pathNameSplitted[2]; var newPathname = contextPath + pathNameSanitizied; if(newPathname.indexOf(//) > -1) newPathname = newPathname.replace(//, /); window.location = window.location.origin + newPathname + window.location.search; else if(lang !== && !window.location.pathname.match(mapping + / + lang + /) && !window.location.pathname.endsWith(/) && (siteName.indexOf(applus_formacion) == -1) && (siteName.indexOf(kit-digital) == -1) && (siteName.indexOf(lem) == -1) && (siteName.indexOf(historical-records) == -1)) if(mapping != /) var regexString = mapping + / + lang + $; else var regexString = / + lang + $; var regex = new RegExp(regexString, g); if(window.location.pathname.match(regex)) window.location.pathname = window.location.pathname + /; else if (window.location.pathname.includes(mapping)) if(mapping != /) window.location.pathname = window.location.pathname.replace(mapping, mapping + / + lang + /).replace(//, /); else window.location.pathname = window.location.pathname + /;
function doAjaxRequest() $.ajax( type: GET, url: /.rest/header-rest/getHTMLOfficeslang=en&contentId=c3406298-ddf5-4426-becb-6c7a280c0865&globalSiteLink=https://applus-test.applus.solutions/ca/en, async: false, success: function(response) $(#main).html(response.data); $(ul.listWebs li a).on(click, function () $(this).toggleClass(hover); ); , error: function(response) $(#main).html(response.data); $(ul.listWebs li a).on(click, function () $(this).toggleClass(hover); ); );
document.addEventListener(DOMContentLoaded, function () const container = document.querySelector(.nav-tabs-columns); const originalItems = Array.from(document.querySelectorAll(#navTabsOriginal > li)); const columns = Array.from(document.querySelectorAll(.nav-column)); if (!container || originalItems.length === 0 || columns.length === 0) return; function distributeItems(targetHeight) let columnIndex = 0; let columnHeight = 0; originalItems.forEach((li) => const liHeight = li.offsetHeight; // si este li supera el target → saltamos ANTES const margin = -50; // en px if (columnHeight + liHeight > targetHeight - margin && columnIndex < columns.length - 1) columnIndex++; columnHeight = 0; const column = columns[columnIndex]; li.style.minHeight = 20px; li.style.display = block; column.appendChild(li); columnHeight += liHeight; ); columns.forEach(column => if (!column.querySelector(li)) column.remove(); ); const original = document.getElementById(navTabsOriginal); if (original) original.remove(); function unhideAncestors(el) const modifiedNodes = []; while (el && el !== document.body) const style = getComputedStyle(el); if (style.display === none || el.classList.contains(hidden)) modifiedNodes.push( el, originalStyle: el.getAttribute(style) || ); el.style.setProperty(display, block, important); el.style.setProperty(visibility, hidden, important); el.style.setProperty(opacity, 0, important); el.style.setProperty(position, fixed, important); el.style.setProperty(top, -9999px, important); el.style.setProperty(left, -9999px, important); el.style.setProperty(pointer-events, none, important); el = el.parentElement; return modifiedNodes; function restoreHidden(modifiedNodes) modifiedNodes.forEach(( el, originalStyle ) => if (originalStyle) el.setAttribute(style, originalStyle); else el.removeAttribute(style); ); const unhid = unhideAncestors(container); function waitUntilHeightReady(callback) let attempts = 0; const maxAttempts = 20; function check() const h = columns[0].offsetHeight || 0; if (h > 0 || attempts >= maxAttempts) callback(); else attempts++; setTimeout(check, 50); check(); waitUntilHeightReady(() => const totalHeight = originalItems.reduce((acc, li) => acc + li.offsetHeight, 0); const targetHeight = totalHeight / columns.length; console.log(Objetivo por columna:, targetHeight); distributeItems(targetHeight); restoreHidden(unhid); ); ); document.addEventListener(DOMContentLoaded, function () const link = document.querySelector(.menu-link-globalServices); if(link) link.addEventListener(click, function (e) // Detectar si estamos en escritorio (ej: > 1024px) const isDesktop = window.innerWidth >= 991; if (isDesktop) e.preventDefault(); const targetUrl = link.getAttribute(href); if (targetUrl) window.location.href = targetUrl; else e.preventDefault(); const targetUrl = link.getAttribute(href); if (targetUrl) window.location.href = targetUrl; ); ); $(document).on(click, #divisionTab, function (e) var $tab = $(this); if (e.ctrlKey) window.open($tab.attr(alhref)); else window.location.href = $tab.attr(alhref); ); $(.withImage).on( mouseenter: function () var imageDiv = $(this).closest(.submenu).find(.imageMenu); if($(this).data(imgHover) != undefined) var imgHover = $(this).data(imgHover); var imgElem = imageDiv.find(img:first); if(imgElem != undefined) var oldSrc = imgElem.attr(src); imgElem.attr(old-src,oldSrc); imgElem.attr(src,imgHover); , mouseleave: function () var imageDiv = $(this).closest(.submenu).find(.imageMenu); var imgElem = imageDiv.find(img:first); if(imgElem != undefined) var oldSrc = imgElem.attr(old-src); if(oldSrc != undefined) imgElem.attr(src,oldSrc); imgElem.removeAttr(old-src); ); function redirectMe() window.location.replace(https://www.applus.com/ca/en/search+header=+document.getElementById(searchAutocomplete).value); return false;
function changeYear(year) document.getElementById(yearSpan).innerHTML = year; if ($(section.headerImageCarousel).length == 0 && $(div.headBanner).length == 0 && $(div.moduleCSR).length == 0) $(#breadcrumbs).css(margin-top,110px);