//** Go to the bottom of the file to understand how to customize the menu. **//
var IsIEPlus = true
if (IsIEPlus)
{
	var char34 = String.fromCharCode(34);
	var hpStr;
	hpStr = 
		"<font face='verdana,arial,helvetica' size=1>" +
		"	<!--CATEGORY_LINKS-->"+
		"</font>";
}

//**************** Main Category functions ****************//
function addCategory(CatIDStr, CatOffStr, CatOnStr, LinkURL, Level1_Selected)
{
	SubStr = "<!--CATEGORY_LINKS-->";
	if (hpStr.indexOf(SubStr) >= 0)
	{
		if (Level1_Selected == CatIDStr) {
			sStyle = "black";
			SrcStr = "<tr><td><DIV STYLE='cursor:hand;'" +
				 "     ID=C_" + CatIDStr +
				 "     NOWRAP>" +
				 "<A STYLE='color:black;text-decoration:none;'" +
				 "   HREF=" + LinkURL + " " +
				 "   onfocus=" + char34 + "window.status='';" + char34 + 
				 ">"
			SrcStr = SrcStr + "<IMG ID=I_" + CatIDStr + " src='" + CatOnStr + "' width=185 align=absbottom border=0></A><BR>" 
			SrcStr = SrcStr + 
				 "<DIV STYLE='display:" + sStyle + ";'" +
				 "     ID=T_" + CatIDStr + 
				 "     onClick=" + char34 + "window.event.cancelBubble=true;" + char34 + ">" +
				 "<DIV STYLE='margin-left:0;'><FONT SIZE=1><!--" + CatIDStr + "-->" + "</DIV>" +
				 "</DIV>";
			SrcStr = SrcStr + "</DIV></td></tr>" + SubStr;
		} else {
			sStyle = "none";
			SrcStr = "<tr><td><DIV STYLE='cursor:hand;'" +
				 "     ID=C_" + CatIDStr +
				 "     onMouseOver=" + char34 + "I_" + CatIDStr + ".src='" + CatOnStr + "'" + char34 + 
				 "     onMouseOut=" + char34 + "I_" + CatIDStr + ".src='" + CatOffStr + "'" + char34 + 
				 "     NOWRAP>" +
				 "<A STYLE='color:black;text-decoration:none;'" +
				 "   HREF=" + LinkURL + " " +
				 "   onfocus=" + char34 + "window.status='';" + char34 + 
				 "   onmouseover=" + char34 + "window.status='';" + char34 + 
				 ">"
			SrcStr = SrcStr + "<IMG ID=I_" + CatIDStr + " src='" + CatOffStr + "' width=185 align=absbottom border=0></A><BR>"
			SrcStr = SrcStr + 
				 "<DIV STYLE='display:" + sStyle + ";'" +
				 "     ID=T_" + CatIDStr + 
				 "     onClick=" + char34 + "window.event.cancelBubble=true;" + char34 + ">" +
				 "<DIV STYLE='margin-left:0;'><FONT SIZE=1><!--" + CatIDStr + "-->" + "</DIV>" +
				 "</DIV>";
			SrcStr = SrcStr + "</DIV></td></tr>" + SubStr;
		}
		hpStr = hpStr.replace(SubStr, SrcStr);	
	}
}

function clickCategory(CatIDStr,CatOffStr,CatOnStr) 
{
	var txtObj = document.all("T_" + CatIDStr);
	var imgObj = document.all("I_" + CatIDStr);

	if (txtObj.style.display == 'none') 
	{
		txtObj.style.display = '';
		imgObj.src = CatOnStr;
	}
	else 
	{
		txtObj.style.display = 'none';
		imgObj.src = CatOffStr;

	}
}

//**************** Subcategory functions ****************//
function addSubcategory(CatIDStr, SubCatIDStr, SubCatOffStr, SubCatOnStr, LinkUrl, Level2_Selected)
{
	var temp;
	SubStr  = "<!--" + CatIDStr + "-->";
	if (hpStr.indexOf(SubStr) >= 0)
	{
		if (Level2_Selected == SubCatIDStr) {
			SrcStr = "<A HREF='" + LinkUrl + "'><IMG src='" + SubCatOnStr + "' width=185 align=absbottom border=0></A><BR>" + SubStr;
		} else {
			SrcStr = "<DIV STYLE='cursor:hand;'" +
				 "     ID=C_" + SubCatIDStr +
				 "     onMouseOver=" + char34 + "I_" + SubCatIDStr + ".src='" + SubCatOnStr + "'" + char34 + 
				 "     onMouseOut=" + char34 + "I_" + SubCatIDStr + ".src='" + SubCatOffStr + "'" + char34 + 
				 "     NOWRAP>"
			SrcStr =  SrcStr + "<A STYLE='color:black;text-decoration:none;'" +
				 "   onfocus=" + char34 + "window.status='';" + char34 + 
				 "   onmouseover=" + char34 + "window.status='';" + char34 + 
				 " HREF='" + LinkUrl + "'><IMG ID=I_" + SubCatIDStr + " src='" + SubCatOffStr + "' width=185 align=absbottom border=0></A><BR>";
			SrcStr = SrcStr + 
				 "<DIV STYLE='display:" + sStyle + ";'" +
				 "     ID=T_" + SubCatIDStr + 
				 "     onClick=" + char34 + "window.event.cancelBubble=true;" + char34 + "></DIV>" +
				 "</DIV>" + SubStr;
		}
		hpStr = hpStr.replace(SubStr, SrcStr);	
	}
}

