<%
	def totalPage = uicomponent.getAvailablePage();
	def currentPage = uicomponent.getCurrentPage();
%>

<div class="UIPaginatorDefault">

  <%if(currentPage > 1) { %>
	  <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","1")%>" class="First">&nbsp;</a>			
  <% } else { %>
	  <a class="FirstDis">&nbsp;</a>			
  <%}%>
  <% if( currentPage - 1 > 0 ){%>        
      <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","${currentPage - 1}")%>" class="Prev">&nbsp;</a>
  <% } else {%>
	  <a class="PrevDis">&nbsp;</a>
  <%}%>
  
  <%
  int min = 1;
  int max = totalPage;
  if(totalPage > 5 && currentPage > 2){
    min = currentPage - 2;
    max = currentPage + 3;
    if (max > totalPage) max = totalPage;
  } else if( totalPage > 5 && currentPage < 3 ){
    min = 1;
    max = 6;
  }
  for( i in min..max) { %>
  <%  if( i == currentPage) { %>
	    <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","$i")%>" class="Item Current"><%=i%></a>
  <%  } else { %>
	    <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","$i")%>" class="Item"><%=i%></a>
  <%  } %> 
  <%}%>    
  
  <% if(currentPage + 1 <= totalPage) { %>
       <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","${currentPage + 1}")%>" class="Next">&nbsp;</a>	
  <% } else { %>
	   <a class="NextDis">&nbsp;</a>
  <%}%>
  <% if(currentPage < totalPage) {%>        
       <a href="javascript:void(0);" onclick="<%=uicomponent.event("ShowPage","$totalPage")%>" class="Last">&nbsp;</a>					        	  
  <% } else {%>
	   <a class="LastDis">&nbsp;</a>
  <% }%>    	    
  
</div>
