// -------------------------------------------------------------------------------------------------------------------------------------------- //
// Top Menu Navigation Bar
// jaco1@pol.ac.uk
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// Changelog:
// 30.06.08 : First gold release
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// 
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// Proforma for adding menu items:
// Left-side menu item: insert after document.writeln('</li>');
// 
// 1 - document.writeln('<li>');
// 2 - document.writeln('<span class="whitetext" style="text-align:center">|</span>');
// 3 - document.writeln('</li>');
// 4 - document.writeln('<li>');
// 5 - document.writeln('<a href="[DIRECTORY PATH]" onmouseover="mopen([UNIQUE ID])" onmouseout="mclosetime()">');
// 6 - document.writeln('[MENU ITEM TITLE]');
// 7 - document.writeln('</a>');
// 8 - document.writeln('<div id="[UNIQUE ID]" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">');
// 9 - if(window.location.pathname != '[DIRECTORY PATH]' && window.location.pathname != '[DIRECTORY PATH/INDEX PAGE]')  {
// 10- 	document.writeln('<a href="DIRECTORY PATH">');
// 11- } else {
// 12- 	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
// 13- }
// 14- document.writeln('[FIRST DROP DOWN ITEM NAME]');
// 15- if(window.location.pathname != '[FIRST DROP DOWN ITEM LOCATION]') {
// 16- 	document.writeln('</a>');
// 17- } else {
// 18- 	document.writeln('</span>');
// 19- }
// 20- document.writeln('</div>');
// 21- document.writeln('</li>');
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// [DIRECTORY PATH]						= e.g. /modl/
// [UNIQUE ID]								= e.g. m99
// [MENU ITEM TITLE]						= e.g. Modelling
// [DIRECTORY PATH/INDEX PAGE]		= e.g. /modl/index.php
// [FIRST DROP DOWN ITEM NAME]		= e.g. Ocean Shelf model
// [FIRST DROP DOWN ITEM LOCATION]	= e.g. /modl/metfcst/amm.html
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// If linking to a page and not a directory, line 9 should read
// 9 - if(window.location.pathname !='[DIRECTORY PATH/INDEX PAGE]')  {
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// Likewise if linking a drop-down item to a directory and not a page, line 15 should read
// 15 - if(window.location.pathname != '[FIRST DROP DOWN ITEM DIRECTORY]' && window.location.pathname != '[FIRST DROP DOWN ITEM LOCATION]') {
// -------------------------------------------------------------------------------------------------------------------------------------------- //
// For further drop-down items, repeat lines 9 - 19 inclusive as required
// -------------------------------------------------------------------------------------------------------------------------------------------- // 


var timeout	= 250;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}

// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// set close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 

document.writeln('<table width="770" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#007cc3"><tr><td width="450" bgcolor="#007cc3">');

document.writeln('<ul id="sddm">');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">&nbsp;</span>');
document.writeln('</li>');

document.writeln('<li>');

if(window.location.pathname != '/' && window.location.pathname != '/index.php') {
	document.writeln('<a href="/">');
} else {
	document.writeln('<span class="greytext">');
}
document.writeln('Home');
if(window.location.pathname != '') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/cobsadmin/" onmouseover="mopen(\'m22\')" onmouseout="mclosetime()">');
document.writeln('About us');
document.writeln('</a>');

document.writeln('<div id="m22" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">');

