function refresh_show_calls(varargin)


handles=varargin{1};
hObject=varargin{2};


cfac=handles.prefs.showcallthresh;
cfac

set(handles.Pgwrt,'String',strcat(int2str(handles.screen_no),'/',int2str(handles.no_of_screens)))

TypeString = [{'Other'};{'Null'};{'A'};{'B'};{'C'};{'D'};{'E'};{'F'};{'G'};{'H'}];
StgStuff = TypeString(handles.sct_var);

call_types = '';
run_once = 1;

for n = 1:size(StgStuff,1)
    if n ~= size(StgStuff,1)
        call_types = strcat(call_types, StgStuff{n},' ,');
    else
        call_types = strcat(call_types, StgStuff{n});
    end
end

set(handles.SCTwrt,'String',call_types)

if size(handles.axes_assn,2)==16
    for k=1:16
        axes(handles.AH(k));
        cla;    
        %k
        if handles.axes_assn(k)-handles.start_no>size(handles.disp_data,1)    
            axis off;
            title('')
            set(handles.AH(k),'Visible','off');
        else
            
            handles.file_no=handles.disp_data((handles.screen_no-1)*16+k,3);
            handles.samp_start=handles.disp_data((handles.screen_no-1)*16+k,1);
            handles.samp_end=handles.disp_data((handles.screen_no-1)*16+k,2);
            
            [wave.wf,wave.fs] = wavread(strcat(handles.prefs.paths{handles.file_no},...
                handles.prefs.filenames{handles.file_no}),[handles.samp_start handles.samp_end]);
            [wave.spec, wave.freqint, wave.sampint] = specgram(wave.wf);
            wave.spec=abs(wave.spec);
            
            imagesc([0 (handles.samp_end-handles.samp_start)/wave.fs],[0 wave.fs/2],-wave.spec,[-cfac 0]);
            axis xy; colormap(gray);
            set(handles.AH(k),'fontsize',8)
            type_disp = handles.data_class(handles.axes_assn(k));
            TypeString = [{'Other'};{'Null'};{'A'};{'B'};{'C'};{'D'};{'E'};{'F'};{'G'};{'H'}];
            CallTypeString = TypeString(type_disp);
            if type_disp==2;
                title(strcat(int2str(handles.axes_assn(k)),': ',CallTypeString),'fontweight','bold','color',[1 0 0 ]);
            else
                title(strcat(int2str(handles.axes_assn(k)),': ',CallTypeString),'fontweight','bold');
            end
        end
    end    
else
    for k=1:16
        if k<=size(handles.axes_assn,2)
            axes(handles.AH(k));
            cla;  
            if (handles.screen_no-1)*16+k>size(handles.disp_data,1)    
                axis off;
                title('')
                set(handles.AH(k),'Visible','off');
            else               
                handles.file_no=handles.disp_data((handles.screen_no-1)*16+k,3);
                handles.samp_start=handles.disp_data((handles.screen_no-1)*16+k,1);
                handles.samp_end=handles.disp_data((handles.screen_no-1)*16+k,2);
                
                [wave.wf,wave.fs] = wavread(strcat(handles.prefs.paths{handles.file_no},...
                    handles.prefs.filenames{handles.file_no}),[handles.samp_start handles.samp_end]);
                [wave.spec, wave.freqint, wave.sampint] = specgram(wave.wf);
                wave.spec=abs(wave.spec);
                
                imagesc([0 (handles.samp_end-handles.samp_start)/wave.fs],[0 wave.fs/2],-wave.spec,[-cfac 0]);
                axis xy; colormap(gray);
                set(handles.AH(k),'fontsize',8)
                type_disp = handles.data_class(handles.axes_assn(k));
                TypeString = [{'Other'};{'Null'};{'A'};{'B'};{'C'};{'D'};{'E'};{'F'};{'G'};{'H'}];
                CallTypeString = TypeString(type_disp);
                if type_disp==2;
                    title(strcat(int2str(handles.axes_assn(k)),': ',CallTypeString),'fontweight','bold','color',[1 0 0 ]);
                else
                    title(strcat(int2str(handles.axes_assn(k)),': ',CallTypeString),'fontweight','bold');
                end
            end
        else
            axes(handles.AH(k));
            cla;
            axis off;
            title('')
            set(handles.AH(k),'Visible','off');
            guidata(hObject,handles);
        end
    end  
end