$(".module").each(function(){
	//Stores the expanded height
	var h = $(this).find(".bd").height();
	
	//Sets the height to 0
	$(this).find(".bd").height(0);
	
	//hides the open/close button if height is 0
	if(h == 0){
		$(this).find(".toggle").css("display", "none");
	}
	
	//the open module function
	function open(){
		$(this).find(".bd").animate({
			height: h
		});
		$(this).unbind('click', open);
		$(this).bind('click', close);
	}
	
	//the close module function
	function close(){
		$(this).find(".bd").animate({
			height: 0
		});
		$(this).unbind('click', close);
		$(this).bind('click', open);
	}
	
	//Init the first click function
	$(this).bind('click', open);
});
