<table  width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td width="75%" valign="top">

<?
$maxRows_Recordset1=$rru['ob_na_str'];
$pn = 0;
if (isset($_GET['pn'])) 
	{
	$pn = intval($_GET['pn']);
	}
 
$uri=$_SERVER['REQUEST_URI'];
$uri=str_replace("&pn=".$pn, "", $uri);
$uri=str_replace("param_pn=".$pn, "", $uri);
$uri=str_replace("%5B", "[", $uri);
$uri=str_replace("%5D", "]", $uri);

if($id_firm)
$zmm='/_'.$id_firm.'/';
else
$zmm='/magazin/';

$uri2=explode("param_", $uri);

$startRow_Recordset1 = $pn * $maxRows_Recordset1;
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connect) or die(mysql_error());
$row_Recordset1 = mysql_fetch_array($Recordset1);

if($query_group==1)
	{
	$rm = mysql_query($query_count);
	if($rm)
		{
		if($arr_catalog['catalog'])
			{
			$zamena = $zmm.$arr_catalog['url'].'_'.$arr_catalog['id_catalog'];
			}
		elseif (isset($_GET['id_catalog']))
			{
			$zamena = $zmm.'all_0';
			}
		else
			{
			$zamena = $zmm;
			$zamena_2 = '/all_0/';
			}
			
		echo '<table width=100% cellpadding="2" cellspacing="2">';
	 	$i=0;
		while ($rrm = mysql_fetch_array($rm))
	 		{
			if(!$i) echo '<tr valign=top>';
			echo '<td width=33%>';
	 		//$arrw[$rrm[1]]=$rrm[0];
			if(!$zamena_2)
			echo '<a href="'.(str_replace($zamena, $zmm.$arr_razdel_url[intval($id_catalog)][$rrm[1]].'_'.$rrm[1], $uri)).'">'.$arr_razdel[intval($id_catalog)][$rrm[1]].'</a><span style="color:#858585">, '.$rrm[0].'</span><br>';
			else
			echo '<a href="'.(str_replace($zamena, $zmm.$arr_razdel_url[intval($id_catalog)][$rrm[1]].'_'.$rrm[1].$zamena_2, $uri)).'">'.$arr_razdel[intval($id_catalog)][$rrm[1]].'</a><span style="color:#858585">, '.$rrm[0].'</span><br>';
	 		$i++;
			if($i==3) $i=0;
			}
		echo '</table><p>';
		}
	}
	

	$all_Recordset1 = mysql_query($query_count_all);
	$arr_query_count = mysql_fetch_array($all_Recordset1);
	$totalRows_Recordset1 = $arr_query_count[0];


$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

echo '&nbsp;Найдено записей: '.intval($totalRows_Recordset1);

if($totalRows_Recordset1) 
	{
	echo '<br><br><TABLE width="750"  cellpadding="0" cellspacing="0" border="0">';

	do 
		{ 
	  	if (isset ($row_Recordset1['id'])) 
			{
			
			if(strtotime($row_Recordset1['vip_data'])>time() && !$row_Recordset1['vip_spec']) $vip_fon='background="'.$bp.'icon/vip-fon.jpg"'; else $vip_fon=''; 
			
			if($row_Recordset1['id']==14 ) $vip_fon='background="'.$bp.'icon/vip-fon.jpg"'; else $vip_fon=''; /////////////////// VIP FON
			
			echo '<tr data-href="'.$bp.'_'.$row_Recordset1['zag_url'].'/"><td '.$vip_fon.'><table width="100%" cellpadding="5" cellspacing="5" >';
			
			echo '<tr valign=top height="100">';
			echo '<td align=center valign=top width="100">';
			if($row_Recordset1['small'])
			echo '<img src="'.$bp.$row_Recordset1['small'].'" border=0>';

			echo '<td width="45%">';
			if($row_Recordset1['opis']) $tit='title="'.obrez(str_replace("\n"," ", $row_Recordset1['opis']), 200).'"'; else $tit='';
			echo '<a style="font-size:14px" '.$tit.' href="'.$bp.'_'.$row_Recordset1['zag_url'].'/" >'.$row_Recordset1['zag'].'</a>';

			echo '<br><span style="color:#858585">'.$row_Recordset1['gorod'].'</span>';

						
			echo '<td width="35%">';
			echo '<span style="color:#858585">'.$row_Recordset1['razdel'].'</span>';

			echo '</table>';
			}
		} while ($row_Recordset1 = mysql_fetch_array($Recordset1));
		echo '</table>';
	}

mysql_free_result($Recordset1);





$uris=explode("param_",$uri);

if($uris[1]) //есть параметы кроме pn
	{
	$dop2="&pn=";
	$map1="&map=1";
	$map2="&map=2";
	}
else
	{
	$dop2="param_pn=";
	$map1="param_map=1";
	$map2="param_map=2";
	}

pages(15, $totalPages_Recordset1, $pn, $uri, $dop2);

?>
		</td>
		
		<td valign="top">
		

			
			<?
			include_once($base_path.'blok/right_blok.php');
			?>
		</td>
	</tr>
</table>