function renamefenster(filename,filepath,mode)

%   renamefenster

%   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.                                                                      

ppfig=findobj('tag','ppfig');
ppunits=get(ppfig,'units');
set(ppfig,'units','normalized');
pppos=get(findobj('tag','ppfig'),'position');
set(ppfig,'units',ppunits);




%figure
%---------------
figure1=figure('units','normalized','position',[pppos(1)     pppos(2)+pppos(4)     0.24664     0.17057],'units','normalized',...
'color',[0.4        0.55         0.7],'Name','file rename options:','Numbertitle','off','Resize','on','Menubar','none','units','normalized');

%text8
%----------------
text8= uicontrol('units','normalized','style','text',...
'position',[0.40127     0.61538     0.22611     0.13609],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text8',...
'String','Find files by:',...
'HorizontalAlignment','left');

%findedit
%----------------
findedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.61538      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','findedit',...
'HorizontalAlignment','center');

%findstringedit
%----------------
findstringedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.45562      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','findstringedit',...
'HorizontalAlignment','center');

%replaceedit
%----------------
replaceedit= uicontrol('units','normalized','style','edit',...
'position',[0.6465     0.29586      0.3121     0.13609],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','replaceedit',...
'HorizontalAlignment','center');







%logicpopup
%----------------
logicpopup= uicontrol('units','normalized','style','popupmenu',...
'position',[0.51274     0.81065     0.44904     0.13018],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',1,...
'tag','logicpopup',...
'String',{'contains','does not contain','is equal','is unequal','ends with'},...
'HorizontalAlignment','left');

%findtypepopup
%----------------
findtypepopup= uicontrol('units','normalized','style','popupmenu',...
'position',[0.041401     0.81065     0.43631     0.12426],...
'backgroundcolor',[1  1  1],...
'foregroundcolor',[0  0  0],...
'Value',1,...
'tag','findtypepopup',...
'String',{'filename','extension','version'},...
'HorizontalAlignment','center');

%inclsubdirradio
%----------------
inclsubdirradio= uicontrol('units','normalized','style','radiobutton',...
'position',[0.041401     0.60947     0.34395     0.14201],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','inclsubdirradio',...
'String','include subdir',...
'HorizontalAlignment','center');

%cancelbutton
%----------------
cancelbutton= uicontrol('units','normalized','style','pushbutton',...
'position',[0.044586    0.071006     0.56369     0.16568],...
'backgroundcolor',[0.83137     0.81569     0.78431],...
'foregroundcolor',[0  0  0],...
'Callback','close',...
'Value',0,...
'tag','cancelbutton',...
'String','Cancel',...
'HorizontalAlignment','center');

%copyreplaceradio
%----------------
copyreplaceradio= uicontrol('units','normalized','style','radiobutton',...
'position',[0.041401     0.43787     0.33758     0.14201],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','copyreplaceradio',...
'String','Copy & replace',...
'HorizontalAlignment','center');

%pushbutton1
%----------------
pushbutton1= uicontrol('units','normalized','style','pushbutton',...
'position',[0.63057    0.076923     0.33758     0.15976],...
'backgroundcolor',[0.83137     0.81569     0.78431],...
'foregroundcolor',[0  0  0],...
'Callback','renamemanage(filename,filepath,mode)',...
'Value',0,...
'tag','pushbutton1',...
'String','Replace',...
'HorizontalAlignment','center');

%text2
%----------------
text2= uicontrol('units','normalized','style','text',...
'position',[0.39809     0.28402     0.24204     0.12426],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text2',...
'String','Replace with:',...
'HorizontalAlignment','left');

%text1
%----------------
text1= uicontrol('units','normalized','style','text',...
'position',[0.40127      0.4497     0.22611     0.13609],...
'backgroundcolor',[0.4        0.55         0.7],...
'foregroundcolor',[0  0  0],...
'Value',0,...
'tag','text1',...
'String','Find-String:',...
'HorizontalAlignment','left');