function index = timeplt_obj_index()
% TIMEPLT_OBJ_INDEX:  Determines cell index of current timeplt object.
%
% Not to be called from command line.


%
% If a callback was invoked, use gcbf to get the index.
% Otherwise use gcf.

%%%%%%%% Added by jpx for accomadating CMG TOOL
% if ( ~isempty(gcbf) )
%     current_figure = gcbf;
% 	x='first'
% else
%     current_figure = gcf;
% 	x='second'
% end
% 
% figure_tag = get ( current_figure, 'tag' );
%%%%%%%%%%%%%%%%%% jpx, 11/24/98 %%%%%%%%%%%%%%
figure_tag=get(gcf,'tag');
%
% The index is dependent upon the figure tag being of the
% form 'timeplt figure %d'.
[dud,rest] = strtok(figure_tag);
[dud,rest] = strtok(rest);
[index,rest] = strtok(rest);
index = str2num(index);
return;
