function checkdoor()
  {
	if (document.formQuery.t1.value.length < 3) {
		alert("请按顺序完整输入数码！")
		document.formQuery.t1.focus();
		return false;
	}
	if (document.formQuery.t2.value.length < 3) {
		alert("请按顺序完整输入数码！")
		document.formQuery.t2.focus();
		return false;
	}
	if (document.formQuery.t3.value.length < 4) {
		alert("请按顺序完整输入数码！")
		document.formQuery.t3.focus();
		return false;
	}
	if (document.formQuery.t4.value.length < 3) {
		alert("请按顺序完整输入数码！")
		document.formQuery.t4.focus();
		return false;
	}
	
	return true;
  }
  
  function NewDesktop(url1) {
	var windowconfig="status=0,scrollbars=0,resizable=0,left=160,top=100,width=465,height=330"; 
	var windowvar = window.open(url1, "", windowconfig);
  }
  
  function checkcode()
  {
    if (!checkdoor()) return;
    var vCode = formQuery.t1.value + formQuery.t2.value + formQuery.t3.value 
	          + formQuery.t4.value;
    for(i= 0; i<vCode.length; i++) 
    {
      if (!(vCode.charAt(i) >= '0' && vCode.charAt(i) <= '9'))
        break;
    }
    if (i < vCode.length)
      alert("数码中不能包含非数字的字符，请检查防伪数码。。");
    else
      NewDesktop("check.jsp?vCode="+vCode);
  }
  
  function checkdata(pID)
  {
    if(document.getElementById(pID).value.length<4)
    {
      alert("请按顺序完整输入数码!");
      document.getElementById(pID).focus();
      return;
    }
    if(pID=="t4")
    {
       var vCode = document.getElementById("t1").value + document.getElementById("t2").value + document.getElementById("t3").value 
	          + document.getElementById("t4").value;
    for(i= 0; i<vCode.length; i++) 
    {
      if (!(vCode.charAt(i) >= '0' && vCode.charAt(i) <= '9'))
        break;
    }
    if (i < vCode.length){
      alert("数码中不能包含非数字的字符，请检查防伪数码。。");
      return; }
    }
  }
  
  function checkdoor(pID)
{
//    if(document.getElementById(pID).value.length<3)
//    {
//      alert("请按顺序完整输入数码！");
//      document.getElementById(pID).focus();
//    }
    if(document.getElementById(pID).value.length==4)
    {
        if(pID=="t1")
           document.getElementById("t2").focus(); 
        else if(pID=="t2")
           document.getElementById("t3").focus();
        else if(pID=="t3") 
           document.getElementById("t4").focus();
        else
            document.getElementById("submit").focus();
    }
//	if (document.formQuery.t1.value.length < 3) {
//		alert("请按顺序完整输入数码！")
//		document.formQuery.t1.focus();
//		return false;
//	}
//	if (document.formQuery.t2.value.length < 3) {
//		alert("请按顺序完整输入数码！")
//		document.formQuery.t2.focus();
//		return false;
//	}
//	if (document.formQuery.t3.value.length < 4) {
//		alert("请按顺序完整输入数码！")
//		document.formQuery.t3.focus();
//		return false;
//	}
//	if (document.formQuery.t4.value.length < 3) {
//		alert("请按顺序完整输入数码！")
//		document.formQuery.t4.focus();
//		return false;
//	}
	
	return true;
  }