function corrmenu(chid,csta,loc);

[nchid,nt] = size(chid);
stmonitr
width = width_cc*1.4;

height_1 = height_cc_1;
height = (nt+4)*height_1;
if(nargin < 3)
  loc = loc_cc;
end
rect_fig = [loc width height ];
hCorrMenu = figure('Position',rect_fig);
k = 0;
rect_0 = [ width*.075 (nt-k)*height_1+5 width*.125 height_1*.7];
rect_1 = [ width*.225 (nt-k)*height_1+5 width*.3 height_1*.7];
rect_2 = [ width*.65 (nt-k)*height_1+5 width*.125 height_1*.7];
rect_3 = [ width*.79 (nt-k)*height_1+5 width*.19 height_1*.7];
uicontrol('style','text',...
	'position',rect_0,...
	'string','IND',...
        'FontWeight','demi')
uicontrol('style','text',...
	'position',rect_1,...
	'string','CH/STA',...
        'FontWeight','demi')
uicontrol('style','text',...
	'position',rect_2,...
	'string','DEP',...
        'FontWeight','demi')
uicontrol('style','text',...
	'position',rect_3,...
	'string','GIVEN',...
        'FontWeight','demi')
for k=1:nt
   rect = [ width*.1 (nt-k)*height_1+5 width*.5 height_1*.8];
   rect_2 = [ width*.65 (nt-k)*height_1+5 width*.125 height_1*.8];
   rect_3 = [ width*.85 (nt-k)*height_1+5 width*.125 height_1*.8];

  name = [csta(:,k)' '  ' chid(:,k)' ];
  h1(k) = uicontrol('style','checkbox', ...
     'parent',hCorrMenu,...
     'position',rect,...
     'string',name,...
     'FontWeight','demi',...
     'value',0,...
     'tag','IND',...
     'userData',k,...
     'callback','SetCorCh');
      
  h2(k) = uicontrol('style','checkbox', ...
     'parent',hCorrMenu,...
     'position',rect_2,...
     'string','',...
     'value',0,...
     'tag','DEP',...
     'userData',k,...
     'callback','SetCorCh');
  h3(k) = uicontrol('style','checkbox', ...
     'parent',hCorrMenu,...
     'position',rect_3,...
     'string','',...
     'value',0,...
     'tag','GIVEN',...
     'userData',k,...
     'callback','SetCorCh');

end  %  loop over channels 1:nt

rect = [ width*.1 (nt+2.6)*height_1+5 width*.8 height_1*.8];
h_plot = uicontrol('style','pushbutton', ...
   'parent',hCorrMenu,...
   'position',rect,...
   'string','PLOT',...
   'FontWeight','demi',...
   'callback','Cor_plot');
        
rect = [ width*.1 (nt+1.5)*height_1+5 width*.8 height_1*.8];
h_add = uicontrol('style','pushbutton',...
   'parent',hCorrMenu,...
   'position',rect,...
   'string','ADD',...
   'FontWeight','demi',...
   'enable','off',...
   'tag','ADD',...
   'callback','CorrAdd');

set(gcf,'Name','Multiple and Partial Correlation');

