<? if($nume >$limit){ ?>
<table style="clear: both;">
	<tr align="center" bgcolor="#f5f5f5" valign="bottom">
	  <td  height="20" colspan="12" bgcolor="#ffffff">&nbsp;
	  <? for($i=0; $i < $nume; $i=$i+$limit){	  
	  if($i == $eu){
	    $previous_button	=	$eu;
	    //$previous_button	= 	$previous_button-2;
	  	if($previous_button==0 ){
		  	$previous_button	=0;
	  	}
	  }
	}?>
	 	<? if(isset($previous_button) && $previous_button!='0'){ ?>
	    <a href="<?=$file_name?>?start=0<?=$next_page_condition;?>" class="aa">&lt; &lt first</a>&nbsp;&nbsp;
		<a href="<?=$file_name?>?start=<?=$previous_button-$limit;?><?=$next_page_condition;?>" class="aa">&lt;previous</a>&nbsp;&nbsp;&nbsp;
	   <? }?>
	   
	      <? $i=0;
		$l=1;
		for($i=0;$i < $nume;$i=$i+$limit){
			 if($i == $eu){
			  $next_button	=	$eu;
		  		//$previous_button	= 	$previous_button-2;
	  			if($next_button==$nume){
			  	$next_button	=$nume;
	  		}
		}
		
		
			if($i <> $eu){
				//echo " <a href='$file_name?start=$i$next_page_condition'><font face='Verdana' size='2' class='aa'>$l</font></a> | ";
				$last_page=$i;
			}
			else { 
				$display_pages = 5;
				if($l > $display_pages){
					echo "...";
					for($k=$l-$display_pages; $k<=$l-1; $k++){
						$page_next = ($k-1)*$limit;
						echo " <a href='$file_name?start=$page_next$next_page_condition'><font face='Verdana' size='2' class='aa'>$k</font></a> | ";
					}	
				}else{
					for($k=1; $k<$l; $k++){
						$page_next = ($k-1)*$limit;
						echo " <a href='$file_name?start=$page_next$next_page_condition'><font face='Verdana' size='2' class='aa'>$k</font></a> | ";
					}
				}
				echo "<font face='Verdana' size='4' color=red> $l </font>|";
				$last_diff = $nume-$i;
				if($last_diff > $limit){	
				for($k=$l+1; $k<=$l+$display_pages; $k++){
            //echo "last$nume last";
            if($k <= ceil($nume/$limit)){
						$page_next = ($k-1)*$limit;
						echo " <a href='$file_name?start=$page_next$next_page_condition'><font face='Verdana' size='2' class='aa'>$k</font></a> | ";
            }
					}
          if($k <= ceil($nume/$limit)){
					   echo "...";
          }
				}
			$next_button=$i;
			$last_page=$i;
			}       
		 
		$l=$l+1;
		}?>
		<? if(isset($next_button) && $next_button < $nume-$limit){ ?>
		 &nbsp;&nbsp;&nbsp; <a href="<?=$file_name?>?start=<?=$next_button+$limit;?><?=$next_page_condition;?>" class="aa">next&gt;</a>&nbsp;&nbsp;
		 <a href="<?=$file_name?>?start=<?=$last_page;?><?=$next_page_condition;?>" class="aa">last &gt;&gt;</a></div></td>
		 <? }?>
	  </tr></table>
	  <? }?>