global BNT_HOME
if (~exist ('BNT_HOME'))
    error ('Please define the global BNT_HOME before running add_BNT_and_SLP.');
end

folders = {'BNT', 'BNT/CPDs', ...
	'BNT/general', 'BNT/inference', 'BNT/inference/dynamic', ...
	'BNT/inference/online', 'BNT/inference/static', 'BNT/learning', 'BNT/potentials', ...
	'BNT/potentials/Tables', ...
	'BNT/examples/dynamic', 'BNT/examples/dynamic/HHMM', 'BNT/examples/dynamic/HHMM/Map', ...
	'BNT/examples/dynamic/HHMM/Mgram', 'BNT/examples/dynamic/HHMM/Motif',...
	'BNT/examples/dynamic/HHMM/Square','BNT/examples/dynamic/SLAM', ...
	'BNT/examples/limids', 'BNT/examples/static', ...
	'BNT/examples/static/Belprop', 'BNT/examples/static/Brutti', ...
	'BNT/examples/static/dtree', 'BNT/examples/static/fgraph', 'BNT/examples/static/HME', ...
	'BNT/examples/static/Misc', 'BNT/examples/static/Models', 'BNT/examples/static/SCG', ...
	'BNT/examples/static/StructLearn', 'BNT/examples/static/Zoubin', ...
	'graph', 'GraphViz', 'Kalman', ...
	'HMM', 'KPMstats', 'KPMtools', ...
	'netlab3.3', 'netlabKPM'};

if length(strfind(path,'BNT'))==0
	currentdir = pwd;
	cd(BNT_HOME)
	for f=1:length(folders)
		path(path,fullfile(pwd,folders{f}));
	end%for
	cd(currentdir)
end%if

global SLP_HOME
if exist('SLP_HOME','var')~=1
	error ('Please define the global SLP_HOME before running add_BNT_and_SLP.');
end%if

folders = {'learning','scoring','misc','examples','datas','working'};
if length(strfind(path,'bnt-slp'))==0
	currentdir = pwd;
	cd(SLP_HOME)
	path(path,pwd);
	for f=1:length(folders)
		path(path,fullfile(pwd,folders{f}));
	end%for
	cd(currentdir)
end%if