function buttonselectrotCA4(hObject, eventdata, Empty_Button, AxesC, AxesA, AxesSOLC, AxesSOLA, uonoff, uonoffC, plotopt, lvText, lvSlider, lcs, rotonoff, type)

data = get(Empty_Button,'UserData');

if type == 1
    if max(data.afscomputed) == 0
        set(rotonoff(1),'Value',0);
        set(rotonoff(2),'Value',1);
        
        rotate3d off;
%         rotate3d(AxesC,'off')
%         rotate3d(AxesA,'off')
    else
        
        if get(rotonoff(1),'Value') == 1
            rotate3d on;
%             rotate3d(AxesC,'on')
%             rotate3d(AxesA,'on')
        else
            rotate3d off;
%             rotate3d(AxesC,'off')
%             rotate3d(AxesA,'off')
        end
    end
    
else
    
    bn = get(rotonoff(1),'Value');
    bf = get(rotonoff(2),'Value');
    
    data = get(Empty_Button,'UserData');
    
    if data.isdata*data.isnmf*max(data.afscomputed) == 0
        set(rotonoff(1),'Value',0);
        set(rotonoff(2),'Value',1);
    end
    
%     axes(AxesAFS);
    if (get(rotonoff(1),'Value') == 1) && (data.islv == 0)
        Mouse3D_modifiedCA4(0,hObject, eventdata, Empty_Button, AxesC, AxesA, AxesSOLC, AxesSOLA, uonoff, uonoffC, plotopt, lvText, lvSlider, lcs);
        data.islv = 1;
        data.is3dmouse = 1;
    elseif (get(rotonoff(2),'Value') == 1) && (data.islv == 1)
        Mouse3D_modifiedCA4(5,hObject, eventdata, Empty_Button, AxesC, AxesA, AxesSOLC, AxesSOLA, uonoff, uonoffC, plotopt, lvText, lvSlider, lcs);
        data.islv = 0;
        data.is3dmouse = 0;
    end
    
    set(Empty_Button,'UserData',data);
end
