$.fn.collapse = function(){
	return this.each(function(){
		var $this = $( this );
		$( this ).bind( 'click', function(){
			var n = $this.attr( 'id' ).replace( '-header', '-body' );
			$( '#' + n ).slideToggle( 'slow' );
		});
	});
};

$.fn.toggleSitemap = function(){
	return this.each(function( i ){
		var $this = $( this );
		var tocollapse = $( '.tocollapse' );

		$( this ).bind( 'click', function(){
			var $t = $( tocollapse[i] );
			$t.slideToggle( 'slow' );
		});
	});
}
