function movinter(colors, isobaths)
%
% the function movinter(colors, isobaths) is used by the ARPRO
% software as an interface used to input the desired map limits
% the subroutine basemap will use to create a map to be overlayed 
% by float tracks, by the subroutine movie02.m
% The input strings colors and isobaths, determine what kind of
% map will be plotted: If
%   colors = 'yes',    the map will have yellow land and cyan sea
%                      and blue isobaths (if required).
%   colors = 'no ',    the map will have white land and black sea
%                      and yellow isobaths (if required). However,
%                      in printing, land and sea will exchange colors.
%   isobaths = 'yes',  there will be bathymetry included.
%   isobaths = 'no ',  there won't be bathymetry included.
%
%  Also, it allows the setting of the float tail's length (in days...)
%  
% -------------------------------------------------------------
%  Written by Vassilis Zervakis, in February 1996,
%             for AINCO - Interocean, Madrid, Spain
%  Modified by Mike Sparrow in Jan. '98
%--------------------------------------------------------------
%
global minlat maxlat minlon maxlon mapset
global taillength trailshow
global firstday firstmonth firstyear
global lastday lastmonth lastyear
h1 = figure('Name','Selecting Map Limits',...
            'NumberTitle','off',...
            'Menubar','none',...
            'Units','normalized',...
            'Position',[0.05 0.1 0.9 0.8],...
            'Color',[0.45 0.45 0.45]);
if mapset == [],
 minlat = 0
 maxlat = 0
 minlon = 0
 maxlon = 0
end
pos = [ .1, .69, .20, .05 ];
uimm(1) = uicontrol('style','text',...
                    'string','Minimum Latitude',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
uimm(2) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(minlat),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global minlat,',...
                    'minlat = str2num(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',[pos(1)+pos(3),pos(2),.08,pos(4)]);
pos = [ .4, .69, .20, .05 ];
uimm(3) = uicontrol('style','text',...
                    'string','Maximum Latitude',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
uimm(4) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(maxlat),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global maxlat,',...
                    'maxlat = str2num(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',[pos(1)+pos(3),pos(2),.08,pos(4)]);
pos = [ .1, .60, .20, .05 ];
uimm(5) = uicontrol('style','text',...
                    'string','Minimum Longitude',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
uimm(6) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(minlon),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global minlon,',...
                    'minlon = str2num(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',[pos(1)+pos(3),pos(2),.08,pos(4)]);
pos = [ .4, .60, .20, .05 ];
uimm(7) = uicontrol('style','text',...
                    'string','Maximum Longitude',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
uimm(8) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(maxlon),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global maxlon,',...
                    'maxlon = str2num(get(gco,''string''));'],...
                    'Units','normalized',...
                    'Position',[pos(1)+pos(3),pos(2),.08,pos(4)]);
