// MAIN NAVIGATION BAR

//Contains individual dynamic menu constructors and arrays. Also
//call init() function that initialises the bottom mouseover button back, top and email webmaster


// window.onload = function() {
//            initializeMenu("homeMenu", "homeActuator");
//            initializeMenu("researchMenu", "researchActuator");
//            initializeMenu("ntslfMenu", "ntslfActuator");
//            initializeMenu("appsMenu", "appsActuator");
//            initializeMenu("psmslMenu", "psmslActuator");
//			initializeMenu("techMenu", "techActuator");
//			initializeMenu("cobsMenu", "cobsActuator");
//			init();
//			
//        }

function nvbr(Lnks) {
  var currentLnks;
 
  for (var i = 0; i < Lnks.length; i++) {

    {
	  document.writeln('<li class="menubar">');
      document.writeln('<a href="'+Lnks[i][0]+'"  id="'+Lnks[i][4]+'" class="actuator" title="'+Lnks[i][3]+'">'+Lnks[i][2]+'</a>');
	  document.writeln('<ul id="'+Lnks[i][6]+'" class="menu">');
	  document.writeln('<li>');
	 
	  
	  currentLnks = Lnks[i][5];
	 
	  
//	  switch (currentLnks)
//	   {
//		case 1:
//		dropnvbr(homeLnks);
//		break;
//		
//		case 2:
//		dropnvbr(resLnks);
//		break;
//		
//		case 3:
//		dropnvbr(ntslfLnks);
//		break;
//		
//		case 4:
//		dropnvbr(appLnks);
//		break;
//		
//		case 5:
//		dropnvbr(psmslLnks);
//		break;
//		
//		case 6:
//		dropnvbr(techLnks);
//		break;
//		
//		case 7:
//		dropnvbr(cobsLnks);
//		break;
//		
//		default:
//		dropnvbr(homeLnks);
//		break;
//	   }
	

	  document.writeln('</li>');
	  document.writeln('</ul>');
	  document.writeln('</li>');
    }
    if (Lnks[i][7] == 1) document.writeln('&nbsp;');
    if (Lnks[i][8] == 2) document.writeln(' |');
  }
}

function dropnvbr(Lnksarray) {
  var isCurrent = false;
  //var Lnksarray;
  for (var i = 0; i < Lnksarray.length; i++) {
    isCurrent = (Lnksarray[i][1] == null) ? (location.pathname == Lnksarray[i][0]) : (location.pathname == Lnksarray[i][0] || location.pathname == Lnksarray[i][1]);
    if (Lnksarray[i][4] == 1) document.write('&nbsp;');
//  if (isCurrent) {
    if ((isCurrent) || (Lnksarray[i][0] == null)) {
      document.write('<span class="redtext">'+Lnksarray[i][2]+'</span>');
    }
    else
	{
      document.write('<li><a href="'+Lnksarray[i][0]+'"  title="'+Lnksarray[i][2]+'" onmouseover="window.status=\''+Lnksarray[i][3]);
      document.write('\'; return true" onMouseOut="window.status=\'\'; return true">'+Lnksarray[i][2]+'</a></li>');
    }
}
}




var Lnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
Lnks = [['/','/','Home','Home Page','homeActuator',1,'homeMenu',0,0],
		['/home/research/','Research','Research','Research','researchActuator',2,'researchMenu',0,0],
		['/ntslf/','NTSLF','NTSLF','National Tidal and Sea Level Facility','ntslfActuator',3,'ntslfMenu',0,0],
		['/appl/','Products & Services','Products & Services','Our Products & Services','appsActuator',4,'appsMenu',0,0],
		['/psmsl.html','PSMSL','PSMSL','Permanent Service for Mean Sea Level','psmslActuator',5,'psmslMenu',0,0],
        ['/home/oetg/','Technology','Technology','Technology','techActuator',6,'techMenu',0,0],
		['http://cobs.pol.ac.uk/','http://cobs.pol.ac.uk/','Coastal Observatory','Coastal Observatory','cobsActuator',7,'cobsMenu',0,0]];

var homeLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
homeLnks = [['/','/','POL Home','POL home page'],
        ['/home/about.html','/home/about.html','About Us','About POL'],
		['/home/news/','/home/news/','News &amp; Events','POL news and events'],
		['/home/staff/','/home/staff/index.html','The POL Team','Staff at POL'],
		['/home/history/','/home/history/index.html','History','History of POL'],
		['/home/studentships/','/home/studentships/index.html','Graduate Studies','PhD research topics available at POL'],
		['/home/seminars/index.html','/home/seminars/index.html','Seminars','Seminars at POL'],
		['/home/schools/','/home/schools/index.html','Education &amp; Schools','Information for schools'],
		['/home/q_and_a/','/home/q_and_a/index.html','Questions &amp; Answers','Questions and Answers'],
		['/home/insight/local.html','/home/insight/local.html','Insight into Marine Science','Insight into Marine Science'],
		['/home/scienceInsociety.html','/home/scienceInsociety.html','Science in Society','Science in society'],
		['/home/library/','/home/library/','POL Library','Library at POL'],
		['/home/vacancies/','/home/vacancies/index.html','Vacancies','Current vacancies at POL'],
		['/home/location.html','/home/location.html','Find Us','How to get to the Proudman Oceanographic Laboratory'],
        ['/home/contact.htm','/home/contact.htm','Contact Us','Contact us at POL']];


var resLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------


resLnks = [['/home/research/','/home/research/','Research Home','Research homepage home page',0,],
		['/home/research/project_list.html','/home/research/project_list.html','Project List','All POL projects listed'],
		['/home/research/prog1/index.html','/home/research/prog1/index.html','Programme 1','Research programme 1'],
	    ['/home/research/prog1/theme1.html','/home/research/prog1/theme1.html','Theme 1','Programme 1, theme 1'],
		['/home/research/prog1/theme2.html','/home/research/prog1/theme2.html','Theme 2','Programme 1, theme 2'],
		['/home/research/prog1/theme3.html','/home/research/prog1/theme3.html','Theme 3','Programme 1, theme 3'],
		['/home/research/prog2/index.html','/home/research/prog2/index.html','Programme 2','Research programme 2'],		
		['/home/research/prog2/theme4/index.html','/home/research/prog2/theme4/index.html','Theme 4','Programme 2, theme 4'],
		['/home/research/prog2/theme5.html','/home/research/prog2/theme5.html','Theme 5','Programme 2, theme 5'],
		['/home/research/prog3/index.html','/home/research/prog3/index.html','Programme 3','Research programme 3'],
	    ['/home/research/prog3/theme6.html','/home/research/prog3/theme6.html','Theme 6','Programme 3, theme 6'],
		['/home/research/prog3/theme7.html','/home/research/prog3/theme7.html','Theme 7','Programme 3, theme 7'],
		['/home/research/archive/index.html','/home/research/archive/index.html','Research Archive','Previous POL projects '],
        ['/home/research/publist.php?name=.&init=.','/home/research/publist.php?name=.&init=.','Publications List','Publications List',0,]];
	

var ntslfLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
ntslfLnks = [['/ntslf/','/ntslf/','NTSLF Home','NTSLF home page'],
        ['/ntslf/about.html','/ntslf/about.html','About Us','About the NTSLF'],
		['/ntslf/networks.html','/ntslf/networks.html','Sea Level Networks','Sea Level Networks'],
		['/ntslf/data.html','/ntslf/data.html','Data Availability','Data available from NTSLF'],
		['/ntslf/tidalp.html','/ntslf/tidalp.html','Tidal Predictions','Tidal predictions for around the UK'],
		['/ntslf/products.php','/ntslf/products.php','Products','NTSLF products'],
		['/ntslf/model.html','/ntslf/model.html','Numerical Modelling','Numerical modelling from the NTSLF'],
		['/ntslf/software.html','/ntslf/software.html','Software','Software available from the NTSLF'],
		['/ntslf/sharing_knowledge.php','/ntslf/sharing_knowledge.php','Sharing Knowledge','Sharing knowledge with the NTSLF'],
        ['/ntslf/reports.html','/ntslf/reports.html','Reports','Reports of the NTSLF']];

var appLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
appLnks = [['/appl/','/appl/','Applications Home','Applications Team home page'],
        ['/appl/tidepred.html','/appl/tidepred.html','Tidal Predictions','Tidal predictions'],
		['/appl/software.html','/appl/software.html','Application Software','Application software'],
		['/appl/supply.html','/appl/supply.html','Model Outputs','Model outputs'],
		['/appl/consult.html','/appl/consult.html','Consultancy Service','Application team consultancy service'],
        ['/appl/met.html','/appl/met.html','Local Met Data','Local Met data']];

var psmslLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
psmslLnks = [['/psmsl/','/psmsl/','PSMSL Home','Permanent Service for Mean Sea Levels home page'],
		['/psmsl/whatispsmsl.html','/psmsl/whatispsmsl.html','About Us','About the PSMSL'],
		['/psmsl/datainfo/index.html','/psmsl/datainfo/index.html','Obtaining & Supplying Data','Obtaining sea level data'],
	    ['/psmsl/highfreq.html','/psmsl/highfreq.html','Obtaining Higher Frequency Data','Obtaining high frequency dea level data'],
		['/psmsl/programmes/index.html','/psmsl/programmes/index.html','Networks','Sea level networks'],
		['/psmsl/sea_level_contacts.html','/psmsl/sea_level_contacts.html','Sea Level Contacts','Sea level contacts'],
		['/psmsl/landmove.html','/psmsl/landmove.html','Vertical Land Movements','Vertical Land Movements'],
		['/psmsl/training/index.html','/psmsl/training/index.html','Sea Level Training','Sea level training advice and information'],
        ['/psmsl/author_archive/index.html','/psmsl/author_archive/index.html','Author Archive','PSMSL author archive'],
        ['/psmsl/puscience/index.html','/psmsl/puscience/index.html','FAQs','Frequently asked questions']];

var cobsLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
cobsLnks = [['http://cobs.pol.ac.uk/','http://cobs.pol.ac.uk/','Coastal Observatory Home','Coastal Observatory home page'],
        ['http://cobs.pol.ac.uk/cobsadmin/','http://cobs.pol.ac.uk/cobsadmin/','Administration','Administration of the Coastal Observatory'],
		['http://cobs.pol.ac.uk/cobs/','http://cobs.pol.ac.uk/cobs/','Monitoring','Monitoring'],
		['http://cobs.pol.ac.uk/modl/','http://cobs.pol.ac.uk/modl/','Modelling','Modelling'],
        ['http://cobs.pol.ac.uk/gmapper/','http://cobs.pol.ac.uk/gmapper/','Map Viewer','Map Viewer']];

var techLnks = new Array();

// Change contents of arrays of Lnks 
// 0, 1 - links; 2 - title; 3 - status; 4, 5: code (0)=nothing, (1)='&nbsp;', (2)='|' 
// ----------------------------------------------------------------------------------
techLnks = [['/home/oetg/','/home/oetg/index.html','Technology Home','Ocean Engineering Technology Group homepage'],
        ['/home/oetg/history.html','/home/oetg/history.html','History','Ocean Engineering Technology Group History'],
		['/home/oetg/facilities.html','/home/oetg/facilities.html','Facilities','Facilities of the Ocean Engineering Technology Group'],
		//['/home/oetg/cobs.html','/home/oetg/cobs.html','Coastal Observatory','OETG subgroup Coastal Observatory'],
		//['/home/oetg/deep_ocean.html','/home/oetg/deep_ocean.html','Deep Ocean','OETG subgroup Deep Ocean'],
        ['/home/oetg/mechanical.html','/home/oetg/mechanical.html','Mechanical','OETG subgroup Mechanical']];



document.writeln('<div id="mainMenu">');
document.writeln('<ul id="menuList">');

nvbr(Lnks);

document.writeln('</ul>');
document.writeln('</div>');

