function varargout=btnctrl(Action,BtnHandle)
%BTNCTRL Button manipulation function

%   Loren Dean
%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.15 $ $Date: 1997/11/21 23:49:14 $

Map=get(get(BtnHandle(1),'Parent'),'Colormap');
CData=get(BtnHandle,{'UserData'});

if strcmp(lower(Action),'on'),
  MapOffset=0;
else
  MapOffset=size(Map,1)/2;
end

for CLp=1:length(BtnHandle),    
  CData{CLp}=uint8(double(CData{CLp})+MapOffset);      
  CData{CLp}=gnrlfun('Ind2RGB',CData{CLp},Map);
end % for CLp

set(BtnHandle,{'CData'},CData,'Enable',Action);  

