﻿function changeOpenmenu(id){
            //create an array of UL classnames
            var all_uls = new Array();
            all_uls[0]='ul_one';
            all_uls[1]='ul_two';
            all_uls[2]='ul_three';
            all_uls[3]='ul_four'; 
            all_uls[4]='ul_five';                         
            //create an array of LI classnames
            var all_lis = new Array();
            all_lis[0] = 'li_one';
            all_lis[1] = 'li_two';
            all_lis[2] = 'li_three';
            all_lis[3] = 'li_four';
            all_lis[4] = 'li_five';
            //loop through all the ULs and LIs setting everything back to default
            for(i=0;i<all_uls.length;i++){
                document.getElementById(all_uls[i]).style.display = 'none';
                document.getElementById(all_lis[i]).childNodes[0].style.backgroundColor = '#fff';
                onMouseover="this.style.color='#1d95b4'" 
                document.getElementById(all_lis[i]).childNodes[0].style.color = '#414141';
            }
            //change the selected UL(submenu) to display:block and the matching LI(parent link)to dark grey background and dark text
            the_ul = document.getElementById(all_uls[id]);
            the_li = document.getElementById(all_lis[id]);
            the_ul.style.display = 'block';
            the_li.childNodes[0].style.backgroundColor = '#295b6a';
            the_li.childNodes[0].style.color = '#fff';
            //blur the selected button
            clearButtons();
        }
        function clearButtons() {
            if (!document.getElementsByTagName) return;
            var anchors = document.getElementsByTagName("a");
            for (var i=0; i<anchors.length; i++) {
            var anchor = anchors[i];
            anchor.blur();
            }
        }