/*Note: You must escape single quotes in the array items below!*/
var dropdowns = new Array('schoolboard', 'students', 'parents', 'districtstaff', 'media', 'aboutsd79', 
							'schools', 'programs', 'Administration', 'humanresources', 'departments');
var groupMenus = new Array();
groupMenus['students'] = {
							'Students':{
								'Info for Students':'/groups/students/',
								'Curriculum Areas K-12':'http://www.sd79.bc.ca/groups/curriculumk12/',
								'Student Services':'/groups/students/wiki/4c5fd/Student_Services.html',
								'Student Support Services':'/groups/sss',
								'District Calendars':'/DistrictCalendar/events/',
								'Bus Info':'/groups/transportation/',
								'Info for Grads':'/groups/curriculumk12/wiki/2de6a/Graduation.html'},
							'Parents':{
								'Parents Home':'/groups/parents/',
								'Bus Info':'/groups/transportation',
								'District Calendar':'/groups/calendar/',
								'District Parents Advisory Council':'http://www.cowichanvalleydpac.ca',
								'Public Health Info':'/groups/publichealth/'},
							'Programs':{
								'Programs Home':'/groups/students/wiki/d865d/Programs.html',
								'International Program':'http://www.sd79.bc.ca/programs/international'}
								
								}; 

groupMenus['parents'] = {
							'Parents Home':'/groups/parents/wiki/welcome/Parents.html',
							'Getting Involved':'/groups/parents/wiki/b1d8f/Getting_Involved.html',
							'Important Dates':'/groups/parents/wiki/caef9/Important_Dates.html',
							'Subscribe to e-newletters':'/groups/parents/wiki/cb49c/Subscribe_to_e-newletters.html',
							'Registering Your Child':'/groups/parents/wiki/d9097/Registering_Your_Child.html',
							'Support For Students':'/groups/parents/wiki/9ff42/Support_For_Students.html',
							'Early Learning Partnership':'/groups/parents/wiki/9be79/Early_Learning_Partnership.html'
							
						}; 	

groupMenus['districtstaff'] = {
							'District Staff Home':'/groups/parents/wiki/welcome/Parents.html',
							'Accountability and Assessments':'/groups/districtstaff/wiki/2f039/Accountability_and_Assessments.html',
							'BCeSIS Implementation Project':'/groups/districtstaff/wiki/7189a/BCeSIS_Implementation_Project.html',
							'TOC Scheduler':'http://142.25.232.157/tango/toc/tocrequest.htm',
							'District Resource Center':'/groups/drc'
						};	
						
groupMenus['schoolboard'] = {
							'School Board':{
								'School Board Home':'/groups/schoolboard/wiki/welcome/School_Board.html',
								'Trustees':'/groups/trustees/wiki/welcome/trustees.html',
								'Agenda and Minutes':'http://bcsd79.civicweb.net/Documents/DocumentList.aspx?ID=508',
								'Policies':'http://bcsd79.civicweb.net/Documents/DocumentList.aspx?ID=508'},
							'Financial Statements':'/groups/schoolboard/wiki/welcome/School_Board.html',	
							'Policies':'http://bcsd79.civicweb.net/Documents/DocumentList.aspx?ID=508',
							'Reports and Research':'/groups/schoolboard/wiki/413d4/Reports.html'
						};	
	
groupMenus['aboutsd79'] = {
							'About SD79 Home':'/groups/aboutsd79/wiki/welcome/About_SD79.html',
							'Key Facts':'/groups/aboutsd79/wiki/ee855/Key_Facts.html',
							'Mission and Vision':'/groups/aboutsd79/wiki/65d46/Mission_and_Vision.html',
							'District Achievement Contract':'/groups/aboutsd79/wiki/1a847/District_Achievement_Contract.html',
							'Subscribe to e-newsletters':'/groups/aboutsd79/wiki/7a6cd/Subscribe_to_e-newsletters.html',
							'Superintendent\'s Newsletter':'/groups/aboutsd79/wiki/5ae4d/Superintendent%27s_Newsletter.html'
						}; 
	
groupMenus['schools'] = {
							'Schools':{
								'Elementary Schools':'/groups/schools/wiki/e7a1d/Elementary_Schools.html',
								'Middle Schools':'/groups/schools/wiki/0b6d4/Middle_Secondary_Schools.html',
								'Secondary Schools':'/groups/schools/wiki/0b6d4/Middle_Secondary_Schools.html',
								'Alternate Schools':'/groups/schools/wiki/17f0d/Alternate_Schools.html',
								'International Education':'http://www.sd79.bc.ca/programs/international'},
							'Programs':{	
								'ABED Department':'http://www.sd79.bc.ca/wp/abed/',
								'Adult Education':'/groups/schools/wiki/a62eb/Adult_Education.html',
						    	'Curriculum Areas K-12':'/groups/curriculumk12/',
						    	'Distance Education':'/groups/dl/'}
						};  
	
