function buttonresetCAA(hObject, eventdata, Empty_Button, Buttons, Footnote, AxesC, AxesA, AxesSOLC, AxesSOLA, titles, uonoff, uonoffC, regcont, regcontC, typeAFS)
data = get(Empty_Button,'UserData');

if data.isdata == 0
    return;
end

data.afsC = [];
data.afsA = [];
data.motion = 0;
data.motionC = 0;

data.isAFSC = 0;
data.isAFSA = 0;
data.AFSC = [];
data.AFSA = [];
data.istrace = 0;

data.fixA = [];
data.fixC = [];
data.choosen = zeros(3,1);
data.choosenC = zeros(3,1);

data.isnmf = 0;
data.afscomputed = [0; 0];
data.selectplot = [0; 0];

data.givenc.s = 0;
data.givenc.is = 0;
data.givenc.line = [];
data.givenc.afs = [];

data.givena.s = 0;
data.givena.is = 0;
data.givena.line = [];
data.givena.afs = [];

set(typeAFS(1), 'Value', 0);
set(typeAFS(2), 'Value', 0);
set(typeAFS(3), 'Value', 0);

data.full.isC = 0;
data.full.isA = 0;

data.full.AFSC = [];
data.full.AFSA = [];

data.xlc = [];
data.ylc = [];
data.xla = [];
data.yla = [];

data.regcon = 0;
data.regconC = 0;

data.isregcon = zeros(1,3);
data.isregconC = zeros(1,3);

data.REGCON = [];
data.REGCONC = [];

set(uonoff(1), 'Value', 1);
set(uonoffC(1), 'Value', 1);
set(regcont(1), 'Value', 1);
set(regcontC(1), 'Value', 1);

onoffButton(Buttons,[],3:6);
set(hObject, 'Enable','off');

set(titles(3), 'String', 'AFS factor C');
set(titles(4), 'String', 'AFS factor S');

plot(AxesC,1,0,'w');
plot(AxesA,1,0,'w');
plot(AxesSOLC,1,0,'w');
plot(AxesSOLA,1,0,'w');

set(Footnote,'String','Memory has been freed')

set(Empty_Button,'UserData',data);
