%function out = checkWorksiteFile(bstruct)
%  returns 0 if error, 1 if valid
function out = checkWorksiteFile(bstruct)

bdefault = behaviorDefaults;
worksite = bdefault{findin(bdefault,'name','worksite')};
fields = fields(worksite);

out = 1;
for jj=1:length(fields),
	if strcmp(fields{jj},'description'), continue
	elseif strcmp(fields{jj},'name'), continue
	elseif ~isfield(bstruct,fields{jj}),
		uiwait(msgbox(['mission{1}: missing field' ...
			fields{jj} '.'],'modal'))
		out = 0;
	elseif isempty(getfield(bstruct,fields{jj})),
		uiwait(msgbox(['mission{1}: ' fields{jj} ...
			' missing value.'],'modal'))
		out = 0;		
	elseif strcmp(getfield(bstruct,fields{jj}),'*'),
		uiwait(msgbox(['mission{1}: ' fields{jj} ...
			' missing value.'],'modal'))
		out = 0;			
	end
end
