var custServNav = {

	init : function() 
	{
		//Get all the collapsible section elements and loop through each.
		$$("ul.nav-toggle-menu > li > div").each (
			function(cs) 
			{
				//Get the action element.
				var a = cs.previous("a");
				
				//Get the header element, and add a class to show the arrow icon.
				var h = a.up("li").addClassName("nav-toggle-closed");

				//Add the click event to the anchor.
				Event.observe(a, "click", function() { custServNav.toggle(h, cs); });
			}
		);
	},
	
	toggle : function(h, cs) 
	{
		//Do the effect on the collapsible section.
		new Effect.toggle(cs, "slide", {duration: 0.25}); 

		//Toggle class names for the header element.
		if ($(cs).visible()) 
		{
			h.removeClassName("nav-toggle-open").addClassName("nav-toggle-closed");
		} 
		else 
		{
			h.addClassName("nav-toggle-open").removeClassName("nav-toggle-closed");
		}		
	}

};

Event.observe(window, "load", custServNav.init);



var faqNav = {

	init : function() 
	{
		//Get all the collapsible section elements and loop through each.
		$$("div.faq-section > div.column > ul > li > div").each(
			function(cs) 
			{
				//Get the action element.
				var a = cs.previous("h4");
				
				//Get the header element.
				var h = a.up("li");

				//Add the click event to the action element.
				Event.observe(a, "click", function() { faqNav.toggle(h, cs); });
			}
		);
	},

	toggle : function(h, cs)
	{
		//Do the effect on the collapsible section.
		new Effect.toggle(cs, "slide", {duration: 0.15}); 

		//Toggle class names for the header element.
		if ($(cs).visible()) 
		{
			h.removeClassName("nav-toggle-open");;
		} 
		else 
		{
			h.addClassName("nav-toggle-open");
		}		

	}
};

Event.observe(window, "load", faqNav.init);
