// Script to populate the staff directory faculty/division and school department select options and
// redirect to the relevant faculty/division or school/department page based on the selection

var facultiesDivisions;
var schoolsDepartments;

// Faculties/divisions
facultiesDivisions = new Array();

facultiesDivisions[0] = ["Chancellery", "http://ph.qut.edu.au/guts/org_CHANCELLERY.html"];
facultiesDivisions[1] = ["Faculty of Built Environment and Engineering", "http://ph.qut.edu.au/guts/org_FACULTY_OF_BUILT_ENVIRONMENT_AND_ENGINEERING.html"];
facultiesDivisions[2] = ["Faculty of Business", "http://ph.qut.edu.au/guts/org_FACULTY_OF_BUSINESS.html"];
facultiesDivisions[3] = ["Creative Industries Faculty", "http://ph.qut.edu.au/guts/org_CREATIVE_INDUSTRIES_FACULTY.html"];
facultiesDivisions[4] = ["Faculty of Education", "http://ph.qut.edu.au/guts/org_FACULTY_OF_EDUCATION.html"];
facultiesDivisions[5] = ["Faculty of Health", "http://ph.qut.edu.au/guts/org_FACULTY_OF_HEALTH.html"];
facultiesDivisions[6] = ["Faculty of Law", "http://ph.qut.edu.au/guts/org_FACULTY_OF_LAW.html"];
facultiesDivisions[7] = ["Faculty of Science and Technology", "http://ph.qut.edu.au/guts/org_FACULTY_OF_SCIENCE_AND_TECHNOLOGY.html"];
facultiesDivisions[8] = ["Humanities Program", "http://ph.qut.edu.au/guts/org_HUMANITIES_PROGRAM.html"];
facultiesDivisions[9] = ["Caboolture", "http://ph.qut.edu.au/guts/org_CABOOLTURE.html"];
facultiesDivisions[10] = ["Institute for Creative Industries & Innovation", "http://ph.qut.edu.au/guts/org_INSTITUTE_FOR_CREATIVE_INDUSTRIES_&_INNOVATION.html"];
facultiesDivisions[11] = ["Institute of Health & Biomedical Innovation (IHBI)", "http://ph.qut.edu.au/guts/org_INSTITUTE_OF_HEALTH_&_BIOMEDICAL_INNOVATION_(IHBI).html"];
facultiesDivisions[12] = ["Institute for Sustainable Resources", "http://ph.qut.edu.au/guts/org_INSTITUTE_FOR_SUSTAINABLE_RESOURCES.html"];
facultiesDivisions[13] = ["Information Security Institute", "http://ph.qut.edu.au/guts/org_INFORMATION_SECURITY_INSTITUTE.html"];
facultiesDivisions[14] = ["CRC for Construction Innovation", "http://ph.qut.edu.au/guts/org_CRC_FOR_CONSTRUCTION_INNOVATION.html"];
facultiesDivisions[15] = ["Sugar Research", "http://ph.qut.edu.au/guts/org_SUGAR_RESEARCH.html"];
facultiesDivisions[16] = ["Division of Administrative Services", "http://ph.qut.edu.au/guts/org_DIVISION_OF_ADMINISTRATIVE_SERVICES.html"];
facultiesDivisions[17] = ["Division of Technology, Information and Learning Support", "http://ph.qut.edu.au/guts/org_DIVISION_OF_TECHNOLOGY,_INFORMATION_AND_LEARNING_SUPPORT.html"];
facultiesDivisions[18] = ["Division of Finance and Resource Planning", "http://ph.qut.edu.au/guts/org_DIVISION_OF_FINANCE_AND_RESOURCE_PLANNING.html"];
facultiesDivisions[19] = ["Division of International & Development", "http://ph.qut.edu.au/guts/org_DIVISION_OF_INTERNATIONAL_&_DEVELOPMENT.html"];
facultiesDivisions[20] = ["Division of Research and Commercialisation", "http://ph.qut.edu.au/guts/org_DIVISION_OF_RESEARCH_AND_COMMERCIALISATION.html"];
facultiesDivisions[21] = ["Australasian CRC for Interaction Design (ACID)", "http://ph.qut.edu.au/guts/org_ACID.html"];
facultiesDivisions[22] = ["qutbluebox", "http://ph.qut.edu.au/guts/org_QUTBLUEBOX.html"];

