function AutoNextField(txtval, nextfield , flag)
{
	if (flag == 't3' || flag == 't4'){
		if (txtval.length == 4){
			nextfield.focus();
		}
	}else{
		if (txtval.length == 3)
		{
			nextfield.focus();
		}
	}
}

function isn(str)
{

  var checkOK = "0123456789";
  var checkStr = str;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
	return (false);
  }
  return (true);
}

function go(theForm){
	var strAll = theForm.T1.value + theForm.T2.value + theForm.T3.value + theForm.T4.value;

	if (strAll.length == 0){
		alert("请输入产品序列号!");
		return (false);
	}
	if (!isn(strAll))
	{
	    alert("您不能输入带有字母的物品序号!");
		return (false);
	}
	if (strAll.length < 14){
	    alert("您输入的序号不够14位!");
		return (false);
	}
	return (true);
}

