<?php if (!$page): ?>
<!-- product teaser -->
<div id="<?php print $node->nid; ?>" class="products node node-product-teaser col-md-4"> <?php print render($title_prefix); ?> <?php print render($title_suffix); ?>
  <figure class="product">
    <?php if (!empty($content['field_product_status'])): ?>
    <?php
        /* $field_product_status = field_get_items('node', $node, 'field_product_status');
          $product_status = !empty($field_product_status[0]['taxonomy_term']->name) ? $field_product_status[0]['taxonomy_term']->name : ''; */
        hide($content['field_product_status']);
	   
        ?>
    <div class="product-discount"><?php print render($content['field_product_status']); ?></div>
    <?php endif; ?>
    <div class="mediaholder">
      <?php if (!empty($content['product:field_diamond_image'])): ?>
      <?php
          hide($content['product:field_diamond_image']);
          if (!empty($content['product:field_diamond_image'][0])) {
            print render($content['product:field_diamond_image'][0]);
          }
          ?>
      <a href="<?php print $node_url; ?>">
      <div class="cover">
        <?php
              $img1 = !empty($content['product:field_diamond_image'][1]) ? $content['product:field_diamond_image'][1] : $content['product:field_diamond_image'][0];
              print render($img1);
              ?>
      </div>
      </a>
      <?php endif; ?>
      <?php if (!empty($content['field_product'])): ?>
      <?php hide($content['field_product']); ?>
      <div class="product-button">
        <?php if (!empty($content['field_product']['#items']) && (count($content['field_product']['#items']) > 1)): ?>
        <div class="commerce-add-to-cart"> <a class="btn" href="<?php print $node_url; ?>" title="<?php print t('Select options'); ?>"><?php print t('Select options'); ?></a> </div>
        <?php else: ?>
        <?php print render($content['field_product']); ?>
        <?php endif; ?>
      </div>
      <?php endif; ?>
    </div>
    <section>
      <?php if ($title): ?>
      <a href="<?php print $node_url; ?>">
      <h5><?php print $title; ?></h5>
      </a>
      <?php endif; ?>
      <?php
          //dsm($node);
		 
          hide($content['comments']);
          hide($content['links']);
		 
          print render($content);
          ?>
    </section>
  </figure>
