function autoTab(current,to, len) {
	var strNewText = current.value;
	var bInteger = false;
	var i;
	if(0 == strNewText.length) {
		return true;
	}
	bInteger = isInteger(strNewText);
	while(false == bInteger)
	{
		strNewText = strNewText.substring(0, strNewText.length - 1);
		if(0 == strNewText.length) {
			bInteger = true;
		} else {
			bInteger = isInteger(strNewText);
		}
	}
	current.value = strNewText;
	if (strNewText.length==len) {
		to.focus() 
	}
	return true;
}

function isInteger (s) { 
	var reInteger = /^\d+$/;
	if(0 == s.length) {
		return false;
	}
	return reInteger.test(s)
}

function validateForm() {
	var strZipCode = frm_signup.txt_zip_code.value.replace(/[^0-9]/gi, "");
	var strAreaCode = frm_signup.txt_area_code.value.replace(/[^0-9]/gi, "");
	var strCityCode = frm_signup.txt_city_code.value.replace(/[^0-9]/gi, "");
	var strPhoneSuffix = frm_signup.txt_phone_suffix.value.replace(/[^0-9]/gi, "");
	var bValid = false;
	frm_signup.ni_visit.value="";
	bValid = false;
	bValid = isInteger(strAreaCode);
	if((true != bValid) || (3 != strAreaCode.length))
	{
		alert("This mobile number is not properly formatted.");
		frm_signup.txt_area_code.focus();
		return false; //Validation failure
	}
	bValid = isInteger(strCityCode);
	if((true != bValid) || (3 != strCityCode.length))
	{
		alert("This mobile number is not properly formatted.");
		frm_signup.txt_city_code.focus();
		return false; //Validation failure
	}
	bValid = isInteger(strPhoneSuffix);
	if((true != bValid) || (4 != strPhoneSuffix.length))
	{
		alert("This mobile number is not properly formatted.");
		frm_signup.txt_phone_suffix.focus();
		return false; //Validation failure
	}
	//Validate the correct number of digits, and ensure that the the five digits are the only text in the field
	if (strZipCode != frm_signup.txt_zip_code.value || strZipCode.length != 5)
	{
		alert("Please enter a 5-digit zip code.");
		frm_signup.txt_zip_code.focus();
		return false; //Validation failure
	}
	//Validation success
	frm_signup.ni_visit.value="1";
	return true;
}