﻿// 페이징 기능        총 행수  ,  사이즈, 현재행, 이동페이지, 파라메타
function getPaging(TotalCount, PageSize, Page, PageName, Param) 
{                 
	var strPaging = "";

	var TotalPage = Math.ceil(TotalCount / PageSize);
	var FirstPage = parseInt((Page - 1) / 10) * 10 + 1;
	var LastPage = (parseInt((Page - 1) / 10) + 1) * 10;
	LastPage = LastPage > TotalPage ? TotalPage : LastPage;
	
    strPaging = "<span class=\"paging\">";
	
	if (Page > 10)
		strPaging += "<a href=\"" + PageName + "?pPage=" + ( Number(FirstPage) - 1 ) + Param + "\" title=\"이전목록\" class=\"prevList\"><img src=\"../images/navi/ico_prevlist.gif\" alt=\"이전목록\"  /></a>";
    else
        strPaging += "<a href='#' title='이전목록' class='prevList'><img src='../images/navi/ico_prevlist.gif' alt='이전목록' /></a>";

	if (Page > 1)
		strPaging += "<a href=\""  + PageName + "?pPage=" + ( Number(Page) - 1 ) + Param +  "\" title=\"이전\" class=\"prev\"><img src=\"../images/navi/ico_prev.gif\" alt=\"이전목록\" /></a>";
    else
         strPaging += "<a href='#' title='이전' class='prev'><img src='../images/navi/ico_prev.gif' alt='이전목록' /></a>";

	for (var i = FirstPage; i <= LastPage; i++) 
	{
		if (Page == i)
		{
			strPaging += "<a href=\"#\" class=\"select\">" + i + "</a>";
		}
		else
		{
			strPaging += "<a href='" + PageName + "?pPage=" + i +  Param + "' >" + i + "</a>";
		}
	}
	
	if (Page < TotalPage) 
		strPaging += "<a href=\"" + PageName + "?pPage=" + ( Number(Page) + 1 ) + Param + "\" title=\"다음\" class=\"nex\"><img src=\"../images/navi/ico_next.gif\" alt=\"다음\" /></a>";
    else
        strPaging += "<a href='#' title='다음' class='next'><img src='../images/navi/ico_next.gif' alt='다음' /></a>";

	if (LastPage < TotalPage)
		strPaging +="<a href=\""  + PageName + "?pPage=" + ( Number(LastPage) + 1 ) + Param + "\" title=\"다음목록\" class=\"nextList\"><img src=\"../images/navi/ico_nextlist.gif\" alt=\"다음목록\" /></a>";
    else
        strPaging += "<a href='#' title='다음목록' class='nextList'><img src='../images/navi/ico_nextlist.gif' alt='다음목록' /></a>";

	strPaging += "</span>";

	return strPaging;
}

