function auto_tab(current_id, next_id) {
	if ($('#' + current_id).val().length == $('#' + current_id).attr('maxlength'))
		$('#' + next_id).focus();
}

$(document).ready(function() {
	var id;
	var root;
	
	$('.phone_number').focus(function(){
		id = $(this).attr('id');  	
		if (id.charAt(id.length - 1) == '1') {
			root = id.substring(0, id.length - 1);
			$('#' + root + '1').keyup(function() {auto_tab(root + '1', root + '2');});
			$('#' + root + '2').keyup(function() {auto_tab(root + '2', root + '3');});
		}
	});
});