groupMenus['programs'] = {
							'Programs Home':'/groups/programs/wiki/welcome/Programs.html'
						}; 
	
groupMenus['Administration'] = {
							'Administration Home':'/groups/administration/wiki/welcome/Administration.html',
							'School Fees':'/groups/administration/wiki/21bb7/School_Fees.html',
							'School Calendar':'/groups/administration/wiki/f5575/School_Calendar.html',
							'Superintendent\'s Message':'/groups/administration/wiki/a5fdf/Superintendent%27s_Message.html',
							'District Budgets':'/groups/administration/wiki/b6770/District_Budgets.html',
							'District Policy Manual':'/groups/administration/wiki/8d745/District_Policy_Manual.html',
							'Purchasing':'/groups/purchasing'
						};  
	
groupMenus['humanresources'] = {
							'Human Resources - Home':'/groups/humanresources/',
							'Information & Documents':{
								'CUPE Info':'/groups/humanresources/wiki/7012a/CUPE_info.html',
								'Principal & VP Info':'/groups/humanresources/wiki/8aa4a/Principals_VP_Excluded.html',
								'Teacher Info':'/groups/humanresources/wiki/d8fa7/Teachers.html',
								'Teacher On Call Info':'/groups/humanresources/wiki/a248c/TOC_info.html',
								'USW Info':'/groups/humanresources/wiki/6aca5/USW_Postings.html'},
							'Employment Opportunities':'/groups/employment/',
							'Employee Secure Area':{
								'CUPE Secure':'/groups/cupesecure/',
								'USW Secure':'/groups/uswsecure/'}
						}; 
		
groupMenus['departments'] = {
							'Administration':'/groups/administration/',
							'ABED Department':'/groups/abed/',
							'District Resource Center':'/groups/drc/',
							'Energy Management':'/groups/sustainability/',
							'Health and Safety':'/groups/healthandsafety/',
							'Human Resources':'/groups/humanresources/',
							'Payroll & Benefits':'/groups/payroll/',
							'Purchasing':'/groups/purchasing/',
							'Rentals':'/groups/rentalsdepartment/',
							'Technology Services':'/groups/techdepartment/',
							'Transportation':'/groups/transportation/'					
														
						}; 
	
function dropdown_menu()
{
	for(i=0;i< dropdowns.length;i++)
	{
		var insertElement = document.getElementById('udm_'+dropdowns[i]);
		if (insertElement)
		{
			var ul, li, href, text, flag = 0, value, id;
			ul = document.createElement("ul");
			//ul.setAttribute('class','udm');
			j = 0;
			for ( key in groupMenus[dropdowns[i]] ) 
			{ 
				value = groupMenus[dropdowns[i]][key];
				li = document.createElement("li");
				href=document.createElement('a');
				if (value.constructor == Object) {
					li.setAttribute('id','udm_'+dropdowns[i]+'_sub'+j);
					href.setAttribute('href','#');
					href.setAttribute('onmouseout','closeMenu(\'udm_'+dropdowns[i]+'_sub'+j+'\')');
					href.setAttribute('onmouseover','openMenu3(\'udm_'+dropdowns[i]+'_sub'+j+'\', this)');
				}
				else
					href.setAttribute('href',groupMenus[dropdowns[i]][key]);
				text=document.createTextNode(key);
				href.appendChild(text);
				li.appendChild(href);
				ul.appendChild(li);
				flag = 1;
				if (value instanceof Object) {
					var subUl, subLi, subHref, subText, subFlag = 0;
					subUl = document.createElement("ul");
					//subUl.setAttribute('class','udm');
					for ( subKey in value ) {
						subLi = document.createElement("li");
						subHref=document.createElement('a');
						subHref.setAttribute('href',value[subKey]);
						subText=document.createTextNode(subKey);
						subHref.appendChild(subText);
						subLi.appendChild(subHref);
						subUl.appendChild(subLi);
						flag = 1;
					}
					li.appendChild(subUl);
				}
				j++;
			}
			if (flag == 1)
			{
				insertElement.appendChild(ul);
			}
		}
	}
	
}
