$(document).ready(function(){

	//Collapsible Panel Script Starts ----------------------------------------------------------- //

	//Hide (Collapse) the toggle containers on load
	$(".toggle_container").hide();

	//Switch the "Open" and "Close" state per click
	$("h2.trigger").toggle(function(){
		$(this).addClass("active");
		}, function () {
		$(this).removeClass("active");
	});

	//Slide up and down on click
	$("h2.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("slow");
	});

	$("h1.trigger").addClass("active");

	//Switch the "Open" and "Close" state per click
	$("h1.trigger").toggle(function(){
		$(this).removeClass("active");
		}, function () {
		$(this).addClass("active");
	});

	//Slide up and down on click
	$("h1.trigger").click(function(){
		$(this).next(".toggle_container_active").slideToggle("slow");
	});

	//Accordion Script Starts ----------------------------------------------------------- //

	//ACCORDION BUTTON ACTION (ON CLICK DO THE FOLLOWING)
	$('.Accordion:not(.fixed) h2').click(function() {

		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$('.Accordion:not(.fixed) h2').removeClass('AccordionButtonActive');

		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
	 	$('.AccordionContainer:not(.fixed)').slideUp('slow');

		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {

			//ADD THE ON CLASS TO THE BUTTON
			$(this).addClass('AccordionButtonActive');

			//OPEN THE SLIDE
			$(this).next().slideDown('slow');
		 }

	 });

	/********************************************************************************************************************
	CLOSES ALL S ON PAGE LOAD
	********************************************************************************************************************/
	$('.AccordionContainer:not(.fixed)').hide();
	$('.Accordion').find('h2.open').addClass('AccordionButtonActive');
	$('.Accordion').find('h2.open').next().show();

});
