<?php $catfeatured = $data['cat_featured']; $category_id = get_cat_ID($catfeatured);?>
<?php $featuredcount = $data['featuredcount']; ?>
            
            
            
            <div id="mainSlideshows" class="mainSlideshows clearfix mainBorder">
              <div id="featuredPosts" class="clearfix">
                <div class="preloader"></div><!--End Loading-->
                <div class="slides">
                    <?php query_posts(array('showposts' => $featuredcount, 'cat' => $category_id )); ?>
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <div class="slide">
                        <?php $img = catch_that_image($post->ID); ?>
                        <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=616&amp;h=350&amp;zc=1" alt="<?php the_title(); ?>" />
                      <div class="text">
                        <h3> <a href="<?php the_permalink();?>" ><?php the_title(); ?></a> </h3>
                        <p><?php the_excerpt_max_charlength('200'); ?></p>
                      </div>
                      <div class="overlay"></div>
                    </div><!--End Slide-->
                    <?php endwhile; ?>
					<?php  else:  ?>
                    <!-- Else in here -->
                    <?php  endif; ?>
                    <?php wp_reset_query(); ?>                                      
                </div><!--End Slides-->
              </div><!--End featured Posts-->
              <div id="featuredThumbs" class="clearfix">
                <ul class="slides">
					<?php query_posts(array('showposts' => $featuredcount, 'cat' => $category_id )); ?>
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <li>
					<?php $img = catch_that_image($post->ID); ?>
                    <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=150&amp;h=80&amp;zc=1" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
                    </li>
                    <?php endwhile; ?>
					<?php  else:  ?>
                    <!-- Else in here -->
                    <?php  endif; ?>
                    <?php wp_reset_query(); ?>
                </ul>
              </div>
            </div><!--End SlideShow-->
            
            
<script type="text/javascript">
jQuery(document).ready(function($) {
	jQuery('#featuredThumbs').flexslider({
		namespace: "",
		animation: "slide",
		asNavFor: '#featuredPosts',
		slideshow: false,
		controlNav: false,
		itemWidth: 105,
		itemMargin: 11,
		minItems: 2,
		maxItems: 5
	});
	jQuery('#featuredPosts').flexslider({
		namespace: "",
		selector: ".slides > .slide",
		animation: "slide",
		sync: '#featuredThumbs',
		slideshowSpeed: 5000,
		animationSpeed: 900,
		animationLoop: true,
		slideshow: true,
		controlNav: false,
		directionNav: false,
		start: function(slider) {
			jQuery('.preloader').hide();
			jQuery('#featuredThumbs').show();
		}
	});
});
</script> 
