function doc(topic)
%DOC Loads hypertext documentation.
%
%	DOC topic loads the hypertext documentation for the specified topic.
%	DOC, by itself, loads the hypertext table of contents.
%
%       See also DOCOPT.

%	Brian M. Bourgault 1/22/94
%	Martin Knapp-Cordes 27-Apr-94
%	Copyright (c) 1984-94 by The MathWorks, Inc.
%
% Currently for UNIX platforms only
%
	if ~isunix
	    error(['Not yet available for this architectture: ', computer, '.'])
	end
%
	tpath = getenv('TOOLBOX');
        if isunix
%
% The unix command has a bunch of problems when we try to handle errors.
% Assume we submit to unix:
%
%	Mosiac file &
%
%    1. We don't know what shell is being used. It depends on the platform.
%    2. The unix command does not save stderr
%    3. You cannot save output since this blocks the return of the MATLAB
%	prompt.
%    4. You will always get the pid message and if there is a error message
%       it will be cryptic one from the system. 
%    5. Status is always successful.
%
% Because of the above problems, there is no error handling. The user
% will have to figure out things from the system error message.
%
	    [doccmd,options] = docopt;
	    if(nargin == 0)
		comm = [doccmd, ' ', options, ' ', tpath, '/*/doc/',  'ReferenceTOC', '.html', ' &' ];
	    else
		comm = [doccmd, ' ', options, ' ', tpath, '/*/doc/', topic, '.html', ' &' ];
	    end
%
            status = unix (comm);
	end
