<?php
  /**
   * Copyright 2011 Zazavi - http://www.zazavi.com
   * Zazavi is free software released under the terms of the GNU General Public License.
   * You should have received a copy of the license.  If not, see <http://www.gnu.org/licenses/>.
   */
  if (!defined("_VALID_PHP"))
      die('Direct access to this location is not allowed.');
  
  require_once(ZAZAVILITE . "admin/modules/newsslider/admin_class.php");
  $slider = new newsSlider();
?>
<!-- Start News Slider -->
<?php if($slider->renderNewsItems()):?>
<div id="newsslider">
  <?php foreach ($slider->renderNewsItems() as $nrow):?>
  <div class="newsslider_item">
  <?php if($nrow['show_title']):?>
  <h5><?php echo $nrow['title'.$core->dblang];?></h5>
  <?php endif;?>
  <?php if($nrow['show_created']):?>
  <h6><?php echo $nrow['started'];?></h6>
  <?php endif;?>
  <?php echo cleanOut($nrow['body'.$core->dblang]);?>
  </div>
  <?php endforeach;?>
</div>
<div class="npaging">
<a href="#"><img src="<?php echo SITEURL;?>/modules/newsslider/images/news-back.png" alt="back" width="25" height="20" id="slidePrev" /></a>
<a href="#"><img src="<?php echo SITEURL;?>/modules/newsslider/images/news-next.png" alt="next" width="25" height="20" id="slideNext" /></a>
</div>
<br clear="all" />
<script type="text/javascript">
    $(document).ready(function() {
        if ($('#newsslider').length > 0) {
            $('#newsslider').cycle({
                fx: 'scrollHorz',
                speed: 300,
                randomizeEffects: true,
                timeout: 6000,
                cleartype: true,
                cleartypeNoBg: true,
				pause: true,
                next: '#slideNext',
                prev: '#slidePrev'
            });
        }
    });
</script>
<?php endif;?>
<!-- End News Slider /-->