$.fn.equals = function(compareTo) {
        if (!compareTo || !compareTo.length || this.length!=compareTo.length)
{
                return false;
        }
        for (var i=0; i<this.length; i++) {
                if (this[i]!==compareTo[i]) {
                        return false;
                }
        }
        return true;
} 

$(document).ready(function($) {
		var whichOne = $('#menu');
       $('.collapse').hide();
       $('.stuff').click(function(){
       		if(whichOne.equals($(this))){
       			$('.collapse').slideUp();
       			$(this).parent().next().next().next().slideDown();
         		whichOne = $(this).parent().next().next().next();
            }else{
	            $('.collapse').slideUp();
	            $(this).parent().next().slideDown();
	            whichOne = $(this);

            }
			return false;
       });
});
