function buttonresetCA4(hObject, eventdata, Empty_Button, Buttons, Footnote, AxesC, AxesA, AxesSOLC, AxesSOLA, titles, uonoff, uonoffC, typeAFS, plotopt, lvText, lvSlider, lcs)
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.actx = [];
data.lv.lastStart = [];
data.lvC.lastStart = [];

data.islv = 0;
if data.is3dmouse
    Mouse3D_modifiedCA4(5,hObject, eventdata, Empty_Button, AxesC, AxesA, AxesSOLC, AxesSOLA, uonoff, uonoffC, plotopt, lvText, lvSlider, lcs);
    data.is3dmouse = 0;
end

data.isFP = 0;
data.isIP = 0;

data.FIRPOLA = [];
data.FIRPOLC = [];
data.INNPOLA = [];
data.INNPOLC = [];

data.isnmf = 0;
data.afscomputed = [0; 0; 0];
data.selectplot = [0; 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 = [];

for i=2:4
    set(uonoff(i), 'Value', 0);
    set(uonoffC(i), 'Value', 0);
end
set(uonoff(1), 'Value', 1);
set(uonoffC(1), 'Value', 1);

set(hObject, 'Enable','off');

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

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);
