/*
Used in several pages for auto tab on phone number input. 
*/
function tabNext(ref) {
	var next;
	if(ref.value.length == 3) {
		if(ref.id.lastIndexOf('1') == ref.id.length-1) {
//	alert("index1 = " + ref.id.lastIndexOf('1') + " length = " + (ref.id.length-1));
		next = ref.id.replace(/1$/,"2");
		document.getElementById(next).focus();
		}else if(ref.id.lastIndexOf('2') != -1) {
//	alert("index2 = " + ref.id.lastIndexOf('2') + " length = " + (ref.id.length-1));
		next = ref.id.replace(/2$/,"3");
		document.getElementById(next).focus();
		}
  	}
}

