<?
$r=mysql_query("SELECT * FROM magazin WHERE id_akk='".$id_magazin."'");
$rr=mysql_fetch_array($r);
?>
<table cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td style="padding-top:15px" valign="top" bgcolor="#F1F1D8" width="65%" class="tb2"  >
		<h1><?=$rr['zag']?></h1>
		<td rowspan="2" valign="top" class="tb3">
			<table cellpadding="7" cellspacing="7" width="100%">
				<tr>
					<td valign="top" >
		
					<?
					if($rr['small'] && file_exists($base_path.$rr['small']))
					echo ' <img src="'.$bp.$rr['small'].'?i='.time().'" botder=0><p>';

					echo $rr['gorod'];
					if($rr['rayon']) echo ', '.$rr['rayon'];
					echo '<br>';
					if($rr['tel']) echo '<img src="'.$bp.'/icon/tel.gif"> '.$rr['tel'].'<br>';
					if($rr['email']) echo '<img src="'.$bp.'/icon/email.gif"> <a  href="'.$bp.'blok/send_email.php?idm='.$rr['id'].'" id="fancy_send_email">Отправить письмо</a><br>';
		
					if($rr['map_x'])
						{
						if($rru['map']=='y')
						echo '<img src="'.$bp.'/icon/world.png"> <a  href="'.$bp.'blok/ymap_view.php?map_x='.$rr['map_x'].'&map_y='.$rr['map_y'].'&h=470&w=470&zag='.urlencode($rr['zag']).'" id="fancy_map">Показать на карте</a><br>';
						elseif($rru['map']=='g')
						echo '<img src="'.$bp.'/icon/world.png"> <a  href="'.$bp.'blok/gmap_view.php?zag='.urlencode($rr['zag']).'&map_x='.$rr['map_x'].'&map_y='.$rr['map_y'].'&h=470&w=470" id="fancy_map">Показать на карте</a><br>';
						}
						
					if($rr['url_real']) echo '<img src="'.$bp.'/icon/site.png"> <noindex><a target=_blank rel="nofollow" href="'.$rr['url_real'].'">Сайт магазина</a></noindex><br>';
					?>
			</table>
    <tr>
		<td valign="top"  width="35%" class="tbl">
			<table cellpadding="7" cellspacing="7" width="100%">
				<tr>
					<td>
					
					<div id="txt">
					<?
					$opis=explode("<hr>",$rr['opis']);
					if($opis[1])
					echo str_replace("\n","<br>",$opis[1]);
					?>
					</div>

					<br>
					<span id="bolshe"></span>
					<script type="text/javascript">
					var bb = 144;
	  				var aa = $('#txt').height();

					if(aa>bb)
						{
						$("#txt").attr("style", "height: "+bb+"px; overflow:hidden");
						document.getElementById('bolshe').innerHTML = '<a href="javascript:bol('+aa+','+bb+')">Показать больше &darr;</a>'; 
						}
					
					function bol(h1, h2)
						{
						$("#txt").animate({height: h1}, 500);
						//$("#txt").attr("style", "height: "+h1+"px; overflow:hidden");
						if(h1>h2) var pok='Показать меньше &uarr;'; else pok='Показать больше &darr;';
						document.getElementById('bolshe').innerHTML = '<a href="javascript:bol('+h2+','+h1+')">'+pok+'</a>'; 
						}
						
						
					</script>
			</table>
		</td>
	</tr>
</table>
