function playbackdemo(demo_name)
%PLAYBACKDEMO  Launch demo playback device
%   This utility is used to launch playback demos.
%   PLAYBACKDEMO(DEMO_NAME)
%     DEMO_NAME = name of playback demo in 
%                 matlabroot/demos/.
%
%   For example:
%   playbackdemo('import')

%   $Revision: 1.6 $  $Date: 2000/09/04 04:58:24 $

REL_PATH = 'demos';

mlroot = matlabroot;

% Assemble file paths
html_file = strcat(fullfile(mlroot,REL_PATH,demo_name),'.html');

% Force to URL style file seperator
html_file = strrep(html_file,'\','/');

% Error out if the file doesn't exist
if exist(html_file,'file')==0
    errordlg(sprintf('Can''t find %s',html_file));
    return;
end

% If UNC path
if ispc & strncmp(html_file,'//',2)
   url = strcat('file:',html_file);
else
   url = html_file;
end

% Launch browser
evalc('stat = web(url,''-browser'');');
if (stat==2)
   errordlg(['Could not launch Web browser. Please make sure that'  sprintf('\n') ...
   'you have enough free memory to launch the browser.']);
elseif (stat)
   errordlg(['Could not load HTML file into Web browser. Please make sure that'  sprintf('\n') ...
   'you have a Web browser properly installed on your system.']);
end




