
//--------------------------------------------------
//  °Ë»öÃ³¸®
//--------------------------------------------------
function gfn_fgoPage(page) { 
    with(document.listForm){ 
        spage.value= page; 
        target = "_self";  
        action = self.location; 
        submit(); 
    } 
}   

//--------------------------------------------------
//  ÆäÀÌÁö ÀÌµ¿
//--------------------------------------------------
function gfn_fnList(page) { 
    gfn_fgoPage(page); 
}   

//--------------------------------------------------
//  ÆäÀÌÁö¸¦ È­¸é¿¡ Ãâ·Â
//--------------------------------------------------
function gfn_printPageNum(totalCount,printNum,rowNum,curPage){ 
	if (totalCount==0){ 
    } else { 
      var totalPageCnt = Math.ceil(totalCount / rowNum); 
      var sHtml = gfn_getPageNav(totalPageCnt,printNum,curPage); 
      document.all['pages'].innerHTML = sHtml;    
    } 
}

//--------------------------------------------------
//  Æú´õ¸íº¯°æ
//--------------------------------------------------
function gfn_getPageNav(totalPageCnt,printNum,curPage) {  

    var iStart= curPage - Math.ceil(printNum / 2)+1; 
    var iEnd = curPage + Math.ceil(printNum / 2)-1; 
  
    if (iStart  < 1) { 
        iStart = 1; 
        iEnd  = printNum; 
    } 
  
    if (iEnd  > totalPageCnt) { 
        iEnd = totalPageCnt; 
        iStart = ((iEnd - printNum+1) < 1 ) ? 1 : iEnd - printNum+1; 
    } 
 
    var sHtml = ""; 
    if ((iStart != 1) && (totalPageCnt>=iEnd)) { 
        var ibefore = iStart - 1 ;
        if (ibefore < 1) ibefore = 1;
        sHtml += "<a href='javascript:gfn_fnList(1)'>Ã³À½</a>&nbsp;";   
        sHtml += "<a href='javascript:gfn_fnList(" + ibefore + ")'>ÀÌÀü</a>";
    } 
    for(var i=iStart; i<= iEnd; i++) { 
        if(curPage== i) { 
            sHtml += "<a href='javascript:gfn_fnList(" + i + ")' class='bar'><span class='current'>" + i + "</span></a>"; 
        } else { 
            sHtml += "<a href='javascript:gfn_fnList(" + i + ")' class='bar'>" + i + "</a>"; 
        } 
    } 
    if ((iEnd != totalPageCnt) && (totalPageCnt>iEnd)) { 
        var inext = iEnd + 1 ;
        if (inext > totalPageCnt) ibefore = totalPageCnt;
        sHtml += "<a href='javascript:gfn_fnList(" + inext + ")' class='bar'>´ÙÀ½</a>&nbsp;";    
        sHtml += "<a href='javascript:gfn_fnList(" + totalPageCnt + ")'>¸¶Áö¸·</a>";  
    } 
    return sHtml; 
}

/*-------------------------------------------------- 
* End
*--------------------------------------------------*/ 