/*
SITEWIDE JS FUNCTIONS FOR DONORPERFECT
*/


// JQUERY DOCUMENT READY
$(document).ready(function(){
		
	//Toggle Show/Hide Below Footer
		$("#below_footer_container").hide(); 
	
		//Switch the "Open" and "Close" state per click
		$("a.show").toggle(function(){
			$(this).addClass("active");
			},function () {
			$(this).removeClass("active");
		});
	
		//Slide up and down on click
		$("a.show").click(function(){
		$("#below_footer_container").slideToggle("fast");


		});
		
		
	//Toggle Show/Hide Containers
	
		
	// TOGGLE / MORE INFO BOX
		//Hide (Collapse) the toggle containers on load
		$(".toggle_container").hide(); 
	
		//Switch the "Open" and "Close" state per click
		$("h1.trigger").toggle(function(){
			$(this).addClass("active");
			},function () {
			$(this).removeClass("active");
		});
	
		//Slide up and down on click
		$("h1.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("fast");

		});
		
		
	//Toggle Show/Hide Containers
	
		$("#hide_container").hide(); 
	
		//Slide up and down on click
		$("p.show").click(function(){
		$("#hide_container").slideToggle("fast");
		});
		
		$(".hide_container").hide(); 
			
		//Slide up and down on click
		$("p.show").click(function(){
		$(".hide_container").slideToggle("fast");
		//$(this).text($(this).text() == a ? b : a);\n")
		
		});
		
	
		
	//Toggle Show/Hide Containers
	
		$(".feature_desc").hide(); 
		
		
		//EXPAND / COLLAPSE ALL
		
	
		//Expand All;

		$("a.show_all").click(function(){
		$(".feature_desc").show("slow");
		});
		
		//Collapse All;

		$("a.hide_all").click(function(){
		$(".feature_desc").hide("slow");
		});
		
		//------------------------------------
		
		//Switch the "Open" and "Close" state per click
		$(".feature_title").toggle(function(){
			$(this).addClass("active");
			},function () {
			$(this).removeClass("active");
		});
	
		//Slide up and down on click $(this).parent().next('.attempt').show();

		$(".feature_title").click(function(){
		$(this).next(".feature_desc").slideToggle("fast");
		});
		
		
		//Flowtabs
		
		$("#flowtabs").tabs("#flowpanes > div").history();
	
		
	});
	
// END JQUERY DOCUMENT READY FUNCTIONS	
	
	//Toggle text
	
 	function toggle(){
  	var show = document.getElementById('show')
	var hide = document.getElementById('hide')
  	
	if (show.style.display == 'block') {
  	show.style.display = 'none'
  	} else {
  	show.style.display = 'block'
	}
	if (hide.style.display == 'none') {
  		hide.style.display = 'block'
  	} else {
  	hide.style.display = 'none'
		}
     }

