// this js file should not need to be modified. To change the menu, go to /includes/leftnav.htm

$(document).ready(function()
{
  //initially closes all divs
  
  $(".nav_body").hide();  
  
  // Opens certain div depending on what category the page resides
  // To enable, put an empty div#menu in the body of a page and add the class of the 
  // menu section you desire to be initially revealed
  // ie: <div id=menu class="menu1"></div> would cause the page to initially open showing the first level of menu
  //  <div id=menu class="menu2 menu3"></div> would initially open both menu level 2 and 3

  if($('#menu').hasClass('menu1')) {			
    $('#sub1').show();
  }
  
    if($('#menu').hasClass('menu2')) {
    $('#sub2').show();
  }
  
    if($('#menu').hasClass('menu3')) {
    $('#sub3').show();
  }
  
    if($('#menu').hasClass('menu4')) {
    $('#sub4').show();
  }
  
    if($('#menu').hasClass('menu5')) {
    $('#sub5').show();
  }
  
    if($('#menu').hasClass('menu6')) {
    $('#sub6').show();
  }
  
    if($('#menu').hasClass('menu7')) {
    $('#sub7').show();
  }
  
    if($('#menu').hasClass('menu8')) {
    $('#sub8').show();
  }
  
    if($('#menu').hasClass('menu9')) {
    $('#sub9').show();
  }
  
  
  // Enables Click to open and close divs

  	$(".nav_head").click(function()							// opens and closes navigation items at user's request
  	{
    	$(this).next(".nav_body").slideToggle(400);
  	});
  
  	$('.nav_head').mouseover(function(){					// styles main navigation categories
		$(this).addClass('over').css("cursor", "pointer"); })
  			.mouseout(function(){$(this).removeClass('over');
	});
			
	$('#sub_nav li').mouseover(function(){					// styles the hover of <li> items
		$(this).addClass('hover_list'); })
  			.mouseout(function(){$(this).removeClass('hover_list');
	});
			
	$('#sub_nav li').click(function(){						//expands link area to the entire <li> items
		window.location=$('a', this).attr('href');						
	});
	
	$('#sub_nav li a').each(function(){						//indicates the active page in the navigation
		if(this.href == window.location)  
			$(this).parent().addClass("active_page"); 						  
	});
	
	


 
}); 

