/*
  ------------------------------------------------------------------------------
   MENU DEFINITIONS for the Gateway Public Site
    g.mcleod 2005.10.24 
      2005.10.24 - Alpha release, subject to client review.  Most items not linked
      2005.11.01 - Minor menu text edits and addition of items
                 - menu entries linked to actual files -- more links to happen
                 - still subject to client acceptance.
      2005.11.25 - Various major and minor edits for appearance over several days.
                 - InfoCenter link disconnected from root as no longer needed.
  ------------------------------------------------------------------------------ 
*/

var thisRoot = "/gateway/";   // hack to make moving site easier -- may be able to improve this by detecting root

var defWidth = 162;
//162;  // default width (width of root menu) to base other widths and offsets on

// STYLES
   // style used for root menu
var myStyle = new ItemStyle(20, 1, '<img src="' + thisRoot + 'images/bullet_transparent.gif">', -7, 3, '30#FFE3AA', '30#FFCC66', 'mylowText', 'myhighText', null, null, null, null, 'hand', 'default');
// style used for sub-menus
var subMenuStyle = new ItemStyle(20, 0, '<img src="' + thisRoot + 'images/bullet_transparent.gif">', -15, 3, '30#FFE3AA', '30#FFCC66', 'sublowText', 'subhighText', null, null, null, null, 'hand', 'default'); 

var subMenuStyle_disabled = new ItemStyle(20, 0, '<img src="' + thisRoot + 'images/bullet_transparent.gif">', -15, 3, '30#FFE3AA', '30#FFCC66', 'sublowText_disabled', 'subhighText_disabled', null, null, null, null, 'hand', 'default'); 


var pMenu = new PopupMenu('pMenu');