</div>
<!-- // product teaser -->
<?php else: ?>
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> node-product clearfix"<?php print $attributes; ?>> <?php print $user_picture; ?> <?php print render($title_prefix); ?> <?php print render($title_suffix); ?>
  <?php if ($display_submitted): ?>
  <div class="submitted"> <?php print $submitted; ?> </div>
  <?php endif; ?>
  <div class="content"<?php print $content_attributes; ?>> 
    <!--Tabs for image and chart-->
    <ul class="product-tab nav nav-tabs" role="tablist" id="trizzyTab">
      <!--Chart-->
      <li class="active"><a data-toggle="tab" role="tab" href="#chart-container"><?php print t('Chart'); ?></a></li>
      <!--//Chart--> 
      <!--Image-->
      <?php if (!empty($content['product:field_diamond_image'][0])): ?>
      <li><a data-toggle="tab" role="tab" href="#image-container"><?php print t('Image'); ?></a></li>
      <?php endif; ?>
      <!--//Image--> 
      <!--Video-->
      <?php if (!empty($content['field_diamond_video'])): ?>
      <li><a data-toggle="tab" role="tab" href="#video-container"><?php print t('Video'); ?></a></li>
      <?php endif; ?>
      <!--//Video-->
    </ul>
    <!--//Tabs for image and tabs-->
    
    <div class="row tab-content"> 
      <!--Roman tabs chart-->
      <div id="chart-container" class="col-md-6 tab-pane active">
        <div id="tabs-zoom-2">
          <div id="diam-diagram-view" class="diamond-diagram-container"> 
            <!--Top view-->
            <div class="diam-top-view"><img src="/sites/all/themes/trizzy/images/diamond-shape/<?php print render($node->field_diamond_shape['und'][0]['value']); ?>_Top.jpg" alt="top view" />
              <div id="top-view-width"><span>Width:</span><br/>
                <?php if(!empty($node->field_diamond_measurements[$node->language][0]['value'])): ?>
                <?php
                                $length='';
                                $width='';
                                $meas=$node->field_diamond_measurements[$node->language][0]['value'];
                                $arr=explode('x' , $meas);
                                $length=$arr[0];
                                $width=$arr[1];
                                ?>
                <?php endif; ?>
                <span>
                <?php if(isset($width)) print $width; ?>
                mm.</span> </div>
              <!--//top-view-width-->
              <div id="top-view-length"> <span>Length:</span><br/>
                <span>
                <?php if(isset($length)) print $length; ?>
                mm.</span> </div>
              <!--//Lenghth--> 
            </div>
            <!--//Top view--> 
            <!--Side view-->
            <div class="diam-side-view"><img src="/sites/all/themes/trizzy/images/diamond-shape/<?php print render($node->field_diamond_shape['und'][0]['value']); ?>_Front.jpg" alt="side view" />
              <div id="side-view-table"><span>Table %:</span><span>
                <?php if($foo = $node->field_diamond_table[$node->language][0]['value']) print $foo; else print 'Unspec.'; ?>
                </span> </div>
              <!--//table-->
              <div id="side-view-culet"><span>Culet:</span><span>
                <?php if($foo = $node->field_diamond_culet[$node->language][0]['value']) print $foo; else print 'Unspec.'; ?>
                </span> </div>
              <!--//culet-->
              <div id="side-view-depth"><span>Depth %:</span><br />
                <span>
                <?php if($foo = $node->field_diamond_depth[$node->language][0]['value']) print $foo; else print 'Unspec.'; ?>
                </span> </div>
              <!--//depth-->
              <div id="side-view-girdle"><span>Girdle:</span><br/>
                <span>
                <?php if($foo = $node->field_diamond_girdle[$node->language][0]['value']) print $foo; else print 'Unspec.'; ?>
                </span> </div>
              <!--//girdle--> 
            </div>
            <!--//side view--> 
          </div>
          <!--//Diamond shape diagram--> 
        </div>
        <!--//zoom-tab-1--> 
        
      </div>
      <!--//Roman tabs chart--> 
      <!--Image-->
      <div id="image-container" class="col-md-6 tab-pane"> <?php print render($content['product:field_diamond_image']); ?> </div>
      <!--Video-->
      <div id="video-container" class="col-md-6 tab-pane"> <?php print render($content['field_diamond_video']); ?> </div>
      <!--Video-->
      
      <div class="col-md-6">
        <div class="product-title">
          <?php $node_title=$node->field_diamond_weight['und'][0]['value'] . ' Carat ' . $node->field_diamond_shape['und'][0]['value'] . ' Cut Diamond'; ?>
          <h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>">
            <?php /*?><?php print $title; ?><?php */?>
            <?php print $node_title; ?></a></h2>
          <?php if (!empty($content['product:commerce_price'])): ?>
          <?php print render($content['product:commerce_price']); ?>
          <?php endif; ?>
        </div>
        <!--Cert. verification-->
        <div class="cert-verification">
          <?php if($node->field_diamond_lab['und'][0]['value'] == 'GIA'): ?>
          <div class="verification-link-container"> <a class="gia-link" href="http://www.gia.edu/cs/Satellite?pagename=GST%2FDispatcher&childpagename=GIA%2FPage%2FReportCheck&c=Page&cid=1355954554547&reportno=<?php print $node->field_diamond_certnum['und'][0]['value']; ?>" target="_blank"><?php print t('GIA Online Verification'); ?></a> </div>
          <?php elseif($node->field_diamond_lab['und'][0]['value'] == 'AGS'): ?>
          <div class="verification-link-container"> <a class="ags-link" href="http://agslab.com/reportTypes/pldqr.php?StoneID=<?php print $node->field_diamond_certnum['und'][0]['value']; ?>&Weight=<?php print $node->field_diamond_weight['und'][0]['value']; ?>&D=1" target="_blank"><?php print t('AGS Online Veryfication'); ?></a> </div>
          <?php endif; ?>
        </div>
        <!--//Cert-verivication-->
        <?php
          // We hide the comments and links now so that we can render them later.
		  hide($content['title_field']);
          hide($content['field_diamond_color']);
		  hide($content['field_diamond_fancy_color']);
		  hide($content['field_diamond_fancy_intensity']);
		  hide($content['field_diamond_clarity']);
		  hide($content['field_diamond_shape']);
		  hide($content['field_diamond_weight']);
		  hide($content['field_diamond_measurements']);
		  hide($content['field_diamond_table']);
		  hide($content['field_diamond_depth']);
		  hide($content['field_diamond_polish']);
		  hide($content['field_diamond_symmetry']);
		  hide($content['field_diamond_girdle']);
		  hide($content['field_diamond_culet']);
		  hide($content['field_diamond_fluor']);
		  hide($content['field_diamond_lab']);
		  hide($content['field_diamond_cut']);
		  hide($content['field_diamond_ppc']);
		  hide($content['field_diamond_rapoff']);
		  hide($content['field_diamond_cert_image']);
		  hide($content['field_diamond_cert_pdf']);
		  hide($content['field_diamond_video']);
		  hide($content['comments']);
          hide($content['links']);
		  
          if (!empty($content['body']) && $page) {
           hide($content['body']);
          }
          if (!empty($content['field_product']['attributes'])) {
          }
	      print render($content);
          ?>
        <?php if (!empty($content['product:field_diamond_image'])): ?>
        <?php print render($content['links']); ?> </div>
    </div>
    <?php endif; ?>
  </div>
  <?php if ($page): ?>
  <div id="product-tabs-wrapper" class="row">
    <div class="col-md-12">
      <ul class="product-tab nav nav-tabs" role="tablist" id="trizzyTab">
        <li class="active"><a data-toggle="tab" role="tab" href="#product-description"><?php print t('Item Details'); ?></a></li>
        <!--Roman test-->
        <li><a data-toggle="tab" role="tab" href="#product-details"><?php print t('Recently Viewed'); ?></a></li>
        <li><a data-toggle="tab" role="tab" href="#product-cert"><?php print t('Certificate'); ?></a></li>
        <!--//Roman test-->
      </ul>
      <div class="tab-content">
        <div class="tab-pane active" id="product-description">
          <?php /*?><?php if (!empty($content['body'])): ?>
                <?php print render($content['body']); ?>
              <?php endif; ?><?php */?>
          <!--Diamonds info left-->
          
          <div class="item-details-left"><?php print render($content['title_field']); ?><?php print render($content['field_diamond_ppc']); ?> <?php print render($content['field_diamond_rapoff']); ?> <?php print render($content['field_diamond_shape']); ?> <?php print render($content['field_diamond_weight']); ?> <?php print render($content['field_diamond_color']); ?> <?php print render($content['field_diamond_fancy_color']); ?> <?php print render($content['field_diamond_fancy_intensity']); ?> <?php print render($content['field_diamond_cut']); ?><?php print render($content['field_diamond_clarity']); ?><?php print render($content['field_diamond_lab']); ?><?php print render($content['field_diamond_polish']); ?></div>
          <!--//Diamonds info left--> 
          <!--Diamonds info right-->
          <div class="items-details-right"> <?php print render($content['field_diamond_symmetry']); ?> <?php print render($content['field_diamond_measurements']); ?> <?php print render($content['field_diamond_depth']); ?> <?php print render($content['field_diamond_table']); ?> <?php print render($content['field_diamond_fluor']); ?> <?php print render($content['field_diamond_girdle']); ?> <?php print render($content['field_diamond_culet']); ?> </div>
          
          <!--//Diamonds info right--> 
        </div>
        
        <!--Recently viewed-->
        <div class="tab-pane" id="product-details">
          <?php
    print views_embed_view('recently_read', 'block_1');
    ?>
        </div>
        <!--//Recently viewed--> 
        <!--Certificate-->
        <div class="tab-pane" id="product-cert"> <?php print render($content['field_diamond_cert_image']); ?> <?php print render($content['field_diamond_cert_pdf']); ?> </div>
        <!--//Certificate--> 
        
      </div>
    </div>
  </div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
