/* * Copyright (c) 2018 AXA Shared Services Spain S.A. * * Licensed under the AXA Shared Services Spain S.A. License (the "License"); you * may not use this file except in compliance with the License. * A copy of the License can be found in the LICENSE.TXT file distributed * together with this file. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // --------------------------------------- // Vertical Menu Functions ||||||||||||||| // --------------------------------------- var expandMenu = false; function vMenuOver(obj, iconOpen, iconClosed) { expandMenu = true; icon = obj.className=="open" ? iconClosed : iconOpen; obj.src = icon; } function vMenuOut(obj, iconOpen, iconClosed) { expandMenu = false; icon = obj.className=="open" ? iconOpen : iconClosed; obj.src = icon; } // Expand menu only if the mouse is over an expand icon function vMenuLink(obj, iconOpen, iconClosed) { if (expandMenu == true) { toggleMenu(obj, iconOpen, iconClosed); return false; } } // Toggle the menu visibility and change the expand icon function toggleMenu(obj, iconOpen, iconClosed) { if (obj.parentNode.lastChild.className=="open") { obj.parentNode.lastChild.className = obj.firstChild.className = "close"; obj.firstChild.src = iconOpen; } else { obj.parentNode.lastChild.className = obj.firstChild.className = "open"; obj.firstChild.src = iconClosed; } } function changeLanguage(mySelect, langChangeUrl){ lang = mySelect.options[mySelect.selectedIndex].value; document.location.href = langChangeUrl + "&" + "lang=" + lang; return false; } function setupMenu() { var langSelect = document.getElementById('langSelect'); if(langSelect!==null){ langSelect.addEventListener('change', () => changeLanguage(langSelect, langSelect.name)); } } window.addEventListener("load", setupMenu);