﻿// JScript 文件

function PageGo(PageCount, strUrl)
{
    var regu = "^[0-9]+$";
    var re = new RegExp(regu);
    var Page = document.all.pageNo.value;
    if(Page == '')
    {
        alert("提示:请您请输入页码!");
		document.all.pageNo.focus();
		return false;
	}
	else if(!re.test(Page))
	{
		alert("提示:页码必须是整数!");
		document.all.pageNo.select();
		document.all.pageNo.focus();
		return false;
	}
	else if(parseInt(Page) < 1)
	{
		alert("提示:页码必须大于零!");
		document.all.pageNo.select();
		document.all.pageNo.focus();
		return false;
	}
	else if(parseInt(Page) > PageCount)
	{
		alert("提示:超过最大页码!");
		document.all.pageNo.select();
		document.all.pageNo.focus();
		return false;
	}
	else
	{
	   if(parseInt(Page) > 0)
	   {
	       document.location.href = strUrl + Page;
	   }
	   else
	   {
	       document.location.href = strUrl + PageCount;
	   }
	}
}