function analyze_correlation_between_successive_values(firstIPIs,psc_or_charge_array,casecolor,figure_addon,valuenamestr)
%description: designed for testing the hypothesis that the relation between the first and second PSCs/charges of a given sweep have a  relationship at a given IPI -- does the...
 %bouton state fluctuate on these time scales (larger precedes larger), or does depletion play a role (larger precedes smaller), at each IPI?
%called by: analyze_across_expts
%calls: [no custom functions]
%notes:
%code confirmed date: oct 8, 2009

markersize=4;

value_o=psc_or_charge_array(1,:);
value_a=psc_or_charge_array(2,:);

possible_intervals=[25 50 100 200 400];

for present_interval=1:length(possible_intervals)
    figure(figure_addon+present_interval),hold on
    good_uns=find(firstIPIs==possible_intervals(present_interval));
    if ~isempty(good_uns)
        x_vals=value_o(good_uns)/mean(value_o(good_uns));
        y_vals=value_a(good_uns)/mean(value_a(good_uns));
        plot(x_vals,y_vals,'o','markerfacecolor',casecolor,'markeredgecolor',casecolor,'markersize',markersize) 
        p=polyfit(x_vals,y_vals,1);
        plot([0 max(x_vals)],[p(2) p(2)+p(1)*max(x_vals)],'color',casecolor,'linewidth',.1)
        xlabel(strcat('Value1', valuenamestr))
        ylabel(strcat('Value2', valuenamestr))
        title(strcat(valuenamestr,num2str(possible_intervals(present_interval))))
	end
end