function buttonselectnorm(hObject, eventdata,emptybutton,Button,titles,Footnote,AFS,LockMode,AxesAFS, AxesSOL, EPSinfo,borg,one_x);

data = get(emptybutton,'UserData');

if isfield(data,'ismatrix')==0 || data.ismatrix == 0 
    set(Footnote,'String',' Warning, no data has been loaded.','ForegroundColor','red');
    return;
end

[m,n]=size(data.Draw);
data.Borgen=get(borg,'Value');
%  data.scalBorg=data.Borgen;

data.polygon=0;
data.isafs=0;

 
 if data.Borgen == 1
     set(titles(2),'String','Generalized Borgen plot - RS-scaling');
   if min(min(data.D0))>-1.0e-14 && min(size(data.Sraw))>3 && data.Sraw(4,4)<1.0e-12
    
         minD=0;
    else
    minD=min(min(data.D_scal));
    if minD<0
        minD=min(-10^(-8),minD);
    end
    if abs(minD)<1.0e-14
        minD=0;
    end
    end
    
    
    data.EPSd=minD;
    set(EPSinfo(2),'String',[num2str(0)]);
    
    if minD>=0
        set(EPSinfo(1),'String',[' min(A): ',num2str(0)]);
        set(EPSinfo(3),'String',[num2str(0)]);
        data.EPSa=0;
        data.EPSa=0;
        
        
    else
        set(EPSinfo(1),'String',[' min(A): ',num2str(minD)]);
        minD=ceil(-minD*10^6)/10^6;
        data.EPSa=minD;
        data.EPSc=0.000001;
        minA=max([minD 1e-4]);
        set(EPSinfo(3),'String',[num2str(minA)]);
        set(EPSinfo(2),'String',[num2str(1e-8)]);
    end
   
    
 else
     set(titles(2),'String','Generalized Borgen plot - FSV-scaling');
     
    if min(min(data.D0))>-1.0e-14 && min(size(data.Sraw)) > 3 &&data.Sraw(4,4)<1.0e-12
    
         minD=0;
    else
    minD=min(min(data.Dtrunc));
    if minD<0
        minD=min(-10^(-8),minD);
    end
    if abs(minD)<1.0e-14
        minD=0;
    end
    end
     data.EPSd=minD;
    set(EPSinfo(2),'String',[num2str(0)]);
    data.EPSc=0;
    if minD>=0
        set(EPSinfo(1),'String',[' min(A): ',num2str(0)]);
        set(EPSinfo(3),'String',[num2str(0)]);
        data.EPSa=0;
        data.EPSa=0;


    else
        set(EPSinfo(1),'String',[' min(A): ',num2str(minD)]);
        minD=ceil(-minD*10^6)/10^6;
        data.EPSa=minD;
        data.EPSc=0.000001;
        minA=max([minD 1e-4]);
        set(EPSinfo(3),'String',[num2str(minA)]);
        set(EPSinfo(2),'String',[num2str(1e-8)]);
    end
 end
onoffButton_BKP(Button,1:3,4:8);
onoffButton_BKP(AFS,[],1:3);
onoffButton_BKP(LockMode,[],2:5);
hold(AxesAFS,'off');
plot(AxesAFS,0,0,'w');   

hold(AxesSOL,'off');
plot(AxesSOL,1,0,'w');
 set(emptybutton,'UserData',data);