/// 페이징 기능        총 행수  ,  사이즈, 현재행, 이동페이지, 파라메타
function getPaging2(TotalCount, PageSize, Page, PageName, Param) 
{                 
	var strPaging = "";

	var TotalPage = Math.ceil(TotalCount / PageSize);
	var FirstPage = parseInt((Page - 1) / 10) * 10 + 1;
	var LastPage = (parseInt((Page - 1) / 10) + 1) * 10;
	LastPage = LastPage > TotalPage ? TotalPage : LastPage;

	if (Page > 10)
		strPaging += "<a href=\"" + PageName + "?pPage=" + ( Number(FirstPage) - 1 ) + Param + "\" title=\"이전목록\" class=\"prevList\"><img src=\"../images/navi/ico_prevlist.gif\" alt=\"이전목록\"  /></a>";
    else
        strPaging += "<a href='#' title='이전목록' class='prevList'><img src='../images/navi/ico_prevlist.gif' alt='이전목록' /></a>";

	if (Page > 1)
		strPaging += "<a href=\""  + PageName + "?pPage=" + ( Number(Page) - 1 ) + Param +  "\" title=\"이전\" class=\"prev\"><img src=\"../images/navi/ico_prev.gif\" alt=\"이전목록\" /></a>";
    else
         strPaging += "<a href='#' title='이전' class='prev'><img src='../images/navi/ico_prev.gif' alt='이전목록' /></a>";

	for (var i = FirstPage; i <= LastPage; i++) 
	{
		if (Page == i)
		{
			strPaging += "<a href=\"#\" class=\"select\">" + i + "</a>";
		}
		else
		{
			strPaging += "<a href='" + PageName + "?pPage=" + i +  Param + "' >" + i + "</a>";
		}
	}
	
	if (Page < TotalPage) 
		strPaging += "<a href=\"" + PageName + "?pPage=" + ( Number(Page) + 1 ) + Param + "\" title=\"다음\" class=\"nex\"><img src=\"../images/navi/ico_next.gif\" alt=\"다음\" /></a>";
	else
        strPaging += "<a href='#' title='다음' class='next'><img src='../images/navi/ico_next.gif' alt='다음' /></a>";

	if (LastPage < TotalPage)
		strPaging +="<a href=\""  + PageName + "?pPage=" + ( Number(LastPage) + 1 ) + Param + "\" title=\"다음목록\" class=\"nextList\"><img src=\"../images/navi/ico_nextlist.gif\" alt=\"다음목록\" /></a>";
    else
        strPaging += "<a href='#' title='다음목록' class='nextList'><img src='../images/navi/ico_nextlist.gif' alt='다음목록' /></a>";

	return strPaging;
}
// 페이징 기능        총 행수  ,  사이즈, 현재행, 이동페이지, 파라메타
function getPaging3(TotalCount, PageSize, Page, PageName, Param, ParamName) 
{                 
	var strPaging = "";

	var TotalPage = Math.ceil(TotalCount / PageSize);
	var FirstPage = parseInt((Page - 1) / 10) * 10 + 1;
	var LastPage = (parseInt((Page - 1) / 10) + 1) * 10;
	LastPage = LastPage > TotalPage ? TotalPage : LastPage;
	
    strPaging = "<span class=\"paging\">";
	
	if (Page > 10)
		strPaging += "<a href=\"" + PageName + "?" + ParamName + "=" + ( Number(FirstPage) - 1 ) + Param + "\" title=\"이전목록\" class=\"prevList\"><img src=\"../images/navi/ico_prevlist.gif\" alt=\"이전목록\"  /></a>";
	else
        strPaging += "<a href='#' title='이전목록' class='prevList'><img src='../images/navi/ico_prevlist.gif' alt='이전목록' /></a>";


	if (Page > 1)
		strPaging += "<a href=\""  + PageName + "?" + ParamName + "=" + ( Number(Page) - 1 ) + Param +  "\" title=\"이전\" class=\"prev\"><img src=\"../images/navi/ico_prev.gif\" alt=\"이전목록\" /></a>";
    else
         strPaging += "<a href='#' title='이전' class='prev'><img src='../images/navi/ico_prev.gif' alt='이전목록' /></a>";


	for (var i = FirstPage; i <= LastPage; i++) 
	{
		if (Page == i)
		{
			strPaging += "<a href=\"#\" class=\"select\">" + i + "</a>";
		}
		else
		{
			strPaging += "<a href='" + PageName + "?" + ParamName + "=" + i + Param + "' >" + i + "</a>";
		}
	}
	
	if (Page < TotalPage) 
		strPaging += "<a href=\"" + PageName + "?" + ParamName + "=" + ( Number(Page) + 1 ) + Param + "\" title=\"다음\" class=\"nex\"><img src=\"../images/navi/ico_next.gif\" alt=\"다음\" /></a>";
	else
        strPaging += "<a href='#' title='다음' class='next'><img src='../images/navi/ico_next.gif' alt='다음' /></a>";


    if (LastPage < TotalPage)
		strPaging += "<a href=\""  + PageName + "?" + ParamName + "=" + ( Number(LastPage) + 1 ) + Param + "\" title=\"다음목록\" class=\"nextList\"><img src=\"../images/navi/ico_nextlist.gif\" alt=\"다음목록\" /></a>";
    else
        strPaging += "<a href='#' title='다음목록' class='nextList'><img src='../images/navi/ico_nextlist.gif' alt='다음목록' /></a>";

	strPaging += "</span>";
	
	return strPaging;
}

-->
