% GUIbutton
% Function for the MODIS GUI
% Copyright by Jasmine S Nahorniak, Oregon State University. 
% Mar 20 2000

function GUIbutton(tag,string,state);


buttonh=findobj(gcf,'Tag',tag);
if isempty(buttonh),
   mainfig=findobj('Name','MODIS GUI');
   buttonh=findobj(mainfig,'Tag',tag);
end

if state(1:2)=='on',   % highlight button 
  set(buttonh,'String',string,'ForegroundColor','r','BackgroundColor','y');
  set(gcbf,'Pointer','watch');
else   % return to normal
  set(buttonh,'String',string,'ForegroundColor','k', ...
  'BackgroundColor',[0.7 0.7 0.7]);
  set(gcbf,'Pointer','arrow') 
end

pause(0.2)
