var downStrokeField;
function autojump(fieldName,nextFieldName,fakeMaxLength)
{
	var myForm=document.forms[document.forms.length - 1];
	var myField=myForm.elements[fieldName];
			myField.nextField=myForm.elements[nextFieldName];
	if (myField.maxLength == null)
	myField.maxLength=fakeMaxLength;
	myField.onkeydown=autojump_keyDown;
	myField.onkeyup=autojump_keyUp;
}
function autojump_keyDown()
{
	this.beforeLength=this.value.length;
	downStrokeField=this;
}
function autojump_keyUp()
{
	if (
 		(this == downStrokeField) && 
 		(this.value.length > this.beforeLength) && 
 		(this.value.length >= this.maxLength)
 	)
 	this.nextField.focus();
	downStrokeField=null;
}

//check if it's numeric
function ValidNumber(thestring)
{
    for (i = 0; i < thestring.length; i++) {
        ch = thestring.substring(i, i+1);
        if (ch < "0" || ch > "9")
          {
          alert("The phone number fields must be numeric!");
          return false;
          }
    }
    return true;
}
