/*
		*****************************************************************
		Functions for the menu
		showHideLayer: opens and closes levels
		***************************************************************** */	

		arrOpenNodes = new Array()
		
		function Over(element)
		{
			if (document.getElementById)
			{
				document.getElementById(element).style.backgroundColor="#e5edef";
			}
			else if( document.all )
			{
				document.all["sub" + section].style.backgroundColor="#e5edef";
			}
		}
		
		function Out(element)
		{
			if (document.getElementById)
			{
				if(!element.indexOf("parent") == 0)
					document.getElementById(element).style.backgroundColor="#ffffff";
				else
				{
					found = false;
					secId = element.substring(6);
					for( i=0; i<arrOpenNodes.length; i++ )
					{
						if( arrOpenNodes[ i ] && arrOpenNodes[ i ] == secId )
							found = true;
					}
					if (!found)
						document.getElementById(element).style.backgroundColor="#ffffff";
				}
				
			}
			else if( document.all )
			{
				if(!element.indexOf("parent") == 0)
					document.all["sub" + section].style.backgroundColor="#ffffff";
				else
				{
					found = false;
					secId = element.substring(6);
					for( i=0; i<arrOpenNodes.length; i++ )
					{
						if( arrOpenNodes[ i ] && arrOpenNodes[ i ] == secId )
							found = true;
					}
					if (!found)
						document.all["sub" + section].style.backgroundColor="#ffffff";
				}
			}
		}
		
		function Highlight(section)
		{
			if (document.getElementById)
			{
				if (document.getElementById("parent" + section))
					document.getElementById("parent" + section).style.backgroundColor="#e5edef";
			}
			else if( document.all )
			{
				if (document.all["parent" + section])
					document.all["parent" + section].style.backgroundColor="#e5edef";
			}
		}
		
		function showHideLayer(section, parentLevel)
		{
			if (document.getElementById)
			{
				if( document.getElementById("sub" + section) )
				{
					if(document.getElementById("sub" + section).className == 'Closed'){
						for( i=parentLevel; i<arrOpenNodes.length; i++ )
						{
							if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
							{
								document.getElementById("sub" + arrOpenNodes[ i ]).className = 'Closed'
								if (document.getElementById("parent" + arrOpenNodes[ i ]))
								{
									document.getElementById("parent" + arrOpenNodes[ i ]).style.backgroundColor="#ffffff";
								}
								if (document.getElementById("img" + arrOpenNodes[ i ]))
									document.getElementById("img" + arrOpenNodes[ i ]).src = closedImg;
							}
						}
						document.getElementById("sub" + section).className = 'Open'
						if (document.getElementById("img" + section))
							document.getElementById("img" + section).src = openImg;
						arrOpenNodes[ parentLevel ] = section;
					}
					else
					{
						document.getElementById("sub" + section).className = 'Closed'
						if (document.getElementById("img" + section))
							document.getElementById("img" + section).src = closedImg;
						for( i=parentLevel; i<arrOpenNodes.length; i++ )
						{
							if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
							{
								document.getElementById("sub" + arrOpenNodes[ i ]).className = 'Closed'
								if (document.getElementById("img" + arrOpenNodes[ i ]))
									document.getElementById("img" + arrOpenNodes[ i ]).src = closedImg;
							}
						}
						arrOpenNodes[ parentLevel ] = null;
					}	
				}
				else
				{
					for( i=parentLevel; i<arrOpenNodes.length; i++ )
						if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
						{
							document.getElementById("sub" + arrOpenNodes[ i ]).className = 'Closed'
							if (document.getElementById("img" + arrOpenNodes[ i ]))
								document.getElementById("img" + arrOpenNodes[ i ]).src = closedImg;	
						}
				}
			}
			else if( document.all )
			{
				if( document.all["sub" + section] )
				{
					if(document.all["sub" + section].className == 'Closed'){
						for( i=parentLevel; i<arrOpenNodes.length; i++ )
						{
							if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
							{
								document.all["sub" + arrOpenNodes[ i ]].className = 'Closed'
								if (document.all["parent" + arrOpenNodes[ i ]])
									document.all["parent" + arrOpenNodes[ i ]].style.backgroundColor="#ffffff";
								if (document.all["img" + arrOpenNodes[ i ]])
									document.all["img" + arrOpenNodes[ i ]].src = closedImg;
							}
						}
					
						document.all["sub" + section].className = 'Open'
						if (document.all["img" + section])
							document.all["img" + section].src = openImg;
						arrOpenNodes[ parentLevel ] = section;
					}
					else
					{
						document.all["sub" + section].className = 'Closed'
						if (document.all["img" + section])
							document.all["img" + section].src = closedImg;
						for( i=parentLevel; i<arrOpenNodes.length; i++ )
						{
							if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
							{
								document.all["sub" + arrOpenNodes[ i ]].className = 'Closed'
								if (document.all["img" + arrOpenNodes[ i ]])
									document.all["img" + arrOpenNodes[ i ]].src = closedImg;
							}
						}
						arrOpenNodes[ parentLevel ] = null;
					}
				}
				else
				{
					for( i=parentLevel; i<arrOpenNodes.length; i++ )
						if( arrOpenNodes[ i ] && arrOpenNodes[ i ] != section )
						{
							document.all["sub" + arrOpenNodes[ i ]].className = 'Closed'
							if (document.all["img" + arrOpenNodes[ i ]])
								document.all["img" + arrOpenNodes[ i ]].src = closedImg;	
						}
				}
			}
		}
		