var currSect
var currentPage

// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// THIS FUNCTION SHOWS AND HIDES NAVIGATION
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
function showHide( whatNav )
			{
			var vNav = document.getElementById(whatNav);
			if ( vNav.style.visibility == "hidden" && whatNav != currSect )
				{
				if (document.all) 
					{ //IS IE 4 or 5 (or 6 beta)
					eval( "document.all." + whatNav + ".style.visibility = 'visible'");
					}
				if (document.layers) 
					{ //IS NETSCAPE 4 or below
					document.layers[whatNav].visibility = 'visible';
					}
				if (document.getElementById && !document.all) 
					{
					maxwell_smart = document.getElementById(whatNav);
					maxwell_smart.style.visibility = 'visible';
					}
				// vNav.style.display = "inline"
				}
			else if ( whatNav != currSect )
				{
				if (document.all) 
					{ //IS IE 4 or 5 (or 6 beta)
					eval( "document.all." + whatNav + ".style.visibility = 'hidden'");
					}
				if (document.layers) 
					{ //IS NETSCAPE 4 or below
					document.layers[whatNav].visibility = 'hidden';
					}
				if (document.getElementById && !document.all) 
					{
					maxwell_smart = document.getElementById(whatNav);
					maxwell_smart.style.visibility = 'hidden';
					}
				// vNav.style.display = "none"
				}
			}

// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// THIS FUNCTION KEEPS NAV ON WHEN YOU ROLL OVER IT
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
function overStatus( whatNav )
			{
			var vNav = document.getElementById(whatNav);
			if ( vNav.style.visibility == "hidden" && whatNav != currSect)
				{
				// vNav.style.display = "inline"
				if (document.all) 
					{ //IS IE 4 or 5 (or 6 beta)
					eval( "document.all." + whatNav + ".style.visibility = 'visible'");
					}
				if (document.layers) 
					{ //IS NETSCAPE 4 or below
					document.layers[whatNav].visibility = 'visible';
					}
				if (document.getElementById && !document.all) 
					{
					maxwell_smart = document.getElementById(whatNav);
					maxwell_smart.style.visibility = 'visible';
					}
				}
			else if ( whatNav != currSect )
				{
				// vNav.style.display = "none"
				if (document.all) 
					{ //IS IE 4 or 5 (or 6 beta)
					eval( "document.all." + whatNav + ".style.visibility = 'hidden'");
					}
				if (document.layers) 
					{ //IS NETSCAPE 4 or below
					document.layers[whatNav].visibility = 'hidden';
					}
				if (document.getElementById && !document.all) 
					{
					maxwell_smart = document.getElementById(whatNav);
					maxwell_smart.style.visibility = 'hidden';
					}
				}
			}

// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// THIS FUNCTION PRINTS NAVIGATION TO THE PAGE
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
function NavLoading( sectione )
			{
			var URL = window.location;
			document.invisibleForm.invisibleField.value = URL;
			var grabbedURL	= document.invisibleForm.invisibleField.value;
			var pagina = grabbedURL.slice( (grabbedURL.lastIndexOf("/")+1) , grabbedURL.length );
			// Check to see if the location is the home page
			if ( pagina == "hashaiti.org/" || pagina == "www.hashaiti.org/" || pagina == "www.hashaiti.org/" || pagina == "hashaiti.org" || pagina == "" )
				{
				currentPage = "thehome"
				pagina = "thehome"
				}
			else
				{
				currentPage = pagina
				}
			// Determines if this is the board page
			if ( grabbedURL.indexOf("board") != -1)
				{
				currentPage = "index.html"
				pagina = "index.html"
				}
			else
				{
				currentPage = pagina
				}

			/* 1 */
			switch(sectione)
					{
					case "aNav":
			/* 2 */			var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
			/* 3 */			for (i=0; i<SectionWhoWeAre.length; i++ )
								{
			/* 4 */				var found = "no"
								for (j=0; j<SectionWhoWeAre[i].SubSectionPage.length; j++)
									{
									if (SectionWhoWeAre[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
			/* 5 */				if (found == "yes")
									{
			/* 6 */					vDiv.style.visibility = "visible"
			/* 7 */					document.writeln('<div class="sectionAon"><img src="image/a_carrot.gif">' + SectionWhoWeAre[i].SubSectionName + '</div>'  );
									}
			/* 8 */				else
									{
			/* 9 */					document.writeln('<div class="sectionoff"><a class="sectionAoff" href="' + SectionWhoWeAre[i].SubSectionPage[0].Link + '">' + SectionWhoWeAre[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;
			/* 10 */
					case "bNav":
							var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
							for (i=0; i<SectionWhatWeDo.length; i++ )
								{
								var found = "no"
								for (j=0; j<SectionWhatWeDo[i].SubSectionPage.length; j++)
									{
									if (SectionWhatWeDo[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
								if (found == "yes")
									{
									vDiv.style.visibility = "visible"
									document.writeln('<div class="sectionBon"><img src="image/b_carrot.gif">' + SectionWhatWeDo[i].SubSectionName + '</div>'  );
									}
								else
									{
									document.writeln('<div class="sectionoff"><a class="sectionBoff" href="' + SectionWhatWeDo[i].SubSectionPage[0].Link + '">' + SectionWhatWeDo[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;
					
					case "cNav":
							var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
							for (i=0; i<SectionYouCanHelp.length; i++ )
								{
								var found = "no"
								for (j=0; j<SectionYouCanHelp[i].SubSectionPage.length; j++)
									{
									if (SectionYouCanHelp[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
								if (found == "yes")
									{
									vDiv.style.visibility = "visible"
									document.writeln('<div class="sectionCon"><img src="image/c_carrot.gif">' + SectionYouCanHelp[i].SubSectionName + '</div>'  );
									}
								else
									{
									document.writeln('<div class="sectionoff"><a class="sectionCoff" href="' + SectionYouCanHelp[i].SubSectionPage[0].Link + '">' + SectionYouCanHelp[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;
					
					case "dNav":
							var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
							for (i=0; i<SectionWhatsNew.length; i++ )
								{
								var found = "no"
								for (j=0; j<SectionWhatsNew[i].SubSectionPage.length; j++)
									{
									if (SectionWhatsNew[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
								if (found == "yes")
									{
									vDiv.style.visibility = "visible"
									document.writeln('<div class="sectionDon"><img src="image/d_carrot.gif">' + SectionWhatsNew[i].SubSectionName + '</div>'  );
									}
								else
									{
									document.writeln('<div class="sectionoff"><a class="sectionDoff" href="' + SectionWhatsNew[i].SubSectionPage[0].Link + '">' + SectionWhatsNew[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;
					
					case "eNav":
							var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
							for (i=0; i<SectionContactUs.length; i++ )
								{
								var found = "no"
								for (j=0; j<SectionContactUs[i].SubSectionPage.length; j++)
									{
									if (SectionContactUs[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
								if (found == "yes")
									{
									vDiv.style.visibility = "visible"
									document.writeln('<div class="sectionEon"><img src="image/e_carrot.gif">' + SectionContactUs[i].SubSectionName + '</div>'  );
									}
								else
									{
									document.writeln('<div class="sectionoff"><a class="sectionEoff" href="' + SectionContactUs[i].SubSectionPage[0].Link + '">' + SectionContactUs[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;
					
					case "board":
							if ( grabbedURL.slice( (grabbedURL.lastIndexOf("/")+1) , grabbedURL.length ) != "index.html" && grabbedURL.slice( (grabbedURL.lastIndexOf("/")+1) , grabbedURL.length ) != "" )
								{
								pagina = grabbedURL.slice( (grabbedURL.lastIndexOf("/")+1) , grabbedURL.length );
								}
							var vDiv = document.getElementById(sectione);
							vDiv.style.visibility = "hidden"
							for (i=0; i<SectionBoard.length; i++ )
								{
								var found = "no"
								for (j=0; j<SectionBoard[i].SubSectionPage.length; j++)
									{
									if (SectionBoard[i].SubSectionPage[j].Link == pagina)
										{
										var found = "yes"
										currSect = sectione
										}
									}
								if (found == "yes")
									{
									vDiv.style.visibility = "visible"
									document.writeln('<div class="sectionAon"><img src="../image/a_carrot.gif">' + SectionBoard[i].SubSectionName + '</div>'  );
									}
								else
									{
									document.writeln('<div class="sectionoff"><a class="sectionAoff" href="' + SectionBoard[i].SubSectionPage[0].Link + '">' + SectionBoard[i].SubSectionName + '</a></div>'  );
									}
								}
							document.writeln('<br>');
							break;

			/* 11 */
					default:
							alert("Didn't find case")
							break;
					}
			// CODE KEY
			// 1. do switch on sectione, and when you find that case:
			// 2. Set the visibility of the <div> to hidden
			// 3. LOOP and populate the <div> with current section links
			// 4. 	Determine if current link in loop is equal to pagina
			// 5. 		If YES, 
			// 6.			- set the visibility of this <div> to visible.
			// 7.			- Print the carrot and text NO link
			// 8. 		If NO,
			// 9.			- Print the text link
			// 10. Start Next cases and repeat
			// 11. Set default	
}



// -------------------------------------------------------------------------------------------------------------------------------------------------------------
// THIS FUNCTION PRINTS SUB NAVIGATION TO THE PAGE
// -------------------------------------------------------------------------------------------------------------------------------------------------------------
function buildSubNav(currPage)
			{
			document.writeln('<img src="image/spacer.gif" width="120" height="1" border="0">');
			switch(currSect)
					{
					case "aNav":
							for (i=0; i<SectionWhoWeAre.length; i++ )
								{
								for (j=0; j<SectionWhoWeAre[i].SubSectionPage.length; j++)
										{
										if (SectionWhoWeAre[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionWhoWeAre[i].SubSectionPage.length; k++)
												{
												if (SectionWhoWeAre[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionAoff" href="' + SectionWhoWeAre[i].SubSectionPage[k].Link + '">' + SectionWhoWeAre[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionAon"><img src="image/a_carrot.gif">' + SectionWhoWeAre[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
					
					case "bNav":
							for (i=0; i<SectionWhatWeDo.length; i++ )
								{
								for (j=0; j<SectionWhatWeDo[i].SubSectionPage.length; j++)
										{
										if (SectionWhatWeDo[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionWhatWeDo[i].SubSectionPage.length; k++)
												{
												if (SectionWhatWeDo[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionBoff" href="' + SectionWhatWeDo[i].SubSectionPage[k].Link + '">' + SectionWhatWeDo[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionBon"><img src="image/b_carrot.gif">' + SectionWhatWeDo[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
							
					case "cNav":
							for (i=0; i<SectionYouCanHelp.length; i++ )
								{
								for (j=0; j<SectionYouCanHelp[i].SubSectionPage.length; j++)
										{
										if (SectionYouCanHelp[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionYouCanHelp[i].SubSectionPage.length; k++)
												{
												if (SectionYouCanHelp[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionCoff" href="' + SectionYouCanHelp[i].SubSectionPage[k].Link + '">' + SectionYouCanHelp[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionCon"><img src="image/c_carrot.gif">' + SectionYouCanHelp[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
					
					case "dNav":
							for (i=0; i<SectionWhatsNew.length; i++ )
								{
								for (j=0; j<SectionWhatsNew[i].SubSectionPage.length; j++)
										{
										if (SectionWhatsNew[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionWhatsNew[i].SubSectionPage.length; k++)
												{
												if (SectionWhatsNew[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionDoff" href="' + SectionWhatsNew[i].SubSectionPage[k].Link + '">' + SectionWhatsNew[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionDon"><img src="image/d_carrot.gif">' + SectionWhatsNew[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
					
					case "eNav":
							for (i=0; i<SectionContactUs.length; i++ )
								{
								for (j=0; j<SectionContactUs[i].SubSectionPage.length; j++)
										{
										if (SectionContactUs[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionContactUs[i].SubSectionPage.length; k++)
												{
												if (SectionContactUs[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionEoff" href="' + SectionContactUs[i].SubSectionPage[k].Link + '">' + SectionContactUs[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionEon"><img src="image/e_carrot.gif">' + SectionContactUs[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
							
					case "board":
							for (i=0; i<SectionBoard.length; i++ )
								{
								for (j=0; j<SectionBoard[i].SubSectionPage.length; j++)
										{
										if (SectionBoard[i].SubSectionPage[j].Link == currPage)
											{
											for (k=0; k<SectionBoard[i].SubSectionPage.length; k++)
												{
												if (SectionBoard[i].SubSectionPage[k].Link != currPage)
													{
													document.writeln('<div class="sectionoff"><a class="sectionAoff" href="' + SectionBoard[i].SubSectionPage[k].Link + '">' + SectionBoard[i].SubSectionPage[k].PageName + '</a></div>'  );
													}
												else
													{
													document.writeln('<div class="sectionAon"><img src="../image/a_carrot.gif">' + SectionBoard[i].SubSectionPage[k].PageName + '</div>'  );
													}
												}
												document.writeln('<br><br>')
												break;
											}
										}
								}
							break;
					}
			}



// ------------------------------------------------------------------------------------------
// THIS FUNCTION PRINTS NAVIGATION TO THE PAGE
// ------------------------------------------------------------------------------------------
function buildNav( )
			{
				document.writeln(' <table width="550" height="102" border="0" cellpadding="0" cellspacing="0" id="mainnav"> ');
				document.writeln(' 		<tr>  ');
				document.writeln(' 			<td width="110" height="77" valign="bottom" onMouseOver="overStatus(\'aNav\');" onMouseOut="overStatus(\'aNav\');"><div class="sectionMenu" id="aNav"><script type="text/javascript">NavLoading("aNav");</script></div></td> ');
				document.writeln(' 			<td width="110" height="77" valign="bottom" onMouseOver="overStatus(\'bNav\');" onMouseOut="overStatus(\'bNav\');"><div class="sectionMenu" id="bNav"><script type="text/javascript">NavLoading("bNav");</script></div></td> ');
				document.writeln(' 			<td width="110" height="77" valign="bottom" onMouseOver="overStatus(\'cNav\');" onMouseOut="overStatus(\'cNav\');"><div class="sectionMenu" id="cNav"><script type="text/javascript">NavLoading("cNav");</script></div></td> ');
				document.writeln(' 			<td width="110" height="77" valign="bottom" onMouseOver="overStatus(\'dNav\');" onMouseOut="overStatus(\'dNav\');"><div class="sectionMenu" id="dNav"><script type="text/javascript">NavLoading("dNav");</script></div></td> ');
				document.writeln(' 			<td width="110" height="77" valign="bottom" onMouseOver="overStatus(\'eNav\');" onMouseOut="overStatus(\'eNav\');"><div class="sectionMenu" id="eNav"><script type="text/javascript">NavLoading("eNav");</script></div></td> ');
				document.writeln(' 		</tr> ');
				document.writeln(' 		<tr>  ');
				document.writeln(' 			<td width="110" height="25"><a href="A1a.html" target="_top" onClick="MM_nbGroup(\'down\',\'group1\',\'A\',\'image/A_on.gif\',1)" onMouseOver="showHide(\'aNav\'); MM_nbGroup(\'over\',\'A\',\'image/A_on.gif\',\'\',1)" onMouseOut="showHide(\'aNav\'); MM_nbGroup(\'out\')"><img id="A" src="image/A.gif" border="0" alt="Who We Are"></a></td> ');
				document.writeln(' 			<td width="110" height="25"><a href="B1a.html" target="_top" onClick="MM_nbGroup(\'down\',\'group1\',\'B\',\'image/B_on.gif\',1)" onMouseOver="showHide(\'bNav\'); MM_nbGroup(\'over\',\'B\',\'image/B_on.gif\',\'\',1)" onMouseOut="showHide(\'bNav\'); MM_nbGroup(\'out\')"><img id="B" src="image/B.gif" border="0" alt="What We Do"></a></td> ');
				document.writeln(' 			<td width="110" height="25"><a href="C1.html" target="_top" onClick="MM_nbGroup(\'down\',\'group1\',\'C\',\'image/C_on.gif\',1)" onMouseOver="showHide(\'cNav\'); MM_nbGroup(\'over\',\'C\',\'image/C_on.gif\',\'\',1)" onMouseOut="showHide(\'cNav\'); MM_nbGroup(\'out\')"><img id="C" src="image/C.gif" border="0" alt="You Can Help"></a></td> ');
				document.writeln(' 			<td width="110" height="25"><a href="D1.html" target="_top" onClick="MM_nbGroup(\'down\',\'group1\',\'D\',\'image/D_on.gif\',1)" onMouseOver="showHide(\'dNav\'); MM_nbGroup(\'over\',\'D\',\'image/D_on.gif\',\'\',1)" onMouseOut="showHide(\'dNav\'); MM_nbGroup(\'out\')"><img id="D" src="image/D.gif" border="0" alt="What\'s New"></a></td> ');
				document.writeln(' 			<td width="110" height="25"><a href="E1.html" target="_top" onClick="MM_nbGroup(\'down\',\'group1\',\'E\',\'image/E_on.gif\',1)" onMouseOver="showHide(\'eNav\'); MM_nbGroup(\'over\',\'E\',\'image/E_on.gif\',\'\',1)" onMouseOut="showHide(\'eNav\'); MM_nbGroup(\'out\')"><img id="E" src="image/E.gif" border="0" alt="Contact Us"></a></td> ');
				document.writeln(' 		</tr> ');
				document.writeln(' </table> ');
			}

