function [url, loaddodsbool, infotext, times, depths, ...
      lats, lons, num_url] = focusnbu ...
         (getarchive, getranges, getmode, getvariablelist, ...
	 getserverlist, passtimes, passdepths, whichurl)
     
%
%    This function will build focusnb file name and return infotext and url to the browser
%

% The preceding empty line is important
% $Log: focusnbu.m,v $
% Revision 1.4  2000/03/17 08:49:48  dbyrne
%
%
% Fixed a lot of bugs & klugdes.  -- dbyrne 00/03/17
%
% Revision 1.3  2000/02/24 17:12:52  kwoklin
% *** empty log message ***
%
% Revision 1.2  2000/01/12 18:51:14  kwoklin
% Second checkup.  klee
%

% $Id: focusnbu.m,v 1.4 2000/03/17 08:49:48 dbyrne Exp $
% klee 11/10/99

if exist(getarchive) == 2   
  eval(getarchive)
else
  dodsmsg('Metadata not found!')
  return
end

url = []; infotext = []; text = []; Constraint = ''; loaddodsbool = 1;
URLdate = [];

sectors = passdepths(whichurl);
URLsector = ['&sec=',num2str(sectors)];

year = num2str(passtimes(whichurl,1));
month = num2str(day2mon(year, passtimes(whichurl,2)));
URLdate = sprintf('%s','&month=',month,'&year=',year);
Constraint = [Constraint, URLsector, URLdate]; 

%variablelist = ...
%    ['month,year,sec,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24,s25,s26,s27,s28,s29,s30,s31,s32,s33,s34,s35,s36,s37,s38,s39,s40,s41,s42,s43,s44,s45,s46,s47,s48,s49,s50,TOTAL'];

% construct a variablelist string to add to constraint:
variablestr = '';
for i = 1:size(getvariablelist,1)-1
  variablestr = [variablestr sprintf('%s,', ...
	deblank(getvariablelist(i,:)))];
end
variablestr = [variablestr sprintf('%s', ...
      deblank(getvariablelist(i+1,:)))];

% construct the full URL
url = [Server, '?', variablestr, Constraint];

infotext = sprintf('%s\n\n%s\n\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n\n%s',...
                 ['The plus sign on the browser map marks the center position of ',...
                  'each sector.'],...
                 ['The sector number corresponds to the sectors code ',...
                  'in NBDS system is as the following:'],...
                 ['sector 1  -> GB,  Greenwich Bay'],...
                 ['sector 2  -> UNB, Upper Narragansett Bay'],...
                 ['sector 3  -> MHB, Mt. Hope Bay'],...
                 ['sector 4  -> UWP, Upper West Passage'],...
                 ['sector 5  -> UEP, Upper East Passage'],...
                 ['sector 6  -> SAK, Sakonnet River'],...
                 ['sector 7  -> LWP, Lower West Passage'],...
                 ['sector 8  -> LEP, Lower East Passage'],...
                 ['sector 9  -> SAK, Sakonnet River'],...
                 ['sector 10 -> RIS, RI Sound'],...
                 ['For more geographical information, please look up the ',...
                  'Metadata Point of Contact']);
return