%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function bstruct = removeDefaults(bstruct)
[bdefaults,bnames] = behaviorDefaults;
index = findin(bdefaults,'name',bstruct.name);
if index == 0, return, end
def = bdefaults{index};
fields = fieldnames(def);
values = mystruct2cell(def);
for i=1:length(fields),
	if ~isempty(values{i}) & ~strcmp(fields{i},'name') & isfield(bstruct,fields{i}),
		if compare(values{i},getfield(bstruct,fields{i})),
			bstruct = rmfield(bstruct,fields{i});
		end
	end
end
