		<script language="javascript">
		document.getElementById('param').innerHTML = ''; 
		var wr=document.body.clientWidth;
		var hr=document.body.clientHeight;
		
		//var wr=screen.width;
		//var hr=screen.height;
			
		var w = (wr-600)/2+1;
		var h = (hr-400)/2+1;
		
		var newWin='';
		
		</script>				

		<?
		if($real_region_tree)
			{
			?>
			<script language="javascript">
			document.getElementById('reg_<?=$real_region_tree?>').innerHTML = ''; 
			</script>				
			<?
			}
		?>


		<?
		$parent_id_region=0;

		$id_region=$tree_reg[$real_region_tree];
		if($real_region_tree > 0)
		$parent_id_region=$tree_reg[$real_region_tree-1];
		$region_real = $arr_regions[$parent_id_region][$id_region];
		$region = $arr_regions_url[$parent_id_region][$id_region];

		echo '<a class="ww" href="'.$bp.'catalog/all_0/'.$region.'_'.$id_region.'/">Все объявления - '.$region_real.'</a> ';
		//echo ' >> <a href="'.$bp.'catalog/'.re_adres($arr_razdel[0][$tree_cat[0]]).'_'.$tree_cat[0].'/'.re_adres($region).'_'.$id_region.'/">'.$arr_razdel[0][$tree_cat[0]].'</a> ';
		
		for ($i=1; $i<count($tree_cat); $i++)
			{
			if($tree_cat[$i])
				{
				echo ' >> <a class="ww" title="'.$arr_razdel[$tree_cat[($i-1)]][$tree_cat[$i]].'. '.$name_region.'" href="'.$bp.'catalog/'.$arr_razdel_url[$tree_cat[($i-1)]][$tree_cat[$i]].'_'.$tree_cat[$i].'/'.$region.'_'.$id_region.'/">'.$arr_razdel[$tree_cat[($i-1)]][$tree_cat[$i]].'</a> ';
				$posled_field_razdel=$i;
				$posled_razdel=$arr_razdel[$tree_cat[($i-1)]][$tree_cat[$i]];
				}
			}
		
		if($arr_field)
			{
			foreach ($arr_field as $index=>$ar_fi)
				{
				if($ar_fi['field_param_search'])
					{
					if($arr_field[$index]['field_field'] && $rr[$arr_field[$index]['field_field']])
					echo ' >> <a class="ww" title="'.$arr_element[$arr_field[$index]['field_spisok']][$rr[$arr_field[$index]['field_field']]].'. '.$name_region.'" href="'.$bp.'catalog/'.$arr_catalog['url'].'_'.$id_catalog.'/'.$region.'_'.$id_region.'/param_'.$arr_field[$index]['field_field'].'[1]='.$rr[$arr_field[$index]['field_field']].'">'.$arr_element[$arr_field[$index]['field_spisok']][$rr[$arr_field[$index]['field_field']]].'</a> ';
					if($arr_field[$index]['field_field_two'] && $rr[$arr_field[$index]['field_field_two']])
					echo ' >> <a class="ww" title="'.$arr_element[$arr_field[$index]['field_spisok']][$rr[$arr_field[$index]['field_field']]].' '.$arr_element_two[$rr[$arr_field[$index]['field_field']]][$rr[$arr_field[$index]['field_field_two']]].'. '.$name_region.'" href="'.$bp.'catalog/'.$arr_catalog['url'].'_'.$id_catalog.'/'.$region.'_'.$id_region.'/param_'.$arr_field[$index]['field_field'].'[1]='.$rr[$arr_field[$index]['field_field']].'&'.$arr_field[$index]['field_field'].'[2]='.$rr[$arr_field[$index]['field_field_two']].'">'.$arr_element_two[$rr[$arr_field[$index]['field_field']]][$rr[$arr_field[$index]['field_field_two']]].'</a> ';
					break;
					}
				}
			}
		
		
		?>
