<!--

// This is just a construct I created so that it's easy to gather data from a unique variable.

function menuItem()
{
	this.name = '';
	this.url = '';
}

// What are our section headings? Define them here.		
var a_siteMap = [

				'Home', 
						[ 'Home', '/index.html' ],
				'About', 
						[ 'Who Are We?', '/who.html', 
						  'Vision & Mission Statement', '/vision.html' ],
				'Programming', 
						[ 'Semi-private Enrichment', '/enrichment.html',
						  'After-school', '/afterschool.html',
						  'Summer/March Break Camp', '/camp.html' ],
				'In the Classroom', 
						[ 'About', '/schools.html',
						  'Music Programs', '/schoolsmusic.html',
						  'Drama Programs', '/schoolsdrama.html' ],
				'Contact Us', 
						[ 'Contact Information', '/contact.html',
						  'Subscribe to Our Mailing List', '/subscribe/index.html' ],
				'Fees and Schedules', 
						[ 'Fees and Schedules', '/fees.html' ],
				'Registration', 
						[ 'Registration', '/registration.html' ],
				'FAQ', 
						[ 'FAQ', '/faq.html' ]
				
				];

var a_sectionNames = [];
var a_pageNamesOut = [];

for ( x = 0; x < a_siteMap.length; ++ x )
{
	if ( x % 2 == 0 )
	{
		a_sectionNames.push(a_siteMap[x]);		
	}
	else
	{
		a_pageNamesOut.push( new Array() );
		
		for ( i = 0; i < a_siteMap[x].length; ++ i )
		{
			if ( i % 2 == 0 )
			{
				var item = new menuItem;
				item.name = a_siteMap[x][i];
				item.url = a_siteMap[x][i + 1];
				a_pageNamesOut[a_pageNamesOut.length - 1].push( item );
			}
			else
			{
				continue;
			}
		}
	}
}




// This function is called by the HTML code to fill in a java header that'll work to expand/contract the menu bar.
function fillJava ( currentSection )
{
	document.write( '<script>' );
	
	for ( y = 0; y < a_sectionNames.length; ++ y )
	{
		var javaID = "";

		if ( a_sectionNames[y].split(' ')[0] == 'In' )
		{
			javaID = "Schools";
		}
		else
		{
			javaID = a_sectionNames[y].split(' ')[0];
		}
			

			document.write( 'function expand'
							+ javaID
							+ '()' );
			document.write( '{' );
			
			for ( z = 0; z < a_pageNamesOut[y].length; ++ z )
			{
				document.write( 'var ob'
								+ z
								+ '= document.getElementById("'
								+ javaID
								+ z
								+ '").style;' );
				
				
				if ( a_sectionNames[y] == currentSection )
				{
					document.write( 'ob'
									+ z
									+ '.display = (ob'
									+ z
									+ '.display == "none")?"block": "none";' );
				}
				else
				{
					document.write( 'ob'
									+ z
									+ '.display = (ob'
									+ z
									+ '.display == "block")?"none": "block";' );
				}
			}
			
			if ( a_sectionNames[y] == currentSection )
			{
				document.write( 'document["'
								+ javaID
								+ 'Button"].src = (ob0.display == "none")?"/images/plus.jpg": "/images/minus.jpg";' );
			}
			else
			{
				document.write( 'document["'
								+ javaID
								+ 'Button"].src = (ob0.display == "block")?"/images/minus.jpg": "/images/plus.jpg";' );				
			}
		document.write( '}' );
	}
	
	document.write( '</script>' );
}

// This is the key function -- this creates our navigation box, highlighted and expanded to the right level.
function fillMenu ( currentSection, currentPage )
{
	document.write( '<div class="navbox">' );


	for ( y = 0; y < a_sectionNames.length; ++ y )
	{
		
		var javaID = "";
					
		if ( a_sectionNames[y].split(' ')[0] == 'In' )
		{
			javaID = "Schools";
		}
		else
		{
			javaID = a_sectionNames[y].split(' ')[0];
		}

		if ( currentSection == a_sectionNames[y] )
			{
				document.write( '<div class="navitemtopselected">' );
				
				if ( a_pageNamesOut[y].length > 1 )
				{
					document.write( '<img src="/images/minus.jpg" name="' 
							+ javaID 
							+ 'Button" onclick="expand' 
							+ javaID 
							+ '()";> <a href="'  
							+ a_pageNamesOut[y][0].url 
							+ '">' + a_sectionNames[y]
							+ '</a>' );
				}
				else
				{
					document.write( '<img src="/images/dv.gif"> ' 
						+ a_sectionNames[y] );
				}
				
				document.write( '</div>' );	

				if ( a_pageNamesOut[y].length > 1 )
				{

					for ( z = 0; z < a_pageNamesOut[y].length; ++ z)
					{
						if ( currentPage == a_pageNamesOut[y][z].name )
						{
							document.write( '<div id="' 
											+ javaID 
											+ z 
											+ '" class="navitemselected">' );
							document.write( '&middot; ' + a_pageNamesOut[y][z].name );
						}
						else
						{
					
							document.write( '<div id="' 
											+ javaID 
											+ z
											+ '" class="navitemvisible">' );
							document.write( '&middot; <a href="' 
								+ a_pageNamesOut[y][z].url + '">' 
								+ a_pageNamesOut[y][z].name + '</a>' );
						}
			
						document.write( '</div>' );
					}		
				
				}		
			}
		else
			{

				document.write( '<div class="navitemtop">' );
				if ( a_pageNamesOut[y].length > 1 )
				{
					document.write( '<img src="/images/plus.jpg" name="' 
							+ javaID 
							+ 'Button" onclick="expand' 
							+ javaID 
							+ '()";> <a href="'  
							+ a_pageNamesOut[y][0].url 
							+ '">' + a_sectionNames[y] 
							+ '</a>' );
				}
				else
				{

						document.write( '<img src="/images/dv.gif"> <a href="' 
							+ a_pageNamesOut[y][0].url + '">' 
							+ a_sectionNames[y]  + '</a>');
				
					
				}

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

				for ( z = 0; z < a_pageNamesOut[y].length; ++ z)
				{
					document.write( '<div id="' 
									+ javaID 
									+ z
									+ '" class="navitemitem">' );
					document.write( '&middot; <a href="' 
						+ a_pageNamesOut[y][z].url + '">' 
						+ a_pageNamesOut[y][z].name + '</a>' );
					document.write( '</div>' );
				}			

			}				
	}
	
	document.write('</div>');

};


-->