function [mode]=batchenable(mode)

%  batchenable

%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.                                                                      


%batchmode
%==============
batchmoderadio=findobj('tag','batchmoderadio');

%dir-mode
directoryradio=findobj('tag','directoryradio');
directorybutton=findobj('tag','directorybutton');
directorymonitor=findobj('tag','directorymonitor');

%batchfilemode
batchfileradio=findobj('tag','batchfileradio');
batchfilebutton=findobj('tag','batchfilebutton');
batchfilemonitor=findobj('tag','batchfilemonitor');

%searchmode
searchradio=findobj('tag','searchradio');
searchbutton=findobj('tag','searchbutton');
searchmonitor=findobj('tag','searchmonitor');
filterstringedit = findobj('tag','filterstringedit');
filterstringtext = findobj('tag','filterstringtext');
subdircheck = findobj('tag','subdircheck');

%singlefilemode
%==================
fileradio=findobj('tag','fileradio');
filebutton=findobj('tag','filebutton');
filemonitor=findobj('tag','filemonitor');



activitystatus=get(batchmoderadio,'Enable');

if get(batchmoderadio,'Value')==1
   set(directoryradio,'Enable','on');
   set(batchfileradio,'Enable','on');
   set(searchradio,'Enable','on');
   set(searchbutton,'Enable','off');
   set(batchfilebutton,'Enable','off');
   set(batchfileradio,'Value',0);
   set(directorybutton,'Enable','off');
   set(subdircheck ,'Enable','off');
   set(filebutton,'Enable','off');   
   set(fileradio,'Value',0);
   set(filterstringtext,'Enable','off');
   mode=1;
else
   set(directoryradio,'Enable','off');
   set(filterstringtext,'Enable','off');
   set(filterstringedit,'Enable','off');
   set(batchfileradio,'Enable','off');
   set(searchradio,'Enable','off');
   set(batchfilebutton,'Enable','off');
   set(directorybutton,'Enable','off');
   set(subdircheck ,'Enable','off');
   set(searchbutton,'Enable','off');
   set(batchfileradio,'Value',0);
   set(directoryradio,'Value',0);
   set(searchradio,'Value',0);
   set(filebutton,'Enable','on'); 
   set(fileradio,'Value',1);
	mode=2;   
end
return