
// trundles our rates about
function slide_rates(div_n, frame_width, frame_count, direction) {
	// get div names
	div = "#slider_" + div_n;
	prev_div = "#prev_rates_" + div_n;
	next_div = "#next_rates_" + div_n;
	
	// get our current offset.
	current = $(div).position();
	current = current.left;
	
	// what the min and max offset could be
	min = 0;
	max = -1 * frame_width * (frame_count - 1);
	
	// previous
	if(direction == "prev") {
		moveto = Math.min(min, current + frame_width);
	}
	// next
	else {
		moveto = Math.max(max, current - frame_width);
	}
	
	// see about enabling/disabling their buttons
	if(moveto < min) {
		$(prev_div).addClass("prev_rates");
		$(prev_div).removeClass("prev_rates_disabled");
	}
	else {
		$(prev_div).addClass("prev_rates_disabled");
		$(prev_div).removeClass("prev_rates");
	}
	
	if(moveto > max) {
		$(next_div).addClass("next_rates");
		$(next_div).removeClass("next_rates_disabled");
	}
	else {
		$(next_div).addClass("next_rates_disabled");
		$(next_div).removeClass("next_rates");
	}
	
	// move if we're moving
	if(moveto != current) {
		$(div).animate({"left" : moveto}, "slow");
	}
}
