﻿function ChangePage(PageNo, ContentId, PageNoId, Direction, ParentId, PageCount, PageSize,CurrentPageNo) {
    if (PageNo != "") {
        CurrentPageNo = PageNo;
    }
    if (Direction == "R") {
        CurrentPageNo = CurrentPageNo + 1;
        if (CurrentPageNo > PageCount) {
            CurrentPageNo = PageCount;
        }
    }
    else {
        CurrentPageNo = CurrentPageNo - 1;
        if (CurrentPageNo <= 0) {
            CurrentPageNo = 1;
        }
    }
    $('#' + PageNoId).html(CurrentPageNo);
    $('#' + ContentId).load('download.ashx', { currentpage: CurrentPageNo, Ps_id: ParentId, PSize: PageSize }, function (responseText, textStatus, XMLHttpRequest) { $("#" + ContentId).html(responseText) });
}


