function currentMenu(menuHeaders) { //var menuHeaderLC=menuHeaders.toLowerCase(); var getMenu= new Array(); getMenu=menuHeaders.split("/"); breadcrumbLength = getMenu.length; var highLight = 0; switch(getMenu[0]) { case "Home": { var homeLink = document.getElementById("home"); homeLink.style.backgroundColor = '#b5111a'; homeLink.style.borderRight = '5px solid #b5111a'; homeLink.style.color = '#fff'; break; } case "Education": { var education = document.getElementById("education"); education.style.backgroundColor = '#b5111a'; education.style.borderRight = '5px solid #b5111a'; education.style.color = '#fff'; var educationMenu = document.getElementById("educationMenu"); educationMenu.style.display = 'block'; var educationMenuFly = document.getElementById("educationMenuFly"); educationMenuFly.style.display = 'none'; //lets see if we need to display any expanded menus if(getMenu[1]=="Undergraduate Students") { var current = document.getElementById("current"); current.style.backgroundColor = '#6D6E68'; current.style.borderRight = '5px solid #6D6E68'; current.style.color = '#fff'; var currentUGMenu = document.getElementById("currentUGMenu"); currentUGMenu.style.display = 'block'; var currentUGMenuFly = document.getElementById("currentUGMenuFly"); currentUGMenuFly.style.display = 'none'; if(getMenu[2] == "Programs")//3rd level menu { var Programs = document.getElementById("Programs"); Programs.style.backgroundColor = '#ddd'; Programs.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Scholarships and Awards")//3rd level menu { var Scholarships = document.getElementById("Scholarships"); Scholarships.style.backgroundColor = '#ddd'; Scholarships.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Co-operative Education")//3rd level menu { var Coop = document.getElementById("Coop"); Coop.style.backgroundColor = '#ddd'; Coop.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "FAQ")//3rd level menu { var FAQ = document.getElementById("FAQ"); FAQ.style.backgroundColor = '#ddd'; FAQ.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Advising")//3rd level menu { var Advising = document.getElementById("Advising"); Advising.style.backgroundColor = '#ddd'; Advising.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Student Life")//3rd level menu { var StudentLife = document.getElementById("StudentLife"); StudentLife.style.backgroundColor = '#ddd'; StudentLife.style.borderRight = '5px solid #ddd'; } } else if(getMenu[1] == "Prospective Undergrads") { var prospectiveStudents = document.getElementById("prospectiveStudents"); prospectiveStudents.style.backgroundColor = '#6D6E68'; prospectiveStudents.style.borderRight = '5px solid #6D6E68'; prospectiveStudents.style.color = '#fff'; var prospectiveMenu = document.getElementById("prospectiveMenu"); prospectiveMenu.style.display = 'block'; var prospectiveMenuFly = document.getElementById("prospectiveMenuFly"); prospectiveMenuFly.style.display = 'none'; if(getMenu[2] == "Admission")//3rd level menu { var admissionsReq = document.getElementById("admissionsReq"); admissionsReq.style.backgroundColor = '#ddd'; admissionsReq.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Programs")//3rd level menu { var ProspectivePrograms = document.getElementById("ProspectivePrograms"); ProspectivePrograms.style.backgroundColor = '#ddd'; ProspectivePrograms.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Scholarships")//3rd level menu { var ProspectiveScholarships = document.getElementById("ProspectiveScholarships"); ProspectiveScholarships.style.backgroundColor = '#ddd'; ProspectiveScholarships.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Co-operative Education")//3rd level menu { var ProspectiveCoop = document.getElementById("ProspectiveCoop"); ProspectiveCoop.style.backgroundColor = '#ddd'; ProspectiveCoop.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Careers in Computing")//3rd level menu { var ProspectiveCareers = document.getElementById("ProspectiveCareers"); ProspectiveCareers.style.backgroundColor = '#ddd'; ProspectiveCareers.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Student Life")//3rd level menu { var ProspectiveStudentLife = document.getElementById("ProspectiveStudentLife"); ProspectiveStudentLife.style.backgroundColor = '#ddd'; ProspectiveStudentLife.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "High School Outreach")//3rd level menu { var ProspectiveHighSchool = document.getElementById("ProspectiveHighSchool"); ProspectiveHighSchool.style.backgroundColor = '#ddd'; ProspectiveHighSchool.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Questions?")//3rd level menu { var ProspectiveQuestions = document.getElementById("ProspectiveQuestions"); ProspectiveQuestions.style.backgroundColor = '#ddd'; ProspectiveQuestions.style.borderRight = '5px solid #ddd'; } }else if(getMenu[1]=="Graduate Students") { var grad = document.getElementById("grad"); grad.style.backgroundColor = '#6D6E68'; grad.style.borderRight = '5px solid #6D6E68'; grad.style.color = '#fff'; var gradMenu = document.getElementById("gradMenu"); gradMenu.style.display = 'block'; var gradMenuFly = document.getElementById("gradMenuFly"); gradMenuFly.style.display = 'none'; if(getMenu[2] == "Program Overview")//3rd level menu { var GradProgramOverview = document.getElementById("GradProgramOverview"); GradProgramOverview.style.backgroundColor = '#ddd'; GradProgramOverview.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Apply Online")//3rd level menu { var GradApply = document.getElementById("GradApply"); GradApply.style.backgroundColor = '#ddd'; GradApply.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "FAQ")//3rd level menu { var GradFAQ = document.getElementById("GradFAQ"); GradFAQ.style.backgroundColor = '#ddd'; GradFAQ.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "The Curriculum")//3rd level menu { var GradProgram = document.getElementById("GradProgram"); GradProgram.style.backgroundColor = '#ddd'; GradProgram.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Useful Resources")//3rd level menu { var GradResources = document.getElementById("GradResources"); GradResources.style.backgroundColor = '#ddd'; GradResources.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Grad Announcements")//3rd level menu { var GradNews = document.getElementById("GradNews"); GradNews.style.backgroundColor = '#ddd'; GradNews.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Contact Us")//3rd level menu { var GradContact = document.getElementById("GradContact"); GradContact.style.backgroundColor = '#ddd'; GradContact.style.borderRight = '5px solid #ddd'; } }else if(getMenu[1]=="Information Central") { var ic = document.getElementById("ic"); ic.style.backgroundColor = '#6D6E68'; ic.style.borderRight = '5px solid #6D6E68'; ic.style.color = '#fff'; var icMenu = document.getElementById("icMenu"); icMenu.style.display = 'block'; var icMenuFly = document.getElementById("icMenuFly"); icMenuFly.style.display = 'none'; if(getMenu[2] == "Course Central") { if(getMenu[3] == "CS Instructional Labs")//3rd level menu { var csil = document.getElementById("csil"); csil.style.backgroundColor = '#ddd'; csil.style.borderRight = '5px solid #ddd'; } else { var ccStudents = document.getElementById("courseCentral"); ccStudents.style.backgroundColor = '#ddd'; ccStudents.style.borderRight = '5px solid #ddd'; } }else if(getMenu[2] == "Forms Central")//3rd level menu { var formsCentral = document.getElementById("formsCentral"); formsCentral.style.backgroundColor = '#ddd'; formsCentral.style.borderRight = '5px solid #ddd'; } } break; } case "Research": { var research = document.getElementById("research"); research.style.backgroundColor = '#b5111a'; research.style.borderRight = '5px solid #b5111a'; research.style.color = '#fff'; var researchMenu = document.getElementById("researchMenu"); researchMenu.style.display = 'block'; var researchMenuFly = document.getElementById("researchMenuFly"); researchMenuFly.style.display = 'none'; //lets see if we need to display any expanded menus if(getMenu[1] == "Labs - Groups & Institutes")//2nd level menu { var ResearchLabs = document.getElementById("ResearchLabs"); ResearchLabs.style.backgroundColor = '#ddd'; ResearchLabs.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Industry Relations")//3rd level menu { var CRIR = document.getElementById("CRIR"); CRIR.style.backgroundColor = '#ddd'; CRIR.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Tech Reports")//3rd level menu { var TechReports = document.getElementById("TechReports"); TechReports.style.backgroundColor = '#ddd'; TechReports.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Theses")//3rd level menu { var Theses = document.getElementById("Theses"); Theses.style.backgroundColor = '#ddd'; Theses.style.borderRight = '5px solid #ddd'; } break; } case "People": { var people = document.getElementById("people"); people.style.backgroundColor = '#b5111a'; people.style.borderRight = '5px solid #b5111a'; people.style.color = '#fff'; var peopleMenu = document.getElementById("peopleMenu"); peopleMenu.style.display = 'block'; var peopleMenuFly = document.getElementById("peopleMenuFly"); peopleMenuFly.style.display = 'none'; if(getMenu[1]=="Faculty") { var faculty = document.getElementById("faculty"); faculty.style.backgroundColor = '#6D6E68'; faculty.style.borderRight = '5px solid #6D6E68'; faculty.style.color = '#fff'; var facultyPeople = document.getElementById("facultyPeople"); facultyPeople.style.display = 'block'; var facultyPeopleFly = document.getElementById("facultyPeopleFly"); facultyPeopleFly.style.display = 'none'; if(getMenu[2] == "Professors & Lecturers")//3rd level menu { var csfaculty = document.getElementById("csfaculty"); csfaculty.style.backgroundColor = '#ddd'; csfaculty.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Emeritus Professors")//3rd level menu { var EmeritusProfessors = document.getElementById("EmeritusProfessors"); EmeritusProfessors.style.backgroundColor = '#ddd'; EmeritusProfessors.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Adjunct Professors")//3rd level menu { var AdjunctProfessors = document.getElementById("AdjunctProfessors"); AdjunctProfessors.style.backgroundColor = '#ddd'; AdjunctProfessors.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Associate Members")//3rd level menu { var AssociateMembers = document.getElementById("AssociateMembers"); AssociateMembers.style.backgroundColor = '#ddd'; AssociateMembers.style.borderRight = '5px solid #ddd'; } } else if(getMenu[1] == "Grad Students")//3rd level menu { var PeopleGrads = document.getElementById("PeopleGrads"); PeopleGrads.style.backgroundColor = '#ddd'; PeopleGrads.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Research Staff")//3rd level menu { var PeopleResearch = document.getElementById("PeopleResearch"); PeopleResearch.style.backgroundColor = '#ddd'; PeopleResearch.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Administrative Staff")//3rd level menu { var PeopleAdministrative = document.getElementById("PeopleAdministrative"); PeopleAdministrative.style.backgroundColor = '#ddd'; PeopleAdministrative.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Technical Support Staff")//3rd level menu { var PeopleTechnical = document.getElementById("PeopleTechnical"); PeopleTechnical.style.backgroundColor = '#ddd'; PeopleTechnical.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Our Alumni")//3rd level menu { var PeopleAlumni = document.getElementById("PeopleAlumni"); PeopleAlumni.style.backgroundColor = '#ddd'; PeopleAlumni.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Visitors")//3rd level menu { var PeopleVisitors = document.getElementById("PeopleVisitors"); PeopleVisitors.style.backgroundColor = '#ddd'; PeopleVisitors.style.borderRight = '5px solid #ddd'; } break; } case "News": { var csnews = document.getElementById("csnews"); csnews.style.backgroundColor = '#b5111a'; csnews.style.borderRight = '5px solid #b5111a'; csnews.style.color = '#fff'; var csnewsMenu = document.getElementById("csnewsMenu"); csnewsMenu.style.display = 'block'; var csnewsMenuFly = document.getElementById("csnewsMenuFly"); csnewsMenuFly.style.display = 'none'; if(getMenu[1] == "News Articles")//3rd level menu { var CSNewsArticles = document.getElementById("CSNewsArticles"); CSNewsArticles.style.backgroundColor = '#ddd'; CSNewsArticles.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Seminars & Events")//3rd level menu { var CSNewsEvents = document.getElementById("CSNewsEvents"); CSNewsEvents.style.backgroundColor = '#ddd'; CSNewsEvents.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Distinguished Lecture Series")//3rd level menu { var CSNewsDistinguished = document.getElementById("CSNewsDistinguished"); CSNewsDistinguished.style.backgroundColor = '#ddd'; CSNewsDistinguished.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Scholarship News")//3rd level menu { var CSNewsScholarship = document.getElementById("CSNewsScholarship"); CSNewsScholarship.style.backgroundColor = '#ddd'; CSNewsScholarship.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "ACM Programming Contest")//3rd level menu { var CSNewsACM = document.getElementById("CSNewsACM"); CSNewsACM.style.backgroundColor = '#ddd'; CSNewsACM.style.borderRight = '5px solid #ddd'; } break; } case "About Us": { var about = document.getElementById("about"); about.style.backgroundColor = '#b5111a'; about.style.borderRight = '5px solid #b5111a'; about.style.color = '#fff'; var aboutMenu = document.getElementById("aboutMenu"); aboutMenu.style.display = 'block'; var aboutMenuFly = document.getElementById("aboutMenuFly"); aboutMenuFly.style.display = 'none'; if(getMenu[1]=="Administration") { var aboutAdministration = document.getElementById("aboutAdministration"); aboutAdministration.style.backgroundColor = '#6D6E68'; aboutAdministration.style.borderRight = '5px solid #6D6E68'; aboutAdministration.style.color = '#fff'; var adminMenu = document.getElementById("adminMenu"); adminMenu.style.display = 'block'; var adminMenuFly = document.getElementById("adminMenuFly"); adminMenuFly.style.display = 'none'; if(getMenu[2] == "School Committees")//3rd level menu { var SchoolCommittees = document.getElementById("SchoolCommittees"); SchoolCommittees.style.backgroundColor = '#ddd'; SchoolCommittees.style.borderRight = '5px solid #ddd'; } else if(getMenu[2] == "Executive Committee")//3rd level menu { var ExecutiveCommittee = document.getElementById("ExecutiveCommittee"); ExecutiveCommittee.style.backgroundColor = '#ddd'; ExecutiveCommittee.style.borderRight = '5px solid #ddd'; } break; } else if(getMenu[1] == "Job Opportunities")//3rd level menu { var JobOpportunities = document.getElementById("JobOpportunities"); JobOpportunities.style.backgroundColor = '#ddd'; JobOpportunities.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Contact Info")//3rd level menu { var ContactInfo = document.getElementById("ContactInfo"); ContactInfo.style.backgroundColor = '#ddd'; ContactInfo.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Directions to SFU")//3rd level menu { var Directions = document.getElementById("Directions"); Directions.style.backgroundColor = '#ddd'; Directions.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "School Facilities")//3rd level menu { var SchoolFacilities = document.getElementById("SchoolFacilities"); SchoolFacilities.style.backgroundColor = '#ddd'; SchoolFacilities.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "History of the School")//3rd level menu { var History = document.getElementById("History"); History.style.backgroundColor = '#ddd'; History.style.borderRight = '5px solid #ddd'; } else if(getMenu[1] == "Constitution")//3rd level menu { var Constitution = document.getElementById("Constitution"); Constitution.style.backgroundColor = '#ddd'; Constitution.style.borderRight = '5px solid #ddd'; } break; } default: { break; } } //Finally, lets highlight the current link we're on (ie. the last //token in our current page's URL. //We must check if the number of tokens is greater than 2, othewise //we're currently looking at one of the main menus(ie. education //research, people, etc) and they already have their own //highlight style (as defined above) // if(breadcrumbLength > 2) // { // if(getMenu[breadcrumbLength-1]=="")//in some cases the last breadcrumb is empty // { // hlCurrentLink(getMenu[breadcrumbLength-2]); // }else // { // hlCurrentLink(getMenu[breadcrumbLength-1]); // } // } } function hlCurrentLink(hlLink) { var hl = document.getElementById(hlLink); hl.style.backgroundColor = '#ddd'; hl.style.borderRight = '5px solid #ddd'; } //This function shows/hides any element with id, "obj". If //the element is shown, its corresponding flyout is hidden. If //the element is hidden, its corresponding flyout is shown. This //function is not currently being used. /* function showHide(obj) { var clfMenuHead = document.getElementById(obj); var flyout = obj + "Fly"; var clfMenuFlyout = document.getElementById(flyout) if ( clfMenuHead.style.display == "none" ) { clfMenuHead.style.display = 'block'; clfMenuFlyout.style.display = 'none'; } else { clfMenuHead.style.display = 'none'; } }*/