function iduital(window,cb)
%IDUITAL Callback for 'Title and Labels' menu item. 
%       Toggles title off and on.

%	L. Ljung 9-27-94
%	Copyright (c) 1986-95 by the MathWorks, Inc.
%	$Revision: 1.7 $  $Date: 1995/05/02 16:32:08 $

global XIDplotw
if nargin<2,cb='set';end
hax1=findobj(get(XIDplotw(window,1),'children'),'flat',...
             'tag','axis1','vis','on');
t1=get(hax1,'title');x1=get(hax1,'xlabel');y1=get(hax1,'ylabel');
hax2=findobj(get(XIDplotw(window,1),'children'),'flat',...
             'tag','axis2','vis','on');
if ~isempty(hax2)
    t2=get(hax2,'title');x2=get(hax2,'xlabel');y2=get(hax2,'ylabel');
else
    t2=[];x2=[];y2=[];
end
eval('chns=get(XIDplotw(window,3),''userdata'');','')


if strcmp(cb,'tog')
   men=get(gcf,'Currentmenu');
   onoff=get(men,'checked');   
   if strcmp(onoff,'off')
      set(men,'checked','on')
      set([t1,t2,x1,x2,y1,y2],'vis','on')
   else
      set(men,'checked','off')
      set([t1,t2,x1,x2,y1,y2],'vis','off')
   end

else

if any(window==[1,14])
    set(y1,'string',['Output # ',int2str(chns(1))]);
    set(t1,'string','Input and output signals');
    if  ~isempty(hax2),
       set(y2,'string',['Input # ',int2str(chns(2))]);
       set(x2,'string','Time');
       set(x1,'string','     ');
    else
       set(x1,'string','Time');
    end

elseif window==2
    usd=get(XIDplotw(2,2),'userdata');
    if eval(usd(3,:))==1,
       xtext=['Frequency (rad/s)'];
    else 
       xtext=['Frequency (Hz)'];
    end
    set(t1,'string',['Frequency response']);
    set(y1,'string',['Amplitude']);
    set(x2,'string',xtext);
    set(t2,'string','')
    set(y2,'string','Phase (deg)')

elseif window==3
    usd=get(XIDplotw(3,2),'userdata');
    predh=deblank(usd(1,:));if strcmp(predh,'[]'),predh=int2str(5);end
    if eval(usd(4,:))==0
       if eval(usd(2,:))==2
          tt=['Measured and ',predh,' step predicted output'];
       else    
          tt=['Measured and simulated model output'];
       end
    else
       if eval(usd(2,:))==2
          tt=['Measured minus ',predh,' step predicted output'];
       else
          tt=['Measured minus simulated model output'];
       end
    end
    set(t1,'string',tt);
    set(x1,'string','Time');

elseif window==4
    set(t1,'string','Poles (x) and Zeros (o)')

elseif window==5
    usd=get(XIDplotw(5,2),'userdata');
    if eval(usd(3,:))==1
       tt='Step Response';
    else
       tt='Impulse Response';
    end
    set(t1,'string',tt);
    set(x1,'string','Time');
elseif window==6
    set(t1,'string',...
       ['Autocorrelation of residuals for output ',int2str(chns(1))]);
    if ~isempty(hax2)
       set(t2,'string',...
       ['Cross corr for input ',int2str(chns(2)),...
          'and output ',int2str(chns(1)),' resids']);
      set(x2,'string','Samples')
      set(x1,'string','        ')
    else
      set(x1,'string','Samples') 
    end
elseif window==7    
    usd=get(XIDplotw(7,2),'userdata');
    if eval(usd(3,:))==1,
       xtext=['Frequency (rad/s)'];
    else 
       xtext=['Frequency (Hz)'];
    end
    set(t1,'string',['Power Spectrum']);
    set(x1,'string',xtext);

elseif any(window==[13,15])
    usd=get(XIDplotw(window,2),'userdata');
    if eval(usd(5,:))==2
       met='Periodogram';
    else
       met='Spectrum estimate';
    end
    if eval(usd(3,:))==1,
       xtext=['Frequency (rad/s)'];
    else 
       xtext=['Frequency (Hz)'];
    end
    set(t1,'string',[met]);
    set(y1,'string',['Output # ',int2str(chns(1))]);
    if  ~isempty(hax2),
       set(y2,'string',['Input # ',int2str(chns(2))]);
       set(x2,'string',xtext);
       set(x1,'string','           ');
    else
       set(x1,'string',xtext);
    end
elseif window==9
    set(t1,'string','Model Fit vs # of par''s');
    set(x1,'string','# of par''s')
    set(y1,'string','% Unexplained of output variance')
end
end
