/*This script is designed to work with IE and Mozilla browsers like Konqueror. It won't work in Netscape.The cascading style sheet that goes with it is optomised for Windows and Internet Explorer.Other platforms will have dire issues that must be addressed (Konqueror not least).*/numMenus = 16; // The number of menus in the entire menu system.numSubMenus = 7; // The number of third menus in the entire menu system.numArrows = 7; // The number of arrow images in the entire menu system.visible = 'visible'; // sets the visibility property to visible.hidden = 'hidden'; // sets the visibility property to invisible.function byNumber(a,b) // col = index of 2nd dimension to sort by, must be predefined/*This simple function is used to compare two numbers with the array.sort method.*/{	if (Number(a[col])>Number(b[col]))	{		return 1	}	else if (Number(b[col])>Number(a[col]))	{		return -1	}	else	{		return 0	}}function byNumberRev(a,b) // col = index of 2nd dimension to sort by, must be predefined/*This simple function is used to compare two numbers with the array.sort method.*/{	if (Number(a[col])<Number(b[col]))	{		return 1	}	else if (Number(b[col])<Number(a[col]))	{		return -1	}	else	{		return 0	}}function byString(a,b) // col = index of 2nd dimension to sort by, must be predefined/*This simple function is used to compare two strings with the array.sort method.*/{	if (a[col]>b[col])	{		return 1	}	else if (b[col]>a[col])	{		return -1	}	else	{		return 0	}}function clicked()/*This simple function tests to see if the menu-system is in "clicked" mode or not.Any return value greater than 1 indicates this.*/{	val = 0;	for (count=2; count<(numMenus+1-numSubMenus); count++) // loop through each "second menu"	{		menuID = getNode('menu'+count);		if (menuID.style.visibility == visible) // if the current menu is visible, then the menu is in clicked mode.		{			val = count;		}	}	return val; //return the status of the menu.}function getNode( id ){	if( document.all ) // IE4	{		theNode = eval( id );	}	else // Modern Browsers	{		theNode = document.getElementById( id );	}	return theNode;}function mainMenu(m1title,m2,m2id,cm2,cm2id,onmout) //Handler for the effects of the main menu bar./*m1title = The id of the entry to be modified due to a click or mouseover. If none, then leave as '0'.m2 = The number of entries in the second menu (a 1st drop down menu) to be displayed in the case the menu-system is in "unclicked" mode. If none, then leave as '0'.m2id = The id number of the second menu to be displayed in the case the menu-system is in "unclicked" mode. If none, then leave as '0'.cm2 = The number of entries in the second menu to be displayed in the case that the menu-system is in "clicked" mode. If none, then leave as '0'.cm2id = The id number of the second menu to be displayed in the case that the menu-system is in "clicked" mode. If none, then leave as '0'.onmout = Set to 1 if in unclicked mode, set to 0 otherwise.*/{	for (count=1; count<(numMenus-numSubMenus+1); count++) // reset all cells on main menu.	{		title = getNode('m1t'+count);		title.style.border = '1px solid #EDEDED';	}	if (m2>0) // if the menu is being clicked, then process.	{		for (count=2; count<(numMenus+1); count++) // resets all menus back to hidden status.		{			menuID = getNode('menu'+count);			menuID.style.visibility = hidden;			menuID.style.zIndex = -1;		}		if (m2id>0) // if a menu is designated, then set it to visible.		{			menuID = getNode('menu'+m2id);			menuID.style.visibility = visible;			menuID.style.zIndex = 1;			for (count=1; count<(m2+1); count++) // reset all cells on the second menu.			{				title = getNode('m'+m2id+'t'+count);				title.style.backgroundColor = '#EDEDED';				title.style.color='#34485A';			}			for (count=1; count<(numArrows+1); count++) // reset all arrows on the menus.			{				image = getNode('img'+count);				image.src = 'picture/blackarrow.gif';			}		}		if (curMenu>1) // if a menu was already open, then it must now be closed, so give the current title a raised border.		{			closeMenu()			menuID = getNode('menu' + m1title);			menuID.style.border = '1px outset #FFFFFF';		}	}	curMenu = clicked(); // see the clicked() function.	if (m1title>0) // If an entry is to be modified.	{		title = getNode('m1t'+m1title);		if (curMenu>1) // if a menu is already open.		{			if (m1title==1) // if the "main" title is selected.			{				for (count=2; count<(numMenus+1); count++) // close all second and third menus.				{					menuID = getNode('menu'+count);					menuID.style.visibility = hidden;					menuID.style.zIndex = -1;				}				title.style.border = '1px outset #FFFFFF'; // show a "raised button" look on "main".			}			else // Any other title has been selected, so show a "pressed button" look on it.			{				title.style.border = '1px inset #FFFFFF';			}			if (cm2>0) // if there is an option for "clicked" mode.			{				for (count=2; count<(numMenus+1); count++) // close all second and third menus.				{					menuID = getNode('menu'+count);					menuID.style.visibility = hidden;					menuID.style.zIndex = -1;				}				if (cm2id>0) // if a new menu is to be opened, then do it.				{					menuID = getNode('menu'+cm2id);					menuID.style.visibility = visible;					menuID.style.zIndex = 1;					for (count=1; count<(cm2+1); count++) // clean up the newly opened menu.					{						title = getNode('m'+cm2id+'t'+count);						title.style.backgroundColor = '#EDEDED';						title.style.color='#34485A';					}					for (count=1; count<(numArrows+1); count++) // make sure all the arrows are in "unhighlighted" mode.					{						image = getNode('img'+count);						image.src = 'picture/blackarrow.gif';					}				}			}		}		else if (onmout==0) // else show a "raised button" effect on the current title.		{			title.style.border = '1px outset #FFFFFF';		}	}}function menu(m1,m1title,m1state, m2,m2id,m2title,m2arrow, m3,m3id,m3title) // Handler for the effects of the submenus./*m1 = The number of entries in the first menu. If the first menu is not to be modified, then leave as '0'.m1title = The id of the entry to be modified due to a click or mouseover. If none, then leave as '0'.m1state = 'outset' or 'inset' depending on which modification you require for the m1title entry. If m1title is '0', then leave this as '0' as well.m2 = The number of entries in the second menu (a 1st drop down menu) to be displayed. If none, then leave as '0'.m2id = The id number of the second menu to be displayed. If none, then leave as '0'.m2title = The entry to be put in highlighted state. If none, leave as '0'.m2arrow = The arrow image to be put in highlighted state. If none, leave as '0'.m3 = The number of entries in the third menu (a 2nd drop down menu) to be displayed. If none, then leave as '0'.m3id = The id number of the third menu to be displayed. If none, then leave as '0'.m3title = The entry to be put in highlighted state. If none, leave as '0'.*/{	if (m1>0) // if the main menu needs to be modified.	{		for (count=1; count<(m1+1); count++) // reset all cells on main menu.		{			title = getNode('m1t'+count);			title.style.border = '1px solid #EDEDED';		}		if (m1title>'0') // if a title is designated, set it to the designated state (raised or pressed).		{			title = getNode('m1t'+m1title);			title.style.border = '1px '+m1state+' #FFFFFF';		}	}	if (m2>0) // if a second menu must be modified.	{		for (count=2; count<(numMenus+1); count++) // close all second and third menus.		{			menuID = getNode('menu'+count);			menuID.style.visibility = hidden;			menuID.style.zIndex = -1;		}		if (m2id>0) // if a second menu must be visible, then make it so.		{			menuID = getNode('menu'+m2id);			menuID.style.visibility = visible;			menuID.style.zIndex = 1;		}		for (count=1; count<(m2+1); count++) // reset all cells on the second menu.		{			title = getNode('m'+m2id+'t'+count);			title.style.backgroundColor = '#EDEDED';			title.style.color='#34485A';		}		for (count=1; count<(numArrows+1); count++) // reset all arrows on the menus.		{			image = getNode('img'+count);			image.src = 'picture/blackarrow.gif';		}		if (m2title>0) // if a title must be highlighted on the second menu, make it so.		{			title = getNode('m'+m2id+'t'+m2title);			title.style.backgroundColor = '#004080';			title.style.color='#FFFFFF';		}		if (m2arrow>0) // if an arrow must be highlighted on the second menu, make it so.		{			pic = getNode('img'+m2arrow);			pic.src = 'picture/whitearrow.gif';		}	}	if (m3>0) // if a third menu must be modified.	{		if (m3id>0) // if a third menu is designated, then just make it visible. All the other work must have already been done.		{			menuID = getNode('menu'+m3id);			menuID.style.visibility = visible;			menuID.style.zIndex = 1;		}		for (count=1; count<(m3+1); count++) // reset the cells on the third menu.		{			title = getNode('m'+m3id+'t'+count);			title.style.backgroundColor = '#EDEDED';			title.style.color='#34485A';		}		if (m3title>0) // if a title must be highlighted on the third menu, make it so.		{			title = getNode('m'+m3id+'t'+m3title);			title.style.backgroundColor = '#004080';			title.style.color='#FFFFFF';		}	}}function closeMenu() // Simple function to close down the entire menu.{	for (count=2; count<(numMenus+1); count++) // close all second and third menus.	{		menuID = getNode('menu'+count);		menuID.style.visibility = hidden;		menuID.style.zIndex = -1;	}	for (count=1; count<(numMenus-numSubMenus+1); count++) // reset all cells on main menu.	{		title = getNode('m1t'+count);		title.style.border = '1px solid #EDEDED';	}}function render(cell) // Simple function to render a moused over link box{	cell.style.backgroundColor='#9999FF';	cell.style.cursor='hand';}function derender(cell) // Simple function to derender a moused over link box{	cell.style.backgroundColor='#C6D8F7';}function render_list(cell) // Simple function to render a moused over link box{	cell.style.backgroundColor='#339933';	cell.style.cursor='hand';}function derender_list(cell) // Simple function to derender a moused over link box{	cell.style.backgroundColor='#18BE42';}function render_x(cell) // Simple function to render a moused over X on map popup{	cell.style.backgroundColor='#666666';	cell.style.color='#FFFFFF';	cell.style.cursor='hand';}function derender_x(cell) // Simple function to derender a moused over X on map popup{	cell.style.backgroundColor='#C0C0C0';	cell.style.color='#000000';}