<?php
/**
 * @package Genesis
 * @copyright Copyright 2012 - 2015 Sammycorp
 * @author Sammycorp
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 */

$sliders = genesis_get_banners('genesis-slider');

?>

<div class="hero-area">

  <?php if( $sliders && count( $sliders ) > 0 ) : ?>
  <div class="main-slider genesis-section">
    <div class="cdslider">
      <ul class="slides">
        <?php foreach ($sliders as $slide) : ?>
        <li class="slide-wrap" style="background-image:url(<?php echo DIR_WS_IMAGES . $slide['image']; ?>);">
        <?php if( $slide['url'] != '' ) : ?>  
          <a class="slide-link" href="<?php echo $slide['url']; ?>" <?php echo ( $slide['onw'] ? 'target="_blank"' : '' ); ?>><div class="slide-inner"></div></a>
        <?php else : ?>
          <div class="slide-inner">
            <div class="slide-content"><?php echo $slide['html']; ?></div>
          </div>
        <?php endif; ?>
        </li>
        <?php endforeach; ?>
      </ul>
    </div>
  </div>
  <script>
    jQuery(document).ready(function() {
      $('.cdslider').flexslider({
        animation: 'slide', 
      });
    });
  </script>
  <?php endif; ?>

</div>