<?php 
$featured = $data['cat_featured1'];
$count = $data['featuredcount1'];
$category_id = get_cat_ID($featured);
?>     
            <div id="firstSlideshows" class="firstmainSlideshows clearfix mainBorder">
              <div id="firstfeaturedPosts" class="clearfix">
                <div class="preloader"></div><!--End Loading-->
                <div class="slides">
                    <?php query_posts(array('showposts' => $count, 'cat' => $category_id )); ?>
                    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                    <div class="slide">
                        <div class="firstSlideThumb ThumbCover">
                        	<div class="cover" style="top: 100%;">
                                <a class="postype" href="<?php the_permalink(); ?>"></a>
                                <a class="detail" href="<?php the_permalink(); ?>" title="View detail"></a>										
                            </div>
                        	<?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>
                      <div class="text">
                        <h3> <a href="<?php the_permalink();?>" ><?php the_title(); ?></a></h3>
                        <ul class="postMeta">
                        	<li class="postAuthor"><?php the_author_posts_link(); ?></li>
                            <li class="postDate"><?php the_time('F d, Y'); ?></li>
                            <li class="postComments"><a href="<?php comments_link();?>"><?php comments_number('No Comments','1 Comment','% Comments');?></a></li>
                        </ul><!--End postMeta-->
                        <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="firstfeaturedThumbs" class="clearfix">
                <ul class="slides">
					<?php query_posts(array('showposts' => $count, '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=105&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('#firstfeaturedThumbs').flexslider({
		namespace: "",
		animation: "slide",
		asNavFor: '#firstfeaturedPosts',
		controlNav: false,
		animationLoop: false,
		slideshow: false,
		itemWidth: 105,
		itemMargin: 11,
		minItems: 2,
		maxItems: 5
	});
	jQuery('#firstfeaturedPosts').flexslider({
		namespace: "",
		selector: ".slides > .slide",
		animation: "slide",
		sync: '#firstfeaturedThumbs',
		slideshowSpeed: 5000,
		animationSpeed: 900,
		animationLoop: true,
		controlNav: false,
		animationLoop: false,
		slideshow: false,
		start: function(slider) {
			jQuery('.preloader').hide();
			jQuery('#firstfeaturedThumbs').show();
		}
	});
});
</script> 
