// JavaScript Document
// Sectioned Menu
// cc Samwise Cottle

$(document).ready(function () {
						//hide all menus.
						$("ul[title='leftnav'] li").hide();
						
						//get and tokenize the current url. 
						
						var current = window.location.pathname;													
						var tok = current.split("/iep/")
						var curparent;
						var subparent; //for use later
						var c;
						
						//find the main folder that the current page is located in.
						for (c = 0; c < tok.length; c++)
						{
							if (tok[c]=="kup")
							{
								curparent = tok[c+1];
								subparent = tok[c+2];
							}
						}
						
						//show all menu items whose URLs contain that folder name. 
						$("a[href*='" + curparent + "']").each(function() {
																			$(this).parent().parent().show();
																		});
						
						//show all menu items whose title contains the folder name (external links)
						
						$("a[title=curparent]").each(function() {
																  $(this).parent().parent().show();
															  });
					
						
});
