<?php
/**
 * @version		2.6.x
 * @package		K2
 * @author		JoomlaWorks http://www.joomlaworks.net
 * @copyright	Copyright (c) 2006 - 2014 JoomlaWorks Ltd. All rights reserved.
 * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;
?>
<?php if(count($items)): ?>   
   <div id="our_service" class="clearfix">
        <div class="viewport">
          <div class="overview"> 
            <?php $max = count( $items ); $bullet = 0; ?>                                      
            <?php foreach ($items as $key => $item) : ?>
                <?php if( !$key ) : ?>
                <div class="t-our_service_section pull-right clearfix">
                <?php endif; ?>
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 pull-right t-single_service">
                    <div class="row">
                          <?php if($params->get('itemTitle')): ?><h5><?php echo $item->title; ?></h5><?php endif; ?>
                          <?php if($params->get('itemIntroText')): ?>
                              <p><?php echo $item->introtext; ?></p>
                          <?php endif; ?>
                    </div>
                    
                    <?php if($params->get('itemExtraFields') && count($item->extra_fields)): ?>
                      <?php foreach ($item->extra_fields as $extraField): ?>
                            <?php if($extraField->value != '' and $extraField->type = 'link' ): ?>
                            <div class="t-glyp_icon t-glyp_distance">
                                <a class="glyph-item mega" aria-hidden="true" data-icon="<?php echo $extraField->text; ?>" data-js-prompt="&amp;<?php echo $extraField->text; ?>" href="<?php echo $extraField->url; ?>"></a>
                            </div>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </div>
                <?php if( $key && !( $key % 2 ) ) : ?>
                    <?php $bullet++; ?>    
                </div>
                <?php if( $key < ( $max - 1 ) ) : ?>
                <div class="t-our_service_section pull-right clearfix">
                <?php endif; ?>
                <?php elseif( ( $key == ( $max - 1 ) ) && ( $key % 2 ) ) : ?>
                    <?php $bullet++; ?>
                </div>
                <?php endif; ?>
            <?php endforeach; ?>
          </div>
        </div>
        <?php if( $bullet ) : ?>
        <ul class="bullets">
          <?php for( $i = 0; $i < $bullet; $i++ ) :?>
          <li><a href="#" class="bullet<?php if( !$i ) : ?> active<?php endif; ?>" data-slide="<?php echo $i; ?>"><?php echo $i; ?></a></li>
          <?php endfor; ?>                                        
        </ul>
        <?php endif; ?>
   </div>  
  <?php endif; ?>
