<div class="black_block">
<form METHOD="POST" class="cinline" id="list_reload" action="<?php echo $_SERVER['REQUEST_URI'];?>">
<select class="cinline" name="list_numb" onchange="javascript:document.getElementById('list_reload').submit();">
<?php
for($k=3;$k<10;$k++){
	echo "<option";
	if ($k == $cur_list_numb) {echo " selected";}
	echo ">" . $k . "</option>";
}
?>
</select></form>
<span id="result_bar">
Всего: <?php echo $z; ?></span>
<?php 
$_GET['l'] = intval($_GET['l']);
$window_cur = 0;
if (isset($_GET['u'])){}else{$_GET['u'] = 1;}

if (isset($_GET['l'])){
	$zz = intval(($_GET['l'])/($cur_list_numb*6))*$cur_list_numb*6 + 1;
}else{ $zz=1; }
if ($_GET['l'] >= $cur_list_numb){
	echo "<a class='a_black2' href='javascript:document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").setAttribute(" . chr(34) . "action" . chr(34) . ", " . chr(34) . $_SERVER['SCRIPT_NAME'] . "?";
	if ($_GET['p']>100){echo "p=" . $_GET['p'] . "&";}
	echo "u=" . $_GET['u'];
	if (isset($_GET['tag'])){ echo "&tag=" . $_GET['tag'];}
	echo "&l=" . ($_GET['l']-$cur_list_numb) . "#fchangedirect" . chr(34) . ");document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").submit();'>пред</a> ";
}
if (intval(($_GET['l'])/($cur_list_numb*6))>0){
	echo "<a class='a_black2' href='javascript:document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").setAttribute(" . chr(34) . "action" . chr(34) . ", " . chr(34) . $_SERVER['SCRIPT_NAME'] . "?";
	if ($_GET['p']>100){echo "p=" . $_GET['p'] . "&";}
	echo "u=" . $_GET['u'];
	if (isset($_GET['tag'])){ echo "&tag=" . $_GET['tag'];}
	echo "&l=" . (($_GET['l']/($cur_list_numb*6) - 1)*$cur_list_numb*6) . "#fchangedirect" . chr(34) . ");document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").submit();'>&lt;&lt;</a>";}

for($ztmp = $z - intval(($_GET['l'])/($cur_list_numb*6))*$cur_list_numb*6; $ztmp>$cur_list_numb; $ztmp-=$cur_list_numb){
if ($zz==($_GET['l']+1)){
	echo $zz . "-" . ($zz + $cur_list_numb - 1) . "&nbsp;";
}else{
	echo "<a class='a_black2' href='javascript:document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").setAttribute(" . chr(34) . "action" . chr(34) . ", " . chr(34) . $_SERVER['SCRIPT_NAME'] . "?";
	if ($_GET['p']>100){echo "p=" . $_GET['p'] . "&";}
	echo "u=" . $_GET['u'];
	if (isset($_GET['tag'])){ echo "&tag=" . $_GET['tag'];}
	echo "&l=" . ($zz - 1) . "#fchangedirect" . chr(34) . ");document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").submit();'>[" . $zz . "-" . ($zz + $cur_list_numb - 1) . "]</a>&nbsp;";
}
$zz+=$cur_list_numb;
++$window_cur;
if ($window_cur>5){break;}
}
if ($zz==($_GET['l']+1)){
echo "[" . $zz . "-" . ($zz + $cur_list_numb - 1) . "]&nbsp;";
}else{
	echo "<a class='a_black2' href='javascript:document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").setAttribute(" . chr(34) . "action" . chr(34) . ", " . chr(34) . $_SERVER['SCRIPT_NAME'] . "?";
	if ($_GET['p']>100){echo "p=" . $_GET['p'] . "&";}
	echo "u=" . $_GET['u'];
	if (isset($_GET['tag'])){ echo "&tag=" . $_GET['tag'];}
	echo "&l=" . ($zz - 1) . "#fchangedirect" . chr(34) . ");document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").submit();'>[" . $zz . "-" . ($zz + $cur_list_numb - 1) . "]";
	if ($window_cur>5){echo "&gt;&gt;";}
	echo "</a>&nbsp;";
}
if ($_GET['l'] + $cur_list_numb <= $z){
	echo "<a class='a_black2' href='javascript:document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").setAttribute(" . chr(34) . "action" . chr(34) . ", " . chr(34) . $_SERVER['SCRIPT_NAME'] . "?";
	if ($_GET['p']>100){echo "p=" . $_GET['p'] . "&";}
	echo "u=" . $_GET['u'];
	if (isset($_GET['tag'])){ echo "&tag=" . $_GET['tag'];}
	echo "&l=" . ($_GET['l']+$cur_list_numb) . "#fchangedirect" . chr(34) . ");document.getElementById(" . chr(34) . "fchangedirect" . chr(34) . ").submit();'>след</a> ";
}
?>
</div>
