<?php 

	include_once('header.php');
	
?>

	<div id="ads"><?php include_once('ads_firma_right.php'); ?></div>
	<div class="left">

<?php
	include_once('firma_menu.php');	

?>
	
	<h1><?= $h1 ?></h1>
	
	
	
	<?php 
		if(!empty($detail['0']['popis']))
		{		
			$popis = explode('|', $detail['0']['popis']);
			if(count($popis) > 0)
			{
				echo '<ul>';
				foreach($popis as $k => $v)
				{
					if(strlen(trim($v))>0)echo '<li> - '.nl2br($v).'</li>';
				}
				echo '</ul>';
			}
		}
	?>
	
	<div><br><?php include_once('ads_firma_center.php'); ?></div>
	
	<?php
		//zarazeni
		if(!empty($kategorie))
		{
			echo '<div class="zarazeni"><h3>'.$words[28].'</h3><br>';
			echo '<table>';
			foreach($kategorie as $vk)
			{
			  echo '<tr><td>';
				echo '<img src="/images/adresar.gif" alt="kategorie">&nbsp;<a href="'.base_url().$catcontroller.'/'.$vk['cool_name'].'/" title="'.$vk['new_name'].'">'.$vk['new_name'].'</a>';
				echo '</td><td>';
        if(!empty($lokality))foreach($lokality as $vl)
				{
					echo '&raquo; <img src="/images/adresar.gif" alt="kategorie">&nbsp;<a href="'.base_url().$catcontroller.'/'.$vk['cool_name'].'/'.$vl['cool_name'].'/" title="'.$vk['new_name'].' - '.$vl['lokalita'].'">'.$vl['lokalita'].'</a> ';
				}
				echo '</td></tr>';
			}
			echo '</table></div>';
		}
	?>
	
	<!-- Kontakty -->
	<?php 
		echo '<div class="kontakty"><h3>'.$words[23].'</h3>';
		echo '<table>';
		if(!empty($detail['0']['ulice']) or !empty($detail['0']['obec']) or !empty($detail['0']['psc']))
			echo '<tr><td class="padding-right10"><b>'.$words[9].'</b></td><td>';
		if(!empty($detail['0']['ulice']))
		{
			echo $detail['0']['ulice'].'<br>';
		}
		if(!empty($detail['0']['psc']))
		{
			echo $detail['0']['psc'].' ';
		}
		if(!empty($detail['0']['obec']))
		{
			echo $detail['0']['obec'].'<br>';
		}
		echo '</td></tr>';
	?>
	
	<?php 
		if(!empty($detail['0']['tel']))
		{
			echo '<tr><td class="padding-right10"><b>'.$words[11].'</b></td><td>';
			$tel = explode(',', $detail['0']['tel']);
			if(count($tel) > 0)
			{	
				foreach($tel as $k => $v)
				{
					if($k < 3)echo $v.'<br>';
				}
			}
			echo '</td></tr>';
		}
	?>

	<?php 
		if(!empty($detail['0']['fax']))
		{
			echo '<tr><td class="padding-right10"><b>'.$words[41].'</b></td><td>';
			$fax = explode(',', $detail['0']['fax']);
			if(count($fax) > 0)
			{	
				foreach($fax as $k => $v)
				{
					if($k < 2)echo $v.'<br>';
				}
			}
			echo '</td></tr>';
		}
	?>
	
	<?php 
		if(!empty($detail['0']['email']))
		{
			$email = explode(',', $detail['0']['email']);
			if(count($email) > 0)
			{
				echo '<tr><td class="padding-right10"><b>'.$words[12].'</b></td><td>';
				foreach($email as $k => $v)
				{
					if($k < 3)echo '<a href="mailto:'.$v.'">'.$v.'</a><br>';
				}
				echo '</td></tr>';
			}
		}
	?>

	<?php 
		if(!empty($detail['0']['www']))
		{
			$www = explode(',', $detail['0']['www']);
			if(count($www) > 0)
			{
				echo '<tr><td class="padding-right10"><b>'.$words[13].'</b></td><td>';
				foreach($www as $k => $v)
				{
					if($k < 3)echo '<a href="http://'.trim(str_replace('http://', '', $v)).'" rel="nofollow">'.$v.'</a><br>';
				}
				echo '</td></tr>';
			}
		}
	?>
	</table></div>

</div>

<div class="kontakty">
	<img src="/images/rukaa.jpg" width="24" alt="<?=$words[96]?>" title="<?=$words[96]?>">&nbsp;<a href="<?=base_url()?>aktualizovat/<?=$detail['0']['uri']?>/" rel="nofollow"><?=$words[96]?></a>
</div>

<?php include_once('footer.php'); ?>