function clickSubCategory(CatSubIDStr,SubCatOffStr,SubCatOnStr) 
{
	var txtObj = document.all("T_" + CatSubIDStr);
	var imgObj = document.all("I_" + CatSubIDStr);

	if (txtObj.style.display == 'none') 
	{
		txtObj.style.display = '';
		imgObj.src = SubCatOnStr;
		//alert(imgObj.src);
	}
	else 
	{
		txtObj.style.display = 'none';
		imgObj.src = SubCatOffStr;
		//alert(imgObj.src);

	}
	//window.event.cancelBubble=true;
}

//**************** Menu Building functions ****************//
function showMenu(Level1_Selected, Level2_Selected)
{
//**************************************************************************//
//This function builds the menu for the website.  The Level1_Selected and Level2_Selected variables enable specific
//menu items to be "on" as a default.  The following functions can be modified to customize the menu.
//
//	addCategory(CatID, Off_Image_URL, On_Image_URL, Link_URL, Level1_Selected)
//		CatID: This is a unique name for this menu item, e.g. "Home".
//		Off_Image_URL: Pathname to the button when switched "off".
//		On_Image_URL: Pathname to the button when switched "on".
//		Link_URL: Pathname to the file when the button is clicked.
//		Level1_Selected: This should remain as "Level1_Selected".  
//			This enables the menu to be preselected when the page is opened.
//
//	addSubcategory(CatID, SubcatID, Off_Image_URL, On_Image_URL, Link_URL, Level2_Selected)
//		CatID: This is the main category ID for this menu item, e.g. "PersonalDevelopment".
//		SubCatID: This is a unique name for this menu item, e.g. "Leadership" (within Personal Development category).
//		Off_Image_URL: Pathname to the button when switched "off".
//		On_Image_URL: Pathname to the button when switched "on".
//		Link_URL: Pathname to the file when the button is clicked.
//		Level2_Selected: This should remain as "Level2_Selected".  
//			This enables the menu to be preselected when the page is opene appearing below the particular category.
//
//**************************************************************************//
	document.write('<table border="0" cellpadding="1" cellspacing="0" width="187">');

	//Add the menu item to the menu.
	addCategory("Home", "/nav_images/BP_home_off.gif", "/nav_images/BP_home_on.gif", "/", Level1_Selected);

	addCategory("Chronicles", "/nav_images/BP_bmc_off.gif", "/nav_images/BP_bmc_on.gif", "/bmc/", Level1_Selected);

    addCategory("Potholes", "/nav_images/BP_potholes_off.gif", "/nav_images/BP_potholes_on.gif", "/potholes/", Level1_Selected);
    
	addCategory("Vitals", "/nav_images/BP_vital_off.gif", "/nav_images/BP_vital_on.gif", "/vitalsigns/", Level1_Selected);
	
	//addCategory("21Day", "/nav_images/BP_21_off.gif", "/nav_images/BP_21_on.gif", "/adventure/", Level1_Selected);

	//Add the menu items and submenu items to the menu.
	addCategory("YLC", "/nav_images/BP_ylc_off.gif", "/nav_images/BP_ylc_on.gif", "/courage/", Level1_Selected);
	addSubcategory("YLC", "YLCOverview", "/nav_images/BP_overview_off.gif", "/nav_images/BP_overview_on.gif", "/courage/", Level2_Selected);
//	addSubcategory("YLC", "YLCFAQ", "/nav_images/BP_faq_off.gif", "/nav_images/BP_faq_on.gif", "/courage/faq/", Level2_Selected);
	addSubcategory("YLC", "YLCTestimonials", "/nav_images/BP_testimonies_off.gif", "/nav_images/BP_testimonies_on.gif", "/courage/testimony/", Level2_Selected);
//	addSubcategory("YLC", "YLCRegistration", "/nav_images/BP_register_off.gif", "/nav_images/BP_register_on.gif", "/courage/register/", Level2_Selected);

	//Add the menu items and submenu items to the menu.
	addCategory("24HRS", "/nav_images/BP_24_off.gif", "/nav_images/BP_24_on.gif", "/impact/", Level1_Selected);
	addSubcategory("24HRS", "24HrsOverview", "/nav_images/BP_overview_off.gif", "/nav_images/BP_overview_on.gif", "/impact/", Level2_Selected);
	addSubcategory("24HRS", "24HrsFAQ", "/nav_images/BP_faq_off.gif", "/nav_images/BP_faq_on.gif", "/impact/faq/", Level2_Selected);
	addSubcategory("24HRS", "24HrsTestimonials", "/nav_images/BP_testimonies_off.gif", "/nav_images/BP_testimonies_on.gif", "/impact/testimony/", Level2_Selected);
//	addSubcategory("24HRS", "24HrsRegister", "/nav_images/BP_register_off.gif", "/nav_images/BP_register_on.gif", "/impact/register/", Level2_Selected);


	//Add the menu items and submenu items to the menu.
	addCategory("MMS", "/nav_images/BP_summit_off.gif", "/nav_images/BP_summit_on.gif", "/summit/", Level1_Selected);
	addSubcategory("MMS", "MMSOverview", "/nav_images/BP_overview_off.gif", "/nav_images/BP_overview_on.gif", "/summit/", Level2_Selected);
//	addSubcategory("MMS", "MMSTestimonials", "/nav_images/BP_testimonies_off.gif", "/nav_images/BP_testimonies_on.gif", "/summit/testimony/", Level2_Selected);
//	addSubcategory("MMS", "MMSRegistration", "/nav_images/BP_register_off.gif", "/nav_images/BP_register_on.gif", "/summit09/register/", Level2_Selected);

	//Add the menu items and submenu items to the menu.
	addCategory("Speaking", "/nav_images/BP_speaking_off.gif", "/nav_images/BP_speaking_on.gif", "/speaking/", Level1_Selected);
	addSubcategory("Speaking", "SpeakingWorkshops", "/nav_images/BP_workshops_off.gif", "/nav_images/BP_workshops_on.gif", "/speaking/", Level2_Selected);
//	addSubcategory("Speaking", "SpeakingTestimonials", "/nav_images/BP_testimonies_off.gif", "/nav_images/BP_testimonies_on.gif", "/speaking/testimony/", Level2_Selected);
	addSubcategory("Speaking", "SpeakingPlanning", "/nav_images/BP_planning_off.gif", "/nav_images/BP_planning_on.gif", "/speaking/planning/", Level2_Selected);

	//Add the menu items and submenu items to the menu.
	addCategory("Coaching", "/nav_images/BP_coaching_off.gif", "/nav_images/BP_coaching_on.gif", "/coaching/", Level1_Selected);
	addSubcategory("Coaching", "CoachingOverview", "/nav_images/BP_overview_off.gif", "/nav_images/BP_overview_on.gif", "/coaching/", Level2_Selected);
	addSubcategory("Coaching", "LifeCoaching", "/nav_images/BP_lifecoaching_off.gif", "/nav_images/BP_lifecoaching_on.gif", "/coaching/life/", Level2_Selected);
	addSubcategory("Coaching", "ExecutiveCoaching", "/nav_images/BP_execcoaching_off.gif", "/nav_images/BP_execcoaching_on.gif", "/coaching/executive/", Level2_Selected);

	addCategory("Survey", "/nav_images/BP_survey_off.gif", "/nav_images/BP_survey_on.gif", "/survey/", Level1_Selected);
	addSubcategory("Survey", "SurveyOverview", "/nav_images/BP_overview_off.gif", "/nav_images/BP_overview_on.gif", "/survey/", Level2_Selected);
	addSubcategory("Survey", "SurveyFAQ", "/nav_images/BP_faq_off.gif", "/nav_images/BP_faq_on.gif", "/survey/faq/", Level2_Selected);

	addSubcategory("Survey", "SurveyTestimonials", "/nav_images/BP_testimonies_off.gif", "/nav_images/BP_testimonies_on.gif", "/survey/testimony/", Level2_Selected);
	addSubcategory("Survey", "SurveySchedule", "/nav_images/BP_schedsurvey_off.gif", "/nav_images/BP_schedsurvey_on.gif", "/survey/schedule/", Level2_Selected);

//	addCategory("Resources", "/nav_images/BP_resources_off.gif", "/nav_images/BP_resources_on.gif", "/resources/", Level1_Selected);

	//Add the menu items and submenu items to the menu.
	addCategory("About", "/nav_images/BP_about_off.gif", "/nav_images/BP_about_on.gif", "/about/", Level1_Selected);
//	addSubcategory("About", "DearPastor", "/nav_images/BP_leader_off.gif", "/nav_images/BP_leader_on.gif", "/about/for-pastors/", Level2_Selected);
	addSubcategory("About", "AboutMission", "/nav_images/BP_mission_off.gif", "/nav_images/BP_mission_on.gif", "/about/", Level2_Selected);
	addSubcategory("About", "AboutPhilosophy", "/nav_images/BP_philosophy_off.gif", "/nav_images/BP_philosophy_on.gif", "/about/philosophy/", Level2_Selected);
	addSubcategory("About", "AboutTeam", "/nav_images/BP_team_off.gif", "/nav_images/BP_team_on.gif", "/about/team/", Level2_Selected);
	
	addCategory("Contact", "/nav_images/BP_contact_off.gif", "/nav_images/BP_contact_on.gif", "/contact/", Level1_Selected);

//	addCategory("spacer", "/nav_images/BP_spacer.gif", "/nav_images/BP_spacer.gif", "/leaders/", Level1_Selected);
//	addCategory("Leaders", "/nav_images/BP_leader_off.gif", "/nav_images/BP_leader_on.gif", "/leaders/", Level1_Selected);

	document.write(hpStr);
	document.write('</table>');
}


