﻿function doCritCode(field,crit,msg)
{
	if ( (-1!=crit) )
	{
		alert(msg)
		if (crit==1)
		{
			field.focus();  // focus does not work on certain netscape versions
			field.select();
		}
	}
}
function is_int(field,crit,msg){
	var Ret = true;
	var NumStr="0123456789";
	var chr;
    if (field.value.length==0)
    {
		Ret=false;
    }
	for (i=0;i<field.value.length;++i)
	{
		chr=field.value.charAt(i);
		if (NumStr.indexOf(chr,0)==-1)
		{
			Ret=false;
		}
	}
	if (!Ret)
		doCritCode(field,crit,msg);
	return(Ret);
}
 function dogopage(){
  var strjump
   if (!is_int(document.all("gopage"),1,"页码必须为数字！")){
      return false
   }
   if (parseInt(document.all("gopage").value)>parseInt(document.all("pagecount").value) || parseInt(document.all("gopage").value)<1){
     if (parseInt(document.all("pagecount").value)>0) {
     alert("页码必须在1--"+document.all("pagecount").value+"之间!")
     }
     return false
   }
   strjump=document.all("jumpurl").value+"?page="+document.all("gopage").value
   if (document.all("getfield").value.length>0){
      strjump+="&amp;"+document.all("getfield").value
   }
   window.location.assign(strjump)
 }