schoolsDepartments = new Array();

// Chancellery
schoolsDepartments[0] = new Array();

schoolsDepartments[0][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_CHANCELLERY.html"];
schoolsDepartments[0][1] = ["Chancellery Office", "http://ph.qut.edu.au/guts/dorg_CHANCELLERY_OFFICE.html"];
schoolsDepartments[0][2] = ["Assurance and Risk Management Services", "http://ph.qut.edu.au/guts/dorg_ASSURANCE_AND_RISK_MANAGEMENT_SERVICES.html"];
schoolsDepartments[0][3] = ["Oodgeroo Unit", "http://ph.qut.edu.au/guts/dorg_OODGEROO_UNIT.html"];

// Faculty of Built Environment and Engineering
schoolsDepartments[1] = new Array();

schoolsDepartments[1][0] = ["Dean's Office (Fac of Blt Environ & Eng)", "http://ph.qut.edu.au/guts/dorg_DEAN'S_OFFICE_(FAC_OF_BLT_ENVIRON_&_ENG).html"];
schoolsDepartments[1][1] = ["External Relations Portfolio", "http://ph.qut.edu.au/guts/dorg_EXTERNAL_RELATIONS_PORTFOLIO.html"];
schoolsDepartments[1][2] = ["Research Portfolio", "http://ph.qut.edu.au/guts/dorg_RESEARCH_PORTFOLIO.html"];
schoolsDepartments[1][3] = ["Faculty Operations Portfolio", "http://ph.qut.edu.au/guts/dorg_FACULTY_OPERATIONS_PORTFOLIO.html"];
schoolsDepartments[1][4] = ["Teaching & Learning Portfolio", "http://ph.qut.edu.au/guts/dorg_TEACHING_&_LEARNING_PORTFOLIO.html"];
schoolsDepartments[1][5] = ["School of Design", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_DESIGN.html", ];
schoolsDepartments[1][6] = ["School of Engineering Systems", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_ENGINEERING_SYSTEMS.html"];
schoolsDepartments[1][7] = ["School of Urban Development", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_URBAN_DEVELOPMENT.html"];

// Faculty of Business
schoolsDepartments[2] = new Array();

schoolsDepartments[2][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OF_BUSINESS.html"];
schoolsDepartments[2][1] = ["Faculty Office - Business", "http://ph.qut.edu.au/guts/dorg_FACULTY_OFFICE_-_BUSINESS.html"];
schoolsDepartments[2][2] = ["QUT Languages Centre", "http://ph.qut.edu.au/guts/dorg_QUT_LANGUAGES_CENTRE.html"];
schoolsDepartments[2][3] = ["Brisbane Graduate School of Business", "http://ph.qut.edu.au/guts/dorg_BRISBANE_GRADUATE_SCHOOL_OF_BUSINESS.html"];
schoolsDepartments[2][4] = ["School of Accountancy", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_ACCOUNTANCY.html"];
schoolsDepartments[2][5] = ["School of Economics and Finance", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_ECONOMICS_AND_FINANCE.html"];
schoolsDepartments[2][6] = ["School of Management", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_MANAGEMENT.html"];
schoolsDepartments[2][7] = ["Advertising, Marketing & Public Relations", "http://ph.qut.edu.au/guts/dorg_ADVERTISING,_MARKETING_&_PUBLIC_RELATIONS.html"];
schoolsDepartments[2][8] = ["International Business", "http://ph.qut.edu.au/guts/dorg_INTERNATIONAL_BUSINESS.html"];

// Creative Industries Faculty
schoolsDepartments[3] = new Array();

schoolsDepartments[3][0] = ["Dean's Office", "http://ph.qut.edu.au/guts/dorg_DEAN'S_OFFICE.html"];
schoolsDepartments[3][1] = ["Teaching & Learning Office", "http://ph.qut.edu.au/guts/dorg_TEACHING_&_LEARNING_OFFICE.html"];
schoolsDepartments[3][2] = ["Faculty Research Office", "http://ph.qut.edu.au/guts/dorg_FACULTY_RESEARCH_OFFICE.html"];
schoolsDepartments[3][3] = ["Centre of Excellence in CIF", "http://ph.qut.edu.au/guts/dorg_CENTRE_OF_EXCELLENCE_IN_CIF.html"];
schoolsDepartments[3][4] = ["P1 - Creative Writing & Cultural Studies, Drama, Film & TV", "http://ph.qut.edu.au/guts/dorg_P1-CREATIVE_WRITING_&_CULTURAL_STUDIES,_DRAMA,_FILM_&_TV.html"];
schoolsDepartments[3][5] = ["P2 - Fashion, Journalism, Media & Communication", "http://ph.qut.edu.au/guts/dorg_P2-FASHION,_JOURNALISM_AND_MEDIA_&_COMMUNICATION.html"];
schoolsDepartments[3][6] = ["P3 - Art and Design, Dance, Music & Sound", "http://ph.qut.edu.au/guts/dorg_P3-ART_&_DESIGN,_DANCE,_MUSIC_&_SOUND.html"];

// Faculty of Education
schoolsDepartments[4] = new Array();

schoolsDepartments[4][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OF_EDUCATION.html"];
schoolsDepartments[4][1] = ["School of Cultural & Language Studies in Education", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_CULTURAL_&_LANGUAGE_STUDIES_IN_EDUCATION.html"];
schoolsDepartments[4][2] = ["School of Early Childhood", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_EARLY_CHILDHOOD.html"];
schoolsDepartments[4][3] = ["Learning & Professional Studies", "http://ph.qut.edu.au/guts/dorg_LEARNING_&_PROFESSIONAL_STUDIES.html"];
schoolsDepartments[4][4] = ["School of Maths, Science and Technology Education", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_MATHS,_SCIENCE_AND_TECHNOLOGY_EDUCATION.html"];

// Faculty of Health
schoolsDepartments[5] = new Array();

schoolsDepartments[5][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OF_HEALTH.html"];
schoolsDepartments[5][1] = ["School of Human Movement Studies", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_HUMAN_MOVEMENT_STUDIES.html"];
schoolsDepartments[5][2] = ["School of Nursing and Midwifery", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_NURSING_AND_MIDWIFERY.html"];
schoolsDepartments[5][3] = ["School of Optometry", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_OPTOMETRY.html"];
schoolsDepartments[5][4] = ["School of Psychology and Counselling", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_PSYCHOLOGY_AND_COUNSELLING.html"];
schoolsDepartments[5][5] = ["School of Public Health", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_PUBLIC_HEALTH.html"];
schoolsDepartments[5][6] = ["Social Work and Human Services", "http://ph.qut.edu.au/guts/dorg_SOCIAL_WORK_AND_HUMAN_SERVICES_ACADEMIC_PROGRAM.html"];

// Faculty of Law
schoolsDepartments[6] = new Array();

schoolsDepartments[6][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OF_LAW.html"];
schoolsDepartments[6][1] = ["Faculty Office (Law)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OFFICE_(LAW).html"];
schoolsDepartments[6][2] = ["Law School", "http://ph.qut.edu.au/guts/dorg_LAW_SCHOOL.html"];
schoolsDepartments[6][3] = ["Research (Law)", "http://ph.qut.edu.au/guts/dorg_RESEARCH_(LAW).html"];
schoolsDepartments[6][4] = ["Justice Studies", "http://ph.qut.edu.au/guts/dorg_JUSTICE_STUDIES.html"];

// Faculty of Science and Technology
schoolsDepartments[7] = new Array();

schoolsDepartments[7][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_FACULTY_OF_SCIENCE_AND_TECHNOLOGY.html"];
schoolsDepartments[7][1] = ["Portfolio A - Faculty of Science and Technology", "http://ph.qut.edu.au/guts/dorg_PORTFOLIO_A_-_FACULTY_OF_SCIENCE_AND_TECHNOLOGY.html"];
schoolsDepartments[7][2] = ["Portfolio B - Faculty of Science and Technology", "http://ph.qut.edu.au/guts/dorg_PORTFOLIO_B_-_FACULTY_OF_SCIENCE_AND_TECHNOLOGY.html"];
//schoolsDepartments[7][1] = ["School of Life Sciences", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_LIFE_SCIENCES.html"];
//schoolsDepartments[7][2] = ["School of Mathematical Sciences", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_MATHEMATICAL_SCIENCES.html"];
//schoolsDepartments[7][3] = ["School of Natural Resource Sciences", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_NATURAL_RESOURCE_SCIENCES.html"];
//schoolsDepartments[7][4] = ["School of Physical and Chemical Sciences", "http://ph.qut.edu.au/guts/dorg_SCHOOL_OF_PHYSICAL_AND_CHEMICAL_SCIENCES.html"];
//schoolsDepartments[7][5] = ["Information Technology", "http://ph.qut.edu.au/guts/dorg_INFORMATION_TECHNOLOGY.html"];

// QUT Carseldine
schoolsDepartments[8] = new Array();

// Caboolture
schoolsDepartments[9] = new Array();

schoolsDepartments[9][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_CABOOLTURE.html"];

// Institute for Creative Industries & Innovation
schoolsDepartments[10] = new Array();

schoolsDepartments[10][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_INSTITUTE_FOR_CREATIVE_INDUSTRIES_&_INNOVATION.html"];

// Institute of Health & Biomedical Innovation (IHBI)
schoolsDepartments[11] = new Array();

schoolsDepartments[11][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_INSTITUTE_OF_HEALTH_&_BIOMEDICAL_INNOVATION_(IHBI).html"];

// Institute for Sustainable Resources
schoolsDepartments[12] = new Array();

schoolsDepartments[12][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_INSTITUTE_FOR_SUSTAINABLE_RESOURCES.html"];

// Information Security Institute
schoolsDepartments[13] = new Array();

schoolsDepartments[13][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_INFORMATION_SECURITY_INSTITUTE.html"];
schoolsDepartments[13][1] = ["ISI - FIT - Faculty Office", "http://ph.qut.edu.au/guts/dorg_ISI_-_FIT_-_FACULTY_OFFICE.html"];
schoolsDepartments[13][2] = ["ISI-BEE-School of Engineering Systems", "http://ph.qut.edu.au/guts/dorg_ISI-BEE-SCHOOL_OF_ENGINEERING_SYSTEMS.html"];

// CRC for Construction Innovation
schoolsDepartments[14] = new Array();

schoolsDepartments[14][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_CRC_FOR_CONSTRUCTION_INNOVATION.html"];
schoolsDepartments[14][1] = ["CRC Administration", "http://ph.qut.edu.au/guts/dorg_CRC_ADMINISTRATION.html"];
schoolsDepartments[14][2] = ["CRC Education Program", "http://ph.qut.edu.au/guts/dorg_CRC_EDUCATION_PROGRAM.html"];
schoolsDepartments[14][3] = ["CRC Research Program", "http://ph.qut.edu.au/guts/dorg_CRC_RESEARCH_PROGRAM.html"];

// Sugar Research
schoolsDepartments[15] = new Array();

schoolsDepartments[15][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_SUGAR_RESEARCH.html"];

// Division of Administrative Services
schoolsDepartments[16] = new Array();

schoolsDepartments[16][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_DIVISION_OF_ADMINISTRATIVE_SERVICES.html"];
schoolsDepartments[16][1] = ["Facilities Management Department", "http://ph.qut.edu.au/guts/dorg_FACILITIES_MANAGEMENT_DEPARTMENT.html"];
schoolsDepartments[16][2] = ["Human Resources Department", "http://ph.qut.edu.au/guts/dorg_HUMAN_RESOURCES_DEPARTMENT.html"];
schoolsDepartments[16][3] = ["Marketing & Communication Department", "http://ph.qut.edu.au/guts/dorg_MARKETING_&_COMMUNICATION_DEPARTMENT.html"];
schoolsDepartments[16][4] = ["Student Business Services", "http://ph.qut.edu.au/guts/dorg_STUDENT_BUSINESS_SERVICES.html"];
schoolsDepartments[16][5] = ["Student Support Services", "http://ph.qut.edu.au/guts/dorg_STUDENT_SUPPORT_SERVICES.html"];

// Division of Technology, Information and Learning Support
schoolsDepartments[17] = new Array();

schoolsDepartments[17][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_DIVISION_OF_TECHNOLOGY,_INFORMATION_AND_LEARNING_SUPPORT.html"];
schoolsDepartments[17][1] = ["Information Technology Services Dept", "http://ph.qut.edu.au/guts/dorg_INFORMATION_TECHNOLOGY_SERVICES_DEPT.html"];
schoolsDepartments[17][2] = ["Library", "http://ph.qut.edu.au/guts/dorg_LIBRARY.html"];
schoolsDepartments[17][3] = ["eLearning Services", "http://ph.qut.edu.au/guts/dorg_ELEARNING_SERVICES.html"];
schoolsDepartments[17][4] = ["Learning Environments and Technology Services", "http://ph.qut.edu.au/guts/dorg_LEARNING_ENVIRONMENTS_AND_TECHNOLOGY_SERVICES.html"];

// Division of Finance and Resource Planning
schoolsDepartments[18] = new Array();

schoolsDepartments[18][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_DIVISION_OF_FINANCE_AND_RESOURCE_PLANNING.html"];
schoolsDepartments[18][1] = ["Finance & Resources Plan. Dir. Office", "http://ph.qut.edu.au/guts/dorg_FINANCE_&_RESOURCES_PLAN._DIR._OFFICE.html"];
schoolsDepartments[18][2] = ["Corporate Finance", "http://ph.qut.edu.au/guts/dorg_CORPORATE_FINANCE.html"];
schoolsDepartments[18][3] = ["Planning and Quality", "http://ph.qut.edu.au/guts/dorg_PLANNING_AND_QUALITY.html"];
schoolsDepartments[18][4] = ["Decision Support", "http://ph.qut.edu.au/guts/dorg_DECISION_SUPPORT.html"];
schoolsDepartments[18][5] = ["Finance and Resource Systems", "http://ph.qut.edu.au/guts/dorg_FINANCE_AND_RESOURCE_SYSTEMS.html"];

// Division of International & Development
schoolsDepartments[19] = new Array();

schoolsDepartments[19][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_DIVISION_OF_INTERNATIONAL_&_DEVELOPMENT.html"];
schoolsDepartments[19][1] = ["International & Development", "http://ph.qut.edu.au/guts/dorg_INTERNATIONAL_&_DEVELOPMENT.html"];
schoolsDepartments[19][2] = ["Development Office", "http://ph.qut.edu.au/guts/dorg_DEVELOPMENT_OFFICE.html"];
schoolsDepartments[19][3] = ["International College", "http://ph.qut.edu.au/guts/dorg_INTERNATIONAL_COLLEGE.html"];
schoolsDepartments[19][4] = ["QUT International", "http://ph.qut.edu.au/guts/dorg_QUT_INTERNATIONAL.html"];
schoolsDepartments[19][5] = ["QUT Precincts", "http://ph.qut.edu.au/guts/dorg_QUT_PRECINCTS.html"];

// Division of Research and Commercialisation
schoolsDepartments[20] = new Array();

schoolsDepartments[20][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_DIVISION_OF_RESEARCH_AND_COMMERCIALISATION.html"];
schoolsDepartments[20][1] = ["Office of Research", "http://ph.qut.edu.au/guts/dorg_OFFICE_OF_RESEARCH.html"];
schoolsDepartments[20][2] = ["Research & Commercialisation", "http://ph.qut.edu.au/guts/dorg_RESEARCH_&_COMMERCIALISATION.html"];
schoolsDepartments[20][3] = ["Office of Commercial Services", "http://ph.qut.edu.au/guts/dorg_OFFICE_OF_COMMERCIAL_SERVICES.html"];
schoolsDepartments[20][4] = ["Research Students Centre", "http://ph.qut.edu.au/guts/dorg_RESEARCH_STUDENTS_CENTRE.html"];

// ACID
schoolsDepartments[21] = new Array();
schoolsDepartments[21][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_ACID.html"];

// qutbluebox
schoolsDepartments[22] = new Array();
schoolsDepartments[22][0] = ["(Main Office)", "http://ph.qut.edu.au/guts/dorg_QUTBLUEBOX.html"];

// Initialise the faculty/division and school/department select options and give focus to the search string field
function onStaffDirLoad() {
   var facultyDivisionOptions;

   facultyDivisionOptions = document.getElementById("facultyDivision").options;

   for (index = 0; index < facultiesDivisions.length; index++)
      facultyDivisionOptions[facultyDivisionOptions.length] = new Option(facultiesDivisions[index][0], index);

   document.getElementById("searchString").focus();
}

// Populate the school/department select options when a faculty/division is selected
function onFacultyDivisionChange(form) {
   var facultyDivisionSelect;
   var facultyDivisionSelectedIndex;
   var facultyDivisionValue;
   var schoolDepartmentSelect;
   var schoolDepartmentOptions;
   var facultyDivisionSchoolsDepartments;

   facultyDivisionSelect = form.facultyDivision;
   facultyDivisionSelectedIndex = facultyDivisionSelect.selectedIndex;
   facultyDivisionValue = facultyDivisionSelect.options[facultyDivisionSelectedIndex].value;

   schoolDepartmentSelect = form.schoolDepartment;
   schoolDepartmentOptions = schoolDepartmentSelect.options;

   schoolDepartmentSelect.selectedIndex = 0;

   while (schoolDepartmentOptions.length > 1)
      schoolDepartmentOptions[1] = null;

   if (facultyDivisionValue >= 0) {
      facultyDivisionSchoolsDepartments = schoolsDepartments[facultyDivisionValue];

      for (index = 0; index < facultyDivisionSchoolsDepartments.length; index++)
         schoolDepartmentOptions[schoolDepartmentOptions.length] = new Option(facultyDivisionSchoolsDepartments[index][0], index);
   }
}

// Redirect to the relevant faculty/division or school/department page based on the selection
function onDoSearchByOrganisationalAreaClick(form) {
   var facultyDivisionSelect;
   var facultyDivisionValue;
   var schoolDepartmentSelect;
   var schoolDepartmentValue;
   var url;

   facultyDivisionSelect = form.facultyDivision;
   facultyDivisionValue = facultyDivisionSelect.options[facultyDivisionSelect.selectedIndex].value;

   if (facultyDivisionValue == -1)
      alert("Please select a faculty/division");
   else {
     schoolDepartmentSelect = form.schoolDepartment;
     schoolDepartmentValue = schoolDepartmentSelect.options[schoolDepartmentSelect.selectedIndex].value;

     if (schoolDepartmentValue == -1)
        url = facultiesDivisions[facultyDivisionValue][1];
     else
        url = schoolsDepartments[facultyDivisionValue][schoolDepartmentValue][1];

     window.location = url;
   }

   return false;
}
