if ~exist('sea', 'var')
   sea = 1;
   ConSeaStr='Remove Seawifs';
elseif sea > 0
   ConSeaStr='Show Seawifs';
   sea = 0;
else 
   sea=1;
   ConSeaStr='Remove Seawifs';
end;

if exist('chlfig','var')
   
   try
      close(chlfig);
   catch
      fprintf('');
   end;
   
   
end;

chlfig=figure;
    
    if ~exist('sea','var')
      ConSeaStr='Show Seawifs';
   end;
   
   if get(boxprod(3),'value')==1
   [ax,hyy1,hyy2]=plotyy(Y.t,Y.Morel,Y.t,Y.Depth);
   set(ax(1),'XTickLabel','','XTick',[]);

   set(ax(2),'XTickLabel','');
   set(ax(2),'XLim',([min(Y.t),max(Y.t)]),'YLim',([10 30]),'YTick',[10:5:30],'YDir','reverse','XTickLabel','','XTick',dates);
   set(hyy2,'LineWidth',2);
   ChlLeg=('Mooring Calc');
	hold on;
   end
   
   if get(boxprod(4),'value')==1&get(boxprod(3),'value')==0
      plot(Y.t,Y.Morel,'go','Markersize',4)
      hold on;
      ChlLeg=('Mooring Calc');
   end;
   
   
   if get(boxprod(5),'value')==1
      plot(Y.t,Y.Morelf,'ro','Markersize',4)
      hold on;
      
      if exist('ChlLeg','var') 
         ChlLeg=strvcat(ChlLeg,'Mooring AvgDepth Calc');
      else
         ChlLeg='Mooring AvgDepth Calc';
      end;
      
   end;
   
   if exist('sea','var')&sea>0
      plot(Y.t,Y.SeaChl,'bo','Markersize',4);
      ChlLeg=strvcat(ChlLeg,'SeaWif Chl');
   end;

   
   set(gca,'YLim',([0 1.5]));
   ylabel('mg/m^3','Fontweight','bold','Fontsize',8)
	axis([(min(Y.t)-3) (max(Y.t)+3) 0 1.5])
	for j=1:(length(deploy_dates))
      if get(boxprod(6),'value')==1
         plot(deploy_dates(j),Ctd_Chl(j),'gs','MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',8,'LineWidth',1.5)
         
         if j==1
            ChlLeg=strvcat(ChlLeg,'CTD Chlorophyll');
         end;
         
      end;

      plot([deploy_dates(j) deploy_dates(j)],[0 1.5],'k','Linewidth',2);
      
            
     	if j<=(length(deploy_dates)-1)      
         text(deploy_dates(j),(1.5*1.025),num2str(Prr600(j)),'Fontsize',8);
      end;
      
	end;
	 
	set(gca,'YGrid','on','XGrid','on','YTick',([0:0.25:1.5]),'XTick',dates,'XTickLabel',datestr(dates,2));
	titl=sprintf('%s Chl490',upper(p(1:3)));
   title(titl,'Fontweight','bold','Fontsize',8,'position',[mean(X.t) (1.5*1.025) 17.3205]);
   legend(gca,ChlLeg,2);
   
%    if get(boxprod(3),'value')==1
%       ylabel('Depth','Fontweight','bold','Fontsize',8)
%    end;
%    

   
   clear ChlLeg;
   
set(chlfig,'Position',([3 29 1022 702]));
conSeawif=uicontrol(chlfig,'string',ConSeaStr,'Callback','Seawif','Position',([45 675 100 20]));
end;