<p>
<table width="100%" cellpadding="3" cellspacing="3">
	<tr>
		<td colspan="2">
		<?
		echo '<h1 class="items" >'.$rr['zag'].'</h1>';
			
		/*
		if($arr_field)
				{
				foreach ($arr_field as $ar_fi)
					{
					if($ar_fi['field_tp']=='f_cena_')
						{
						echo $ar_fi['field'].' <font color=red size=+1>'._font($rr['f_cena_'], 1, 0).' '.$rru['cena_valuta'].' '.$rr['suff'].'</font><br><br>';
						break;
						}
					}
				}
		*/
			
		echo 'Размещено ';
		if(date($date_format_site, strtotime($rr['data'])) == date($date_format_site))
		echo 'сегодня';
		elseif(date($date_format_site, (strtotime($rr['data']) + 24*60*60)) == date($date_format_site))
		echo 'вчера';
		else
		echo dat_rus($rr['data']);
		echo ' в '.date("H:i", strtotime($rr['data']));
		
		?>
		</td>
	</tr>
	
	<tr>
		<td width="70%" valign="top">
		<?
		if (isset ($rr['id'])) 
			{ 
			if($rr['kol_foto'])
				{
				?>
				<fieldset>
					<div style="padding-top:10px" align=center>
					<?
					include_once($base_path.'blok/idv_foto2.php');
					?>
					</div>
				</fieldset><br>
				<?
				}
			?>
			<fieldset id="info">
			<table cellpadding="0" cellspacing="0" width=100%><tr><td valign="top">
			<?
			
			echo '<table cellpadding="3" cellspacing="3" width=100%>';
			
			echo '<tr>';
			echo '<td width=25>';
			echo '<img src="'.$bp.'icon/site.png">';
			echo '<td width=450>';
			echo $rr['gorod']; 	if($rr['rayon']) echo ', '.$rr['rayon'];
			
			
			echo '<tr>';
			echo '<td>';
			echo '<img src="'.$bp.'icon/user.png">'; 
			echo '<td>';
			echo $rr['contakt'];
			
			echo '<tr valign=top>';
			echo '<td>';
			echo '<img src="'.$bp.'icon/tel.gif">'; 
			echo '<td>';
			echo '<span id="sendtel" ><a href="javascript:send_tel('.$rr['id'].')">Показать номер телефона</a></span><br>';
			
			if($rr['email']) 
			{
			echo '<tr>';
			echo '<td>';
			echo '<img src="'.$bp.'icon/email.gif">';
			echo '<td>';
			?>
			<a  href="<?=$base_path?>blok/send_email.php?id=<?=$rr['id']?>" id="fancy_send_email">Отправить письмо</a>
			<?
			}
			
			if($mms)
			{
			if(!$_SESSION['ID_Glob'] && $_SESSION['ID_P'][1] && $rr['id_akk'] && $_SESSION['ID_P'][1] != $rr['id_akk'])
				{
				echo '<tr>';
				echo '<td>';
				echo '<img src="'.$bp.'icon/email.gif">';
				echo '<td>';
				?>
				<a  href="<?=$base_path?>mess/privat_message.php?komu=<?=$rr['id_akk']?>" id="fancy_mess">Оставить приватное сообщение</a>
				<?
				}
			elseif($_SESSION['ID_Glob'] && $rr['id_akk'])
				{
				echo '<tr>';
				echo '<td>';
				echo '<img src="'.$bp.'icon/email.gif">';
				echo '<td>';
				?>
				<a  href="<?=$base_path?>mess/privat_message.php?admin=1&komu=<?=$rr['id_akk']?>" id="fancy_mess">Оставить приватное сообщение</a>
				<?
				}
			}
			echo '</table><p>';
			
			
			if($arr_field)
				{
				echo '<table cellpadding="3" cellspacing="3" width=100%>';
				foreach ($arr_field as $ar_fi)
					{
					if(($ar_fi['spec']=='st' || $ar_fi['spec']=='sp'))
						{
						if($ar_fi['field'] && ($rr[$ar_fi['field_field']] || $rr[$ar_fi['field_field_two']]))
							{
							if($ar_fi['field_field_two'])
							eval("field_func_view_".$ar_fi['field_typ']." ('view_idv', \$ar_fi, \$rr[\$ar_fi['field_field']], \$rr[\$ar_fi['field_field_two']]);");
							else
							eval("field_func_view_".$ar_fi['field_typ']." ('view_idv', \$ar_fi, \$rr[\$ar_fi['field_field']], '', \$rr['suff']);");
							}
						}
					}
				echo '</table>';
				
				foreach ($arr_field as $ar_fi)
					{
					if($ar_fi['field_param_search'])
						{
						if($ar_fi['field_field_two'] && $rr[$ar_fi['field_field_two']])
							{
							$real_param=$ar_fi['field_field_two'];
							$real_param_value=$rr[$ar_fi['field_field_two']];
							}
						else
							{
							$real_param=$ar_fi['field_field'];
							$real_param_value=$rr[$ar_fi['field_field']];
							}
						}
					}
				}
			
			
			$opis=explode("<hr>",$rr['opis']);
			if($opis[1])
			echo '<table cellpadding="3" cellspacing="3" width=100%><td>'.str_replace("\n","<br>",$opis[1]).'</td></tr></table><br>';
		
			?>
			</td>
			<td valign="top">
			<?
			$rf=mysql_query("SELECT * FROM magazin WHERE id_akk='".$rr['id_akk']."' AND activ !=1");
			$nf=mysql_num_rows($rf);
			if($nf)
			include($base_path.'blok/magazin_blok_idv.php');
			?>
			</td>
			
		<tr>
			<td colspan="2">
				<table width="100%">
					<tr>
						<td>
						<?
						echo '<div id="car'.$id.'">';
						if (!$_SESSION['cart'] || !in_array($id, $_SESSION['cart']))
						echo '<a href="javascript:send_cart('.$id.')" ><img  border=0 src="'.$bp.'icon/Edit_Yes.png"> Добавить в блокнот</a>';
						elseif($_SESSION['cart'] && in_array($id, $_SESSION['cart']))
						echo '<a href="javascript:send_cart('.$id.')" ><img  border=0 src="'.$bp.'icon/Edit_No.png"> Удалить из блокнота</a>';
						echo '</div>';
						?>
						</td>
						<td>
						<a href="<?=$base_path?>blok/send_zhaloba.php?id=<?=$rr['id']?>" id="fancy_zhaloba">Пожаловаться</a>
						</td>
						<td>
						<script type="text/javascript"  src="//yandex.st/share/share.js" charset="utf-8"></script>
						<div class="yashare-auto-init" 
						data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir">
						</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		</table>
		</fieldset>
		
		<?
		if($rr['map_x']) 
			{
			?>
			<br><fieldset>
					<?
					if($rru['map']=='y')
						{
						?>
						<iframe src="<?=$base_path?>blok/ymap_view.php?map_x=<?=$rr['map_x']?>&map_y=<?=$rr['map_y']?>&h=400&w=600&zag=<?=urlencode($rr['zag'])?>" height="410" width="610" frameborder="0"  scrolling="no"></iframe>
						<?
						}
					elseif($rru['map']=='g')
						{
						?>
						<iframe src="<?=$base_path?>blok/gmap_view2.php?zag=<?=urlencode($rr['zag'])?>&map_x=<?=$rr['map_x']?>&map_y=<?=$rr['map_y']?>&h=400&w=600" height="410" width="610" frameborder="0"  scrolling="no"></iframe>
						<?
						}
					?>
			</fieldset>
			<?
			}

		
		
		
		
		
		if($rr['video_item'] && ($rr['video_host']=='youtu.be' || $rr['video_host']=='youtube.com'))
			{
			?>
			<br><fieldset>
				<div style="padding-top:10px" align="center">
				<?
				echo video_youtub($rr['video_item']);
				?>
				</div>
			</fieldset>
			<?
			}
			?>
		
		<?
		if($rr['comment'])
		include($base_path.'comment/comment.php');
		?>
		
		<?
		if($nf)
		include_once ($base_path.'blok/pohozhie_magaz.php');
		else
		include_once ($base_path.'blok/pohozhie.php');
		?>



		</td>
		
		<td valign="top">
		<fieldset>
			<?
			echo 'Просмотров: '.$rr['counter'].'<p>';
			mysql_query("UPDATE board SET counter=counter+1 WHERE id='".$rr['id']."'");

				?>
				<table>
              		<tr>
               			<td><img width="27" height="27" border=0 src="<?=$bp?>icon/info.png"></td>
                		<td valign="middle">
						<a  href="<?=$base_path?>blok/vibor_payment.php?id=<?=$rr['id']?>&type_payment=2" id="fancy_vip1">Выделить объявление</a>
						</td>
              		</tr>

              		<tr>
                		<td><img width="27" height="27" border=0 src="<?=$bp?>icon/message.png"></td>
                		<td valign="middle">
						<a  href="<?=$base_path?>blok/vibor_payment.php?id=<?=$rr['id']?>&type_payment=3" id="fancy_vip2">Сделать VIP-объявлением</a>
						</td>
              		</tr>
					
              		<tr>
                		<td><img width="27" height="27" border=0 src="<?=$bp?>icon/favorites.png">
						</td>
                		<td valign="middle">
						<a  href="<?=$base_path?>blok/vibor_payment.php?id=<?=$rr['id']?>&type_payment=4" id="fancy_vip3">Спецразмещение</a>
						</td>
              		</tr>
            	</table>
			
		</fieldset>
		<?
		}
		mysql_free_result($r);
		?>
		
		<?
		include_once($base_path."blok/tv_vibor.php"); 
		include_once($base_path.'blok/right_blok.php');
		?>
		
		</td>
	</tr>
</table>