<?php  
   defined('C5_EXECUTE') or die("Access Denied.");
   $bt=Block::GetByID($controller->bID);
   $textHelper = Loader::helper("text");
   $ih = Loader::helper('feature_image', 'c5mix_featured_content_slider');
   $bh = Loader::helper('block_include','c5mix_featured_content_slider');
   $bh->setCss($bt,'ui.core.css');
   $bh->setJavascript($bt,'ui.core.js');
   $bh->setJavascript($bt,'ui.widget.js');
   $bh->setJavascript($bt,'ui.tabs.js');
   // now that we're in the specialized content file for this block type, 
   // we'll include this block type's class, and pass the block to it, and get
   // the content
   if (count($cArray) > 0) { ?>
   <script type="text/javascript"><?php  
   defined('C5_EXECUTE') or die("Access Denied.");
   $bt=Block::GetByID($controller->bID);
   $textHelper = Loader::helper("text");
   $ih = Loader::helper('feature_image', 'c5mix_featured_content_slider');
   $bh = Loader::helper('block_include','c5mix_featured_content_slider');
   $bh->setCss($bt,'ui.core.css');
   $bh->setJavascript($bt,'ui.core.js');
   $bh->setJavascript($bt,'ui.widget.js');
   $bh->setJavascript($bt,'ui.tabs.js');
 
   // now that we're in the specialized content file for this block type, 
   // we'll include this block type's class, and pass the block to it, and get
   // the content
 
   if (count($cArray) > 0) { ?>
 
   <script type="text/javascript">
      $(document).ready(function(){
         $("#c5mix-featured-slider-<?php  echo $bID?>").tabs({fx:{opacity: "toogle"}}).tabs("rotate", 5000, true);
         $("#c5mix-featured-slider-<?php  echo $bID?>").hover(
         function() {
         $("#c5mix-featured-slider-<?php  echo $bID?>").tabs("rotate",0,true);
         },
         function() {
         $("#c5mix-featured-slider-<?php  echo $bID?>").tabs("rotate",5000,true);
         }
         );
      });
   </script>
 
   <div id="c5mix-featured-slider-<?php  echo $bID?>" class="c5mix-featured-slider-light">
       <ul class="ui-tabs-nav">
         <?php  
            for ($i = 0; $i < count($cArray); $i++ ) {
                $cobj = $cArray[$i]; 
                $title = $cobj->getCollectionName();
            $e = $i + 1;
            $img = $cobj->getAttribute('c5mix_feature_image');
            $thumb = $ih->getThumbnail($img, 80, 50, array('crop' => true));
            ?>
 
            <li class="ui-tabs-nav-item<?php  if ($e == 1) { ?> ui-tabs-selected<?php  } ?>" id="c5mix-featured-slider-<?php  echo $bID?>-nav-fragment-<?php  echo $e?>"><a href="#c5mix-featured-slider-<?php  echo $bID?>-fragment-<?php  echo $e?>"><?php  if ($img) { ?><img src="<?php  echo $thumb->src; ?>" width="<?php  echo $thumb->width; ?>" height="<?php  echo $thumb->height; ?>" alt="<?php  echo $title?>" /><?php  } ?><p><?php  echo $title?></p></a></li>
 
         <?php  } ?>
 
            </ul>
 
            <?php  
            for ($i = 0; $i < count($cArray); $i++ ) {
                $cobj = $cArray[$i]; 
                $target = $cobj->getAttribute('nav_target');
                $title = $cobj->getCollectionName();
            $e = $i + 1;
            $img = $cobj->getAttribute('c5mix_feature_image');
            $featureImage = $ih->getThumbnail($img, 680, 275, array('crop' => true));
            $thumb = $ih->getThumbnail($img, 80, 50, array('crop' => true));
            ?>
 
            <div id="c5mix-featured-slider-<?php  echo $bID?>-fragment-<?php  echo $e?>" class="ui-tabs-panel<?php  if ($e > 1) { ?> ui-tabs-hide<?php  } ?>" style="">
                 <a <?php   if ($target != '') { ?> target="<?php  echo $target?>" <?php   } ?> href="<?php  echo $nh->getLinkToCollection($cobj)?>">
                 <?php  if ($img) { ?><img src="<?php  echo $featureImage->src; ?>" width="<?php  echo $featureImage->width; ?>" height="<?php  echo $featureImage->height; ?>" alt="<?php  echo $title?>" /><?php  } ?>
                 <div class="c5mix-featured-slider-info" >
                    <h2><?php  echo $title?></h2>
                    <p>
                       <?php  
                  if(!$controller->truncateSummaries){
                     echo $cobj->getCollectionDescription();
                  }else{
                     echo $textHelper->shorten($cobj->getCollectionDescription(),$controller->truncateChars);
                  }
                  ?>
                    </p>
                 </div>
                 </a>
            </div>
            <?php   }  ?>
    </div><!-- c5mix-featured-slider ends -->
<?php   }  ?>.