(function($) {

	var hidden = true;
 
   $.fn.foldList = function() {
     this.each(function() {
     
     	var thi = this;

		$(this).children(".csc-header:first").css("cursor", "pointer");
     
     	$(this).children(".csc-header:first").click(function(){
     	
     		$(thi).children("div.folditem").each(function(){

				if (hidden) {
     				$(this).children().show();
					hidden = false;
				}
				else
				{
					$(this).children().hide();
					hidden = true;
				}

     		});
	});
    
	$(this).children("div.folditem").each(function(){
		$(this).children().hide();
	});
	
	
	
     });
 
     return this;
 
   };
 
})(jQuery);

jQuery(function($){
	$(".foldinglist").foldList();
});