function Data() {
with (pMenu) {

// ROOT menu

startMenu('root', true, 'window.page.elmPos("menuarea").x+16', 'window.page.elmPos("menuarea").y+10', defWidth, myStyle, '', false);
addItem('Home&nbsp;&nbsp;&nbsp;&nbsp;', thisRoot + 'index.htm', '', myStyle, 20);
addItem('Program Overview&nbsp;&nbsp;&nbsp;', 'mGateway', 'sm:', myStyle, 20);
addItem('Media&nbsp;&nbsp;&nbsp;', 'mMedia', 'sm:', myStyle, 20);
addItem('Gateway Transit&nbsp;&nbsp;&nbsp;', thisRoot + 'transit/transit.htm', '', myStyle, 20);
addItem('Port Mann / Highway 1&nbsp;&nbsp;&nbsp;', '', '', myStyle, 20); // see event handler below
addItem('South Fraser&nbsp;&nbsp;&nbsp;<br>Perimeter Road&nbsp;&nbsp;&nbsp;', 'mSouthFraser', 'sm:', myStyle, 35);
addItem('Pitt River Bridge and&nbsp;&nbsp;&nbsp;<br>Mary Hill Interchange&nbsp;&nbsp;&nbsp;', 'mPittRiver', 'sm:', myStyle, 35);
addItem('Hwy 7 Rapid Bus Lane&nbsp;&nbsp;&nbsp;', 'mHwy7', 'sm:', myStyle, 20);
addItem('North Fraser&nbsp;&nbsp;&nbsp;<br>Perimeter Road&nbsp;&nbsp;&nbsp;', 'mNorthFraser', 'sm:', myStyle, 35);
addItem('Related Links&nbsp;&nbsp;&nbsp;&nbsp;', thisRoot + 'links.htm', '', myStyle, 20);
addItem('Contact&nbsp;&nbsp;&nbsp;', thisRoot + '8_contact.htm', '', myStyle, 20);


  // Program Overview Sub-Menu
  startMenu('mGateway', true, defWidth, 0, defWidth, subBlank, '', false);
  addItem('Program Description', thisRoot + '1_program.htm', '', subMenuStyle);
  addItem('Why Now?', thisRoot + 'program/why_now.htm', '', subMenuStyle);
  addItem('Community Consultation&nbsp;&nbsp;&nbsp;', thisRoot + '6_communityconsultation.htm', '', subMenuStyle);

/* // Removed 20100615
    //	Gateway -> Property Acquisition Sub-Menu
    startMenu('mPropertyAcquisition', true, defWidth, 0, defWidth, subBlank, '', false);
    addItem('Property Acquisition', thisRoot + 'property_acquisition/property_acquisition.htm', '', subMenuStyle);
    addItem('Property Acquisition FAQs', thisRoot + 'property_acquisition/prop_acq_faq.htm', '', subMenuStyle);
*/

  // Media Sub-Menu
  startMenu('mMedia', true, defWidth, 0, defWidth-35, subBlank, '', false);
  addItem('Gateway Program&nbsp;&nbsp;<br />&nbsp;&nbsp;FAQs&nbsp;&nbsp;&nbsp;&nbsp;', thisRoot + 'info_centre/FAQs.htm', '', subMenuStyle, 35);
  addItem('Project Media&nbsp;&nbsp;<br />&nbsp;&nbsp;Rooms&nbsp;&nbsp;&nbsp;', thisRoot + 'info_centre/media_rooms.htm', '', subMenuStyle, 35);
  addItem('Reports&nbsp;&nbsp;&nbsp;&nbsp;', thisRoot + 'reports.htm', '', subMenuStyle);
  // addItem('Photos', thisRoot + 'info_centre/photogallery.htm', '', subMenuStyle);

	// Port Mann/Hwy1 Sub-Menu
	startMenu('mPortMann', true, defWidth, 0, defWidth+10, subBlank, '', false);
	addItem('Project Description', thisRoot + 'PMH1/PMH1.htm', '', subMenuStyle);
	addItem('Project Schedule', thisRoot + 'PMH1/schedule.htm', '', subMenuStyle);
	addItem('Traffic and Marine Updates', 'mPMH1TrafficMarrine', 'sm:', subMenuStyle);
	addItem('Construction Notifications', thisRoot + 'PMH1/construction_schedule.htm', '', subMenuStyle);
	addItem('Community Consultation', thisRoot + 'PMH1/consultation.htm', '', subMenuStyle);
	addItem('Environmental Assessment', thisRoot + 'PMH1/env_assessment.htm', '', subMenuStyle);
	addItem('Contractor Selection', thisRoot + 'PMH1/contrctr_select.htm', '', subMenuStyle);
	addItem('Information Centre&nbsp;&nbsp;&nbsp;', 'mPMH1InformationCentre', 'sm:', subMenuStyle);
	
		// PMH1 -> Traffic and Marine Sub menu
		startMenu('mPMH1TrafficMarrine', true, defWidth, 0, defWidth, subBlank, '', false);
		addItem('Traffic Updates', thisRoot + 'PMH1/traffic_updates.htm', '', subMenuStyle);
		addItem('Marine Updates', thisRoot + 'PMH1/marine_updates/marine_updates.htm', '', subMenuStyle);

		// PMH1 -> Info Centre Sub Menu
		startMenu('mPMH1InformationCentre', true, defWidth, 0, defWidth, subBlank, '', false);
		addItem('Reports', thisRoot + 'PMH1/reports.htm', '', subMenuStyle);
		addItem('Community Relations', thisRoot + 'PMH1/commnty_rltns.htm', '', subMenuStyle);
		addItem('Photo Gallery', thisRoot + 'PMH1/photo_gallery.htm', '', subMenuStyle);
		addItem('PMH1 Media Room', thisRoot + 'PMH1/media.htm', '', subMenuStyle);
		addItem('PMH1 FAQs', thisRoot + 'PMH1/faqs.htm', '', subMenuStyle);


	// South Fraser  Sub-Menu
	startMenu('mSouthFraser', true, defWidth, 0, defWidth+5, subBlank, '', false);
	addItem('Project Description', thisRoot + 'SFPR/sfpr.htm', '', subMenuStyle);
	addItem('Reference Concept (Maps)', thisRoot + 'SFPR/docs/proposed_alignment/proposed_alignment.html', '', subMenuStyle);
	addItem('Project Schedule', thisRoot + 'SFPR/schedule.htm', '', subMenuStyle);
	addItem('Consultation', 'mConsultation', 'sm:', subMenuStyle);
	addItem('Construction Cameras', '', '', subMenuStyle); 	// see event handler below
	addItem('Traffic Updates and Construction Notifications', thisRoot + 'SFPR/traffic_construction.htm', '', subMenuStyle, 35);
	addItem('Environment', 'mEnvironment', 'sm:', subMenuStyle);
	addItem('Contractor Selection', thisRoot + 'SFPR/contrctr_select.htm', '', subMenuStyle);
	addItem('Information Centre&nbsp;&nbsp;&nbsp;', 'mSFPRInformationCentre', 'sm:', subMenuStyle);
	
		//SFPR -> Consultation sub menu
		startMenu('mConsultation', true, defWidth, 0, defWidth+5, subBlank, '', false);
		addItem('Process', thisRoot + 'SFPR/consultation.htm', '', subMenuStyle);
		addItem('Pre-Design', thisRoot + 'SFPR/predesign.htm', '', subMenuStyle);
		addItem('Traffic Management', thisRoot + 'SFPR/stakeholder_feedback.htm', '', subMenuStyle);
		

		//SFPR -> Environment sub menu
		startMenu('mEnvironment', true, defWidth, 0, defWidth+5, subBlank, '', false);
		addItem('Introduction', thisRoot + 'SFPR/env_commitments.htm', '', subMenuStyle);
		addItem('Environmental Assessment', thisRoot + 'SFPR/env_assessments.htm', '', subMenuStyle);
		addItem('Information Sheets', thisRoot + 'SFPR/docs/ea/sfpr-ceaa_list.htm', '', subMenuStyle);

		
		// SFPR -> Info Centre Sub Menu
		startMenu('mSFPRInformationCentre', true, defWidth, 0, defWidth+5, subBlank, '', false);
		addItem('Reports', thisRoot + 'SFPR/reports.htm', '', subMenuStyle);
		//addItem('Community Relations', thisRoot + 'SFPR/commnty_rltns.htm', '', subMenuStyle);
		addItem('Community Relations', 'mSFPRCommunityRelations', 'sm:', subMenuStyle);
		// addItem('Photo Gallery', thisRoot + 'SFPR/photo_gallery.htm', '', subMenuStyle);
		addItem('SFPR Media Room', thisRoot + 'SFPR/media.htm', '', subMenuStyle);
		addItem('SFPR FAQs', thisRoot + 'SFPR/faqs.htm', '', subMenuStyle);
		
		
			//SFPR -> Community Relations Sub Menu
			startMenu('mSFPRCommunityRelations', true, defWidth, 0, defWidth+5, subBlank, '', false);
			addItem('Community Liason Committee', 'mCommunityLiason', 'sm:', subMenuStyle, 35);
			addItem('Community Updates', thisRoot + 'SFPR/commnty_rltns.htm', '', subMenuStyle);
		
				//SFPR -> Community Liason sub menu
				startMenu('mCommunityLiason', true, defWidth, 0, defWidth+5, subBlank, '', false);
				addItem('Introduction to CLC', thisRoot + 'SFPR/commity_liason_committee.htm', '', subMenuStyle);
				addItem('Terms of Reference', 'window.open(thisRoot + "SFPR/docs/liason_committee/terms_of_reference.pdf")', 'js:', subMenuStyle);
		 		//addItem('Application Form', 'window.open(thisRoot + "SFPR/docs/liason_committee/SFPR-CLC_Application-4.pdf")', 'js:', subMenuStyle);
		


	// Pitt River Sub-Menu
	startMenu('mPittRiver', true, defWidth, 0, defWidth, subBlank, '', false);
	addItem('Project Description', thisRoot + 'prb-maryhill/prb.htm', '', subMenuStyle);
	addItem('Project Schedule', thisRoot + 'prb-maryhill/schedule.htm', '', subMenuStyle);
	addItem('Traffic and Marine Updates', thisRoot + 'prb-maryhill/traffic_marine.htm', '', subMenuStyle);
	addItem('Construction Schedule', thisRoot + 'prb-maryhill/construction_sched.htm', '', subMenuStyle);
	addItem('Pedestrians and Cyclists', thisRoot + 'prb-maryhill/pedestrian_cycling.htm', '', subMenuStyle);
	addItem('Highway Cameras', thisRoot + 'prb-maryhill/highway_cams.htm', '', subMenuStyle);
	addItem('Consultation', thisRoot + 'prb-maryhill/consultation.htm', '', subMenuStyle);
	addItem('Environmental Assessment', thisRoot + 'prb-maryhill/environment_assessmnt.htm', '', subMenuStyle);
	addItem('Contractor Selection', thisRoot + 'prb-maryhill/contractor.htm', '', subMenuStyle);
	addItem('Information Centre&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', 'PR_InfoCentre', 'sm:', subMenuStyle);
	
		// PRB -> Info Centre sub-menu
		startMenu('PR_InfoCentre', true, defWidth, 0, defWidth-25, subBlank, '', false);
		addItem('Reports', thisRoot + 'prb-maryhill/reports.htm', '', subMenuStyle);
		addItem('Community Relations', thisRoot + 'prb-maryhill/commnty_rltns.htm', '', subMenuStyle);
		addItem('Photo Gallery', thisRoot + 'prb-maryhill/photo_gallery.htm','', subMenuStyle);
		addItem('PRB Media Room', thisRoot + 'prb-maryhill/media.htm', '', subMenuStyle);
		addItem('PRB FAQs', thisRoot + 'prb-maryhill/faqs.htm', '', subMenuStyle);
	

// Hwy 7 Rapid Buss
	startMenu('mHwy7', true, defWidth, 0, defWidth, subBlank, '', false);
	addItem('Project Description', thisRoot + 'Hwy7RapidBus/Project_Description.htm', '', subMenuStyle);
	addItem('Project Information', thisRoot + 'Hwy7RapidBus/project_info.htm', '', subMenuStyle);
	addItem('Traffic / Construction', thisRoot + 'Hwy7RapidBus/traffic_construction.htm', '', subMenuStyle);
	addItem('Pedestrian / Cyclists', thisRoot + 'Hwy7RapidBus/pedestrians_cyclists.html', '', subMenuStyle);
		
		// North Fraser Sub-Menu
	startMenu('mNorthFraser', true, defWidth, 0, defWidth, subBlank, '', false);
	addItem('Project Description', thisRoot + 'NFPR/NFPR.htm', '', subMenuStyle);
	addItem('Project Schedule', thisRoot + 'NFPR/project_schedule.htm', '', subMenuStyle);


}

// The following is code to add onclick events to any menu item
pMenu.onclick = function(mN, iN) { 
   with (this) {
       // Do actions depending on the item that the mouse was over at the time of the click.
       // You may wish to use nested IFs or 'switch' statements etc. if you're familiar with JS.
       if (mN == 'root')
       {
         // if (iN == 2) location.href = thisRoot + '1_program.htm';
         if (iN == 5) //location.href = thisRoot + 'PMH1/PMH1.htm';
					window.open('http://www.pmh1project.com/'); // open new site in new window
         if (iN == 6) location.href = thisRoot + 'SFPR/sfpr.htm';
         if (iN == 7) location.href = thisRoot + 'prb-maryhill/prb.htm';
         if (iN == 8) location.href = thisRoot + 'Hwy7RapidBus/Project_Description.htm';
         if (iN == 9) location.href = thisRoot + 'NFPR/NFPR.htm';
         //  if (iN == 8) location.href = nowhere from here;     //ALREADY LINKED in root
         //  if (iN == 9) location.href = thisRoot + '7_infocentre.htm'; // no longer any need for this link / 25.11.2005
        
       }
	   else if (mN == 'mSouthFraser')
	   {
         if (iN == 5) //location.href = thisRoot + 'PMH1/PMH1.htm';
					window.open('http://wcs.pbaeng.com/projects/sfpr'); // open new site in new window
	   }
   }
}
}