pos = [0.71,0.75,0.1,0.05];
uimm(50) = uicontrol('style','pushbutton',...
                     'string','NE.Atlantic',...
                     'units','normalized',...
                     'Callback',['minlat = 20,',...
                                 'maxlat = 50,',...
                                 'minlon = -30,',...
                                 'maxlon = 0,',...
                                 'mapset = 1,',...
                                 'movinter(''',colors,''',''',isobaths,''')'],...
                     'Position',pos);
pos = [0.73,0.68,0.1,0.05];
uimm(51) = uicontrol('style','pushbutton',...
                     'string','NW.Atlantic',...
                     'units','normalized',...
                     'Callback',['minlat = 0,',...
                                 'maxlat = 60,',...
                                 'minlon = -100,',...
                                 'maxlon = -30,',...
                                 'mapset = 1,',...
                                 'movinter(''',colors,''',''',isobaths,''')'],...
                     'Position',pos);
pos = [0.75,0.61,0.1,0.05];
uimm(52) = uicontrol('style','pushbutton',...
                     'string','S.Atlantic',...
                     'units','normalized',...
                     'Callback',['minlat = -60,',...
                                 'maxlat = 0,',...
                                 'minlon = -70,',...
                                 'maxlon = 20,',...
                                 'mapset = 1,',...
                                 'movinter(''',colors,''',''',isobaths,''')'],...
                     'Position',pos);
pos = [0.77,0.54,0.1,0.05];
uimm(53) = uicontrol('style','pushbutton',...
                     'string','Mediterr.',...
                     'units','normalized',...
                     'Callback',['minlat = 30,',...
                                 'maxlat = 50,',...
                                 'minlon = -10,',...
                                 'maxlon = 40,',...
                                 'mapset = 1,',...
                                 'movinter(''',colors,''',''',isobaths,''')'],...
                     'Position',pos);

%
% ---- Determine the characteristics of plotting the ----------------
% ----   step on which we'll put symbols on the float tracks --------
pos = [ .1, .23, .3, .04 ];
taillength = 5.;
uimm(9) = uicontrol('style','text',...
                    'string',' Length of float tracks tail ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
% ----Determine the taillength---------------------------------------
pos(1) = pos(1) + pos(3);
pos(3) = 0.05;
uimm(10) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(taillength),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global taillength,',...
                    'taillength = str2num(get(gco,''string''))'],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.1;
uimm(11) = uicontrol('style','text',...
                    'string',' days',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
% ----Determine whether to leave the track's trail behind------------
pos(1) = pos(1) + pos(3) + 0.03;
pos(3) = 0.3;
uimm(12) = uicontrol('style','text',...
                    'enable','off',...
                    'string','Leave whole trail visible?',...
                    'BackgroundColor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.09;
trailshow = 'no ';
uimm(11) = uicontrol('style','popup',...
                    'enable','on',...
                    'string','no|yes',...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global trailshow,',...
                    'trailshow = setans(get(gco,''Value''))'],...
                    'Units','normalized',...
                    'Position',pos);
%
% ---- Determine the times of start of the movie-------------
pos = [ .1, .37, .3, .04 ];
firstday =  10;
firstmonth = 10;
firstyear  = 1995;
uimm(12) = uicontrol('style','text',...
                    'string',' Beginning of movie on the ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
% ----Determine the start --------------------------------------------
starttime = 0.;
pos(1) = pos(1) + pos(3);
pos(3) = 0.05;
uimm(13) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(firstday),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global firstday,',...
                    'firstday = str2num(get(gco,''string''))'],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.1;
uimm(14) = uicontrol('style','popup',...
                    'enable','on',...
                    'string','Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec',...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global firstmonth,',...
                    'firstmonth = get(gco,''Value'')'],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.08;
uimm(15) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(firstyear),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global firstyear,',...
                    'firstyear = str2num(get(gco,''string''))'],...
                    'Units','normalized',...
                    'Position',pos);
%
% ---- Determine the times of end   of the movie-------------
pos = [ .1, .30, .3, .04 ];
lastday =  1;
lastmonth = 1;
lastyear  = 1997;
uimm(16) = uicontrol('style','text',...
                    'string',' The end  of  movie on the ',...
                    'enable','off',...
                    'horizontalalignment','left',...
                    'backgroundcolor',[1 1 1],...
                    'Units','normalized',...
                    'Position',pos);
% ----Determine the start --------------------------------------------
pos(1) = pos(1) + pos(3);
pos(3) = 0.05;
uimm(17) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(lastday),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global lastday,',...
                    'lastday = str2num(get(gco,''string''))'],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.1;
uimm(18) = uicontrol('style','popup',...
                    'enable','on',...
                    'string','Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec',...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global lastmonth,',...
                    'lastmonth = get(gco,''Value'')'],...
                    'Units','normalized',...
                    'Position',pos);
pos(1) = pos(1) + pos(3);
pos(3) = 0.08;
uimm(19) = uicontrol('style','edit',...
                    'enable','on',...
                    'string',num2str(lastyear),...
                    'BackgroundColor',[.75 .75 .75],...
                    'Callback',['global lastyear,',...
                    'lastyear = str2num(get(gco,''string''))'],...
                    'Units','normalized',...
                    'Position',pos);
%----------READY TO PLOT ...------------------------------
%
pos = [ 0.1, 0.1, 0.2, 0.05 ];
uimm(20) = uicontrol('style','pushbutton',...
                    'string','Plot',...
                    'Units','normalized',...
                    'Position',pos,...
                    'Callback',['global isobathy isolines,',...
                                'if isolines ~= [],',...
                                '   isobath2,',...
                                'end,',...
                                'movie01(''',colors,''',''',isobaths,''')']);
pos = [ 0.4, 0.1, 0.2, 0.05 ];
uimm(21) = uicontrol('style','pushbutton',...
                    'string','Quit',...
                    'Units','normalized',...
                    'Position',pos,...
                    'Callback','close');
if isobaths == 'yes',
   global isolines
   setisoba;
end
