/* 
  *This is a jquery plugin
*/
/* This Function Controls jQuery Accordion Menu */
$(document).ready(function(){

	//Hide (Collapse) the toggle containers on load
	$(".body-area").hide();
	// ignore line below it just sets an active class
	//$('.menu_body:first').addClass('active').next().show();
	
	// This shows the menu dropout when your in that section SEE READ ME FILE
	// This should reflect page setting li id and always menu body - it opens the section when on the selected page
	//$('.accordion-menu #nav-name2 .menu_body').show();
	//$('.contact #nav-contact .menu_body').show();

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$("#accordion-content h3.open-area").click(function(){
		$(this).toggleClass("active").next("h3.body-area").slideToggle(300).siblings("this").slideUp("slow");
		if( $('h3.open-area').next().is(':hidden') ) { //If immediate next container is closed...
		$('h3.open-area').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
		$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
	}
		
		return false; //Prevent the browser jump to the link anchor
	});

});