if(window.location.pathname != '/cobsadmin/about.html') {
	document.writeln('<a href="/cobsadmin/about.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Project summary');
if(window.location.pathname != '/cobsadmin/about.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobsadmin/future.html') {
	document.writeln('<a href="/cobsadmin/future.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Future plans');
if(window.location.pathname != '/cobsadmin/future.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}


if(window.location.pathname != '/cobsadmin/participants.html') {
	document.writeln('<a href="/cobsadmin/participants.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Participants');
if(window.location.pathname != '/cobsadmin/participants.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}


if(window.location.pathname != '/cobsadmin/cruise_plan.php') {
	document.writeln('<a href="/cobsadmin/cruise_plan.php">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Survey dates');
if(window.location.pathname != '/cobsadmin/cruise_plan.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}


if(window.location.pathname != '/cobsadmin/outputs.html') {
	document.writeln('<a href="/cobsadmin/outputs.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Outputs');
if(window.location.pathname != '/cobsadmin/outputs.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}



if(window.location.pathname != '/cobsadmin/service_level.html') {
	document.writeln('<a href="/cobsadmin/service_level.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Service level');
if(window.location.pathname != '/cobsadmin/service_level.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/register/' && window.location.pathname != '/register/index.php') {
	document.writeln('<a href="/register/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Register for data');
if(window.location.pathname != '/register/' && window.location.pathname != '/register/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobsadmin/use.html') {
	document.writeln('<a href="/cobsadmin/use.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Conditions of use');
if(window.location.pathname != '/cobsadmin/use.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobsadmin/disclaimer.html') {
	document.writeln('<a href="/cobsadmin/disclaimer.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Disclaimer');
if(window.location.pathname != '/cobsadmin/disclaimer.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}


if(window.location.pathname != '/cobsadmin/steering.html') {
	document.writeln('<a href="/cobsadmin/steering.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Steering Group');
if(window.location.pathname != '/cobsadmin/steering.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobsadmin/steering_docs.html') {
	document.writeln('<a href="/cobsadmin/steering_docs.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('SG Documentation');
if(window.location.pathname != '/cobsadmin/steering_docs.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}





if(window.location.pathname != '/workshops/' && window.location.pathname != '/workshops/index.php') {
	document.writeln('<a href="/workshops/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('+Coastal Observatory workshops');
if(window.location.pathname != '/workshops/' && window.location.pathname != '/workshops/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/CSSWG/' && window.location.pathname != '/cobs/CSSWG/index.html') {
	document.writeln('<a href="/cobs/CSSWG/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('+GODAE coastal workshop');
if(window.location.pathname != '/cobs/CSSWG/' && window.location.pathname != '/cobs/CSSWG/index.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

document.writeln('</div>');

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/cobs/" onmouseover="mopen(\'m33\')" onmouseout="mclosetime()">');
document.writeln('Monitoring');
document.writeln('</a>');

document.writeln('<div id="m33" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">');

if(window.location.pathname != '/cobs/ctide/' && window.location.pathname != '/cobs/ctide/index.php') {
	document.writeln('<a href="/cobs/ctide/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Coastal tide gauges');
if(window.location.pathname != '/cobs/ctide/' && window.location.pathname != '/cobs/ctide/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/ferries/' && window.location.pathname != '/cobs/ferries/index.php') {
	document.writeln('<a href="/cobs/ferries/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Ferry measurements');
if(window.location.pathname != '/cobs/ferries/' && window.location.pathname != '/cobs/ferries/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/fixed/' && window.location.pathname != '/cobs/fixed/index.php') {
	document.writeln('<a href="/cobs/fixed/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Fixed locations');	// changed from 'moorings' to 'locations'
if(window.location.pathname != '/cobs/fixed/' && window.location.pathname != '/cobs/fixed/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

// -----------------------------------------------
if(window.location.pathname != '/cobs/gliders/' && window.location.pathname != '/cobs/gliders/index.php') {
	document.writeln('<a href="/cobs/gliders/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Glider operations');
if(window.location.pathname != '/cobs/gliders/' && window.location.pathname != '/cobs/gliders/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}
// -----------------------------------------------

if(window.location.pathname != '/cobs/met/' && window.location.pathname != '/cobs/met/index.php') {
	document.writeln('<a href="/cobs/met/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Met stations');
if(window.location.pathname != '/cobs/met/' && window.location.pathname != '/cobs/met/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/radar/' && window.location.pathname != '/cobs/radar/index.php') {
	document.writeln('<a href="/cobs/radar/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Radar');
if(window.location.pathname != '/cobs/radar/' && window.location.pathname != '/cobs/radar/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/rivers/' && window.location.pathname != '/cobs/rivers/index.php') {
	document.writeln('<a href="/cobs/rivers/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Rivers');
if(window.location.pathname != '/cobs/rivers/' && window.location.pathname != '/cobs/rivers/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/sat/' && window.location.pathname != '/cobs/sat/index.php') {
	document.writeln('<a href="/cobs/sat/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Satellite');
if(window.location.pathname != '/cobs/sat/' && window.location.pathname != '/cobs/sat/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/cobs/webcam/' && window.location.pathname != '/cobs/webcam/index.php') {
	document.writeln('<a href="/cobs/webcam/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Webcams');
if(window.location.pathname != '/cobs/webcam/' && window.location.pathname != '/cobs/webcam/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

document.writeln('</div>');

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/modl/" onmouseover="mopen(\'m44\')" onmouseout="mclosetime()">');
document.writeln('Modelling');
document.writeln('</a>');

document.writeln('<div id="m44" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">');

//------
// Added by Clare O'Neill 2/6/09
if(window.location.pathname != '/modl/polcoms/') {
	document.writeln('<a href="/modl/polcoms">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('POLCOMS models');
if(window.location.pathname != '/modl/polcoms/') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}
//------

if(window.location.pathname != '/modl/metfcst/wave.html') {
	document.writeln('<a href="/modl/metfcst/wave.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Wave model');
if(window.location.pathname != '/modl/metfcst/wave.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/modl/metfcst/meso.html') {
	document.writeln('<a href="/modl/metfcst/meso.html">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('NAE model');
if(window.location.pathname != '/modl/metfcst/meso.html') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}
//------
// Added by Clare O'Neill 28/04/10
if(window.location.pathname != '/modl/validation/') {
	document.writeln('<a href="/modl/validation">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Model validation');
if(window.location.pathname != '/modl/validation/') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}//------



document.writeln('</div>');

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/gmapper">');
document.writeln('MapViewer');
document.writeln('</a>');

document.writeln('</li>');

document.writeln('</ul>');

document.writeln('</td>');

document.writeln('<div style="clear:both"></div>');

document.writeln('<td bgcolor="#007cc3" width="270">');

document.writeln('<ul id="sddm" style="float:right">');

document.writeln('<li style="width:85px">');

document.writeln('<a href="/fastlinks/" onmouseover="mopen(\'m55\')" onmouseout="mclosetime()">');
document.writeln('Popular links');
document.writeln('</a>');

document.writeln('<div id="m55" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">');

if(window.location.pathname != '/cobs/met/hilbre/' && window.location.pathname != '/cobs/met/hilbre/index.php') {
	document.writeln('<a href="/cobs/met/hilbre/">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Hilbre weather station');
if(window.location.pathname != '/cobs/met/hilbre/' && window.location.pathname != '/cobs/met/hilbre/index.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

if(window.location.pathname != '/modl/metfcst/surpress/latest.php') {
	document.writeln('<a href="/modl/metfcst/surpress/latest.php">');
} else {
	document.writeln('<span class="vdkgreytext" style="padding:1px 8px;">');
}
document.writeln('Irish Sea forecast');
if(window.location.pathname != '/modl/metfcst/surpress/latest.php') {
	document.writeln('</a>');
} else {
	document.writeln('</span>');
}

document.writeln('<a href="http://www.pol.ac.uk/ntslf/tides/?port=0051">');
document.writeln('Hilbre tidal predictions');
document.writeln('</a>');

document.writeln('</div>');

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/status/">');
document.writeln('Status');
document.writeln('</a>');

document.writeln('</li>');

document.writeln('<li>');
document.writeln('<span class="whitetext" style="text-align:center">|</span>');
document.writeln('</li>');

document.writeln('<li>');

document.writeln('<a href="/guide/contact.html">');
document.writeln('Contact us &nbsp;');
document.writeln('</a>');

document.writeln('</li>');

// document.writeln('<li>');
// document.writeln('<span class="whitetext" style="text-align:center">&nbsp;</span>');
// document.writeln('</li>');

document.writeln('</ul>');

document.writeln('<div style="clear:both"></div>');

document.writeln('</td></tr></table>');

