/**
 * author : zww
 * date : 2004-8-11
 */

/**
 * form 表单
 * pageNo 翻页页码
 */
function goPage(form, pageNo) {
//	alert(pageNo) ;
//	if(!isInteger(pageNo)) {
//		alert("请输入一个有效的数字作为页数!");
//		return false;
//	}
	if(pageNo < 1) {
		alert("最小页码为1");
		form.PAGE_gopage.focus();
		return;
	}
	//判断form是否有此属性
	if(form.pageCurrent) {
	    form.pageCurrent.value = pageNo;
	}
	form.submit();
}

//向页面打印出分页的操作显示部分
function drawDispartPageView(formName, pageCurrent, pageCount, rowCount)
{
    var docW = "共<font color='red'>" + rowCount + "</font>记录&nbsp;第" + pageCurrent + "/" + pageCount + "页&nbsp;";
	if(pageCurrent > 1) {
		docW = docW + "<a href='javascript:goPage(" + formName + ", 1)'>首页</a>&nbsp;";
        docW = docW + "<a href='javascript:goPage(" + formName + ", " + (pageCurrent - 1) + ")'>上一页</a>&nbsp;";
	}
	else {
		docW = docW + "首页&nbsp;";
		docW = docW + "上一页&nbsp;";
	}
	if(pageCurrent < pageCount) {
		docW = docW + "<a href='javascript:goPage(" + formName + ", " + (pageCurrent + 1) + ")'>下一页</a>&nbsp;";
        docW = docW + "<a href='javascript:goPage(" + formName + ", " + pageCount + ")'>尾页</a>&nbsp;";
	}
	else {
		docW = docW + "下一页&nbsp;";
        docW = docW + "尾页&nbsp;";
	}
    docW = docW + "跳转到 <input type='text' size='3' name='PAGE_gopage' class='inputtext' value=''>&nbsp;";
    docW = docW + "<a href='javascript:goPage(" + formName + ", " + formName + ".PAGE_gopage.value)'>GO</a>&nbsp;";
//    alert(docW);
    document.write(docW);
}

function drawDispartPageView1(formName, pageCurrent, pageCount, rowCount)
{
    var docW = "共<font color='red'>" + rowCount + "</font>记录&nbsp;第" + pageCurrent + "/" + pageCount + "页&nbsp;";
	if(pageCurrent > 1) {
		docW = docW + "<a href='javascript:goPage(" + formName + ", 1)'>首页</a>&nbsp;";
        docW = docW + "<a href='javascript:goPage(" + formName + ", " + (pageCurrent - 1) + ")'>上一页</a>&nbsp;";
	}
	else {
		docW = docW + "首页&nbsp;";
		docW = docW + "上一页&nbsp;";
	}
	if(pageCurrent < pageCount) {
		docW = docW + "<a href='javascript:goPage(" + formName + ", " + (pageCurrent + 1) + ")'>下一页</a>&nbsp;";
        docW = docW + "<a href='javascript:goPage(" + formName + ", " + pageCount + ")'>尾页</a>&nbsp;";
	}
	else {
		docW = docW + "下一页&nbsp;";
        docW = docW + "尾页&nbsp;";
	}
    docW = docW + "跳转到 <input type='text' size='3' name='PAGE_gopage1' class='inputtext' value=''>&nbsp;";
    docW = docW + "<a href='javascript:goPage(" + formName + ", " + formName + ".PAGE_gopage1.value)'>GO</a>&nbsp;";
//    alert(docW);
    document.write(docW);
}