<? $atts = array(
              'width'      => '500',
              'height'     => '200',
              'scrollbars' => 'yes',
              'status'     => 'yes',
              'resizable'  => 'yes',
              'screenx'    => '0',
              'screeny'    => '0'
            ); ?>
<div id="main_borders">
 <div id="main_inner_borders">
 <h2><strong><?=$title?></strong></h2>
 <? $product_check = true; ?>
 <? $category_details = $this->MFuncs->getCategory($category_id);?>
 <? if (!$category_details) { ?>
 <? $product_check = false; ?>
 <? } ?>
 
 <? $subcategory = $this->MFuncs->getProductSubCat($product['p_id']);?>
 <? if ($subcategory) { ?>
 <? $subcategory_details = $this->MFuncs->getSubCategory($subcategory['subcat_id']);?>
 <? if (!$subcategory_details) { ?>
 <? $product_check = false; ?>
 <? } ?>
 <? $subsubcategory = $this->MFuncs->getProductSubSubCat($product['p_id']);?>
	 <? if ($subsubcategory) { ?>
 	<? $subsubcategory_details = $this->MFuncs->getSubSubCategory($subsubcategory['subsubcat_id']);?>
		 <? if (!$subsubcategory_details) { ?>
         <? $product_check = false; ?>
         <? } ?>
     <? } ?>
 <? } ?>
 <? if ($product_check==true) { ?>
<h5>(<? if ($category_details) { ?><?=$category_details['cat_name']?><? if ($subcategory) { ?>&nbsp;->&nbsp;<?=$subcategory_details['name']?><? if ($subsubcategory) { ?><? if ($subsubcategory_details) { ?>&nbsp;->&nbsp;<?=$subsubcategory_details['name']?><? } ?><? } ?><? } ?><? } ?>)</h5>
       <? if ($this-> session-> flashdata('message')): ?>
    <div class='warning'>
      <?=$this-> session-> flashdata('message');?>
    </div>
    <? endif; ?>
<div id="product_view_btn">
 <? if (($category_id=="7") || ($category_id=="21")) { ?>
  <? if ($product) { ?>
  <center>
  <? if (($product['image'] !='') || ($product['image'] !=NULL)|| ($product['image'] !=null)) { ?>
<?php /*?>  <a  title="<?=$product['name']?>"  href="<?=base_url().'images/prds/'.$product['image']?>" rel="shadowbox[];options={counterType:'skip',continuous:true,animSequence:'sync'}"> <img class="left" src="<?=base_url().'images/prds/thumb/'.$product['image']?>" style="max-width:120px; max-height:200px;"  /> </a><?php */?>
    <img src="<?=base_url().'images/prds/'.$product['image']?>" style="max-width:480px"/>
  <? }
		  else { ?>
  <img class="left" src="<?=base_url()?>images/no_image.jpg" style="width:120px; max-height:200px;"/>
  <? } ?>
  <? $product_photos = $this->MFuncs->getProductPhotos($product['p_id']);?>
  <? if ($product_photos) { ?>
	<?=anchor('view_more_photos/'.$product['p_id'], $this->lang->line('btn_more_photos'))?></div>
    <? } ?>
  </center>
<div class="subcolumns">
    <div class="c62l">
      <div class="subcl">
  <p>
        <? if ($product['price']!=0) { ?>
    <strong><?=$this->lang->line('price_txt')?></strong><? if (($product['offers']=='Yes') && ($product['offer_price']!=0)) { ?>
			<strike><?=$product['price']?></strike>&nbsp;&nbsp;<?=$product['offer_price']?>
			<? } else { ?>
			<?=$product['price']?>
			<? } ?>
&nbsp;&euro;&nbsp;<?=$product['price_txt']?><span style="color:#C00"><em><?=$this->lang->line('vat_included')?></em></span>
		<? } else { ?>
        <p><span  style="color:#C00"><em><?=$this->lang->line('availability_msg')?></em></span></p>
        <? } ?>
  </p>
      </div>
    </div>
    <div class="c38r">
      <div class="subcr">
      <? if ($product['available']=='Yes') { ?>
        <? if ($product['price']!=0) { ?>&nbsp;
          <? //=anchor('add_to_cart/'.$product['p_id'], $this->lang->line('links_add_cart'));?>
                    <div class="buttons"><?=anchor('add_to_cart/'.$product['p_id'], $this->lang->line('links_add_cart'),array('id'=>'back_btn','class'=>'positive'))?></div>

        <? } 
		} else { ?>
        <p><span  style="color:#C00"><em><?=$this->lang->line('availability_msg')?></em></span></p>
        <? } ?>
      </div>
    </div>
  </div>
<div  id="acc_details" style="text-align:justify">
    <? if ($product['description']) { ?>
         <? $varieties = $this->MFuncs->getVarieties(); ?>
     <? $varieties = $this->MFuncs->getVarieties(); ?>
      <? if ($varieties) { ?>
                   <? $text = strip_tags($product['description'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>

                   <? endforeach ?>
                   <p><?=$text?></p>
                   <? } else { ?>
                   <p><?=strip_tags($product['description'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?>	<p><?=$product['description']?></p>
<?php */?>    <? } ?>
    <? if ($product['suggestions']) { ?>
	<p><strong><?=$this->lang->line('suggestions_txt')?></strong>
        <? $varieties = $this->MFuncs->getVarieties(); ?>
          <? if ($varieties) { ?>
                   <? $text = strip_tags($product['suggestions'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <em><?=$text?></em></p>
                   <? } else { ?>
                    <em><?=strip_tags($product['suggestions'], '<p><br><strong><b>')?></em></p>
                    <? } ?>
<?php /*?><em><?=$product['suggestions']?></em></p>
<?php */?>    <? } ?>
    <? if ($product['characteristics']) { ?>
	<p><strong><?=$this->lang->line('characteristics_txt')?></strong>
	    <? $varieties = $this->MFuncs->getVarieties(); ?>
	           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['characteristics'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['characteristics'], '<p><br><strong><b>')?></p>
                    <? } ?>

<?php /*?>	<?=$product['characteristics']?></p>
<?php */?>    <? } ?>
    <? if ($product['vinifications']) { ?>
	<p><strong><?=$this->lang->line('vinifications_txt')?></strong>
		    <? $varieties = $this->MFuncs->getVarieties(); ?>
	           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['vinifications'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['vinifications'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['vinifications']?></p>
<?php */?>    <? } ?>
    <? if ($product['microclimate']) { ?>
	<p><strong><?=$this->lang->line('microclimate_txt')?></strong>
		    <? $varieties = $this->MFuncs->getVarieties(); ?>
		           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['microclimate'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['microclimate'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['microclimate']?></p>
<?php */?>    <? } ?>
    <? if ($product['other_characteristics']) { ?>
	<p><strong><?=$this->lang->line('other_characteristics_txt')?></strong>
		    <? $varieties = $this->MFuncs->getVarieties(); ?>
			           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['other_characteristics'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['other_characteristics'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['other_characteristics']?></p>
<?php */?>    <? } ?>
       


</div>
  <div style="height:20px;"></div>
<div style="float:right;">      
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " style="height:50px;">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f197b67592fd924"></script>
<!-- AddThis Button END -->
</div>
<div class="clear">&nbsp;</div>
<div style="height:20px"></div>
  <? } ?> 
 </div>
 <? } else { ?>
  <? if ($product) { ?>
  <div class="subcolumns">
    <div class="c50l">
      <div class="subcl">
        <h3>
          <? //=$product['name']?>
        </h3>
      </div>
    </div>
    <div class="c50r">
      <div class="subcr float_right">
  <p>
  
  <? if ($product['price']!=0) { ?>
     <strong><?=$this->lang->line('price_txt')?></strong><? if (($product['offers']=='Yes') && ($product['offer_price']!=0)) { ?>
			<strike><?=$product['price']?></strike>&nbsp;&nbsp;<?=$product['offer_price']?>
			<? } else { ?>
			<?=$product['price']?>
			<? } ?>&nbsp;&euro;&nbsp;<?=$product['price_txt']?><span  style="color:#C00"><em><?=$this->lang->line('vat_included')?></em></span>
  </p>
      <? if ($product['available']=='Yes') { ?>
        <? if ($product['price']!=0) { ?>&nbsp;
          <? //=anchor('add_to_cart/'.$product['p_id'], $this->lang->line('links_add_cart'));?>
                    <div class="buttons"><?=anchor('add_to_cart/'.$product['p_id'], $this->lang->line('links_add_cart'),array('id'=>'back_btn','class'=>'positive'))?></div>

        <? } 
		} else { ?>
        <p><span  style="color:#C00"><?=$this->lang->line('availability_msg')?></span></p>
        <? } ?>
		<? } else { ?>
        <p><span  style="color:#C00"><?=$this->lang->line('availability_msg')?></span></p>
        <? } ?>
      </div>
    </div>
  </div>
      <div class="subcolumns">
    <div class="c25l">
      <div class="subcl">
  <center>
  <? if (($product['image'] !='') || ($product['image'] !=NULL)|| ($product['image'] !=null)) { ?>
<?php /*?>  <a  title="<?=$product['name']?>"  href="<?=base_url().'images/prds/'.$product['image']?>" rel="shadowbox[];options={counterType:'skip',continuous:true,animSequence:'sync'}"> <img class="left" src="<?=base_url().'images/prds/thumb/'.$product['image']?>" style="max-width:120px; max-height:200px;"  /> </a><?php */?>
    <img class="left" src="<?=base_url().'images/prds/'.$product['image']?>" style="max-width:120px"/>
  <? }
		  else { ?>
  <img class="left" src="<?=base_url()?>images/no_image.jpg" style="width:120px; max-height:200px;"/>
  <? } ?>
  <? $product_photos = $this->MFuncs->getProductPhotos($product['p_id']);?>
  <? if ($product_photos) { ?>
	<?=anchor('view_more_photos/'.$product['p_id'], $this->lang->line('btn_more_photos'))?>
    <? } ?>
  </center>
        </div>
    </div>
    <div id="prd_details" class="c75r">
      <div class="subcl" style="text-align:justify">
    <? if ($product['description']) { ?>
     <? $varieties = $this->MFuncs->getVarieties(); ?>
      <? if ($varieties) { ?>
                   <? $text = strip_tags($product['description'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <p><?=$text?></p>
                   <p><? //=$link_text?></p>
                   <? } else { ?>
                   <p><?=strip_tags($product['description'], '<p><br><strong><b>')?></p>
                    <? } ?>

<?php /*?>	<p><?=$product['description']?></p>
<?php */?>    <? } ?>
    <? if ($product['suggestions']) { ?>
	<p><strong><?=$this->lang->line('suggestions_txt')?></strong>
    <? $varieties = $this->MFuncs->getVarieties(); ?>
          <? if ($varieties) { ?>
                   <? $text =strip_tags($product['suggestions'], '<p><br><strong><b>') ?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['suggestions'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><em><?=$product['suggestions']?></em></p>
<?php */?>    <? } ?>
    <? if ($product['characteristics']) { ?>
	<p><strong><?=$this->lang->line('characteristics_txt')?></strong>
    <? $varieties = $this->MFuncs->getVarieties(); ?>
	           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['characteristics'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['characteristics'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['characteristics']?></p>
<?php */?>    <? } ?>
    <? if ($product['vinifications']) { ?>
	<p><strong><?=$this->lang->line('vinifications_txt')?></strong>
	    <? $varieties = $this->MFuncs->getVarieties(); ?>
	           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['vinifications'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['vinifications'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['vinifications']?></p>
<?php */?>    <? } ?>
    <? if ($product['microclimate']) { ?>
	<p><strong><?=$this->lang->line('microclimate_txt')?></strong>
	    <? $varieties = $this->MFuncs->getVarieties(); ?>
		           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['microclimate'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['microclimate'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['microclimate']?></p>
<?php */?>    <? } ?>
    <? if ($product['other_characteristics']) { ?>
	<p><strong><?=$this->lang->line('other_characteristics_txt')?></strong>
	    <? $varieties = $this->MFuncs->getVarieties(); ?>
			           <? if ($varieties) { ?>
                   <? $text = strip_tags($product['other_characteristics'], '<p><br><strong><b>')?>
                   <? foreach($varieties as $varieties=>$variety): ?>
                   <? $text = str_replace($variety['name'], anchor_popup('variety/'.$variety['var_id'], $variety['name'], $atts), $text)?>
                   <? endforeach ?>
                   <?=$text?></p>
                   <? } else { ?>
                    <?=strip_tags($product['other_characteristics'], '<p><br><strong><b>')?></p>
                    <? } ?>
<?php /*?><?=$product['other_characteristics']?></p>
<?php */?>    <? } ?>
      </div>
    </div>
  </div>
  <div style="height:20px;"></div>
<div style="float:right;">      
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style " style="height:50px">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f197b67592fd924"></script>
<!-- AddThis Button END -->
</div>
<div class="clear">&nbsp;</div>
<div style="height:20px"></div>
  <? } ?>
</div>
<? } ?>
<? } else { ?>
 <p><span  style="color:#C00"><em><?=$this->lang->line('availability_msg')?></em></span></p>
<? } ?>
</div>
<div class="clear">&nbsp;</div>
</div>
<div class="clear">&nbsp;</div>
</div>