<?php $carouselposts = $data['cat_carouselposts']; ?>
<?php $carocount = $data['carocount']; ?>
<?php $carotitle = $data['carotitle']; ?>
<?php $carouselcategory = get_cat_ID($carouselposts); ?>

					<div class="carouselTitle">
                    	<h4><?php echo $carotitle; ?></h4>
                    </div>
						<div id="carouselPosts">
                        <div id="carousel" class="clearfix mainBorder">
                	<ul class="slides">
					<?php $getposts = new WP_query(); $getposts->query('showposts='.$carocount.'&cat='.$carouselcategory); ?>
								<?php global $wp_query; $wp_query->in_the_loop = true; ?>
                                <?php while ($getposts->have_posts()) : $getposts->the_post(); ?>
                                <li <?php post_class(); ?>>
                                    <div class="slidePostContent">
                                    	<div class="ThambCover">
                                        <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=148&amp;h=125&amp;zc=1" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
                                        </div>
                                       	
                                        <h4 class="slidePostContentTitle"><a href="<?php the_permalink(); ?>"><?php $title = the_title('','',FALSE); echo substr($title, 0, 50); ?> ...</a></h4>
                                       
                                    </div>
                                </li>
                                <?php endwhile; ?>
                </ul>
              </div><!--End carouselPosts-->
              </div><!--End carouselPosts-->
                <script type="text/javascript">
jQuery(document).ready(function($) {
	jQuery('#carousel').flexslider({
	animation: "slide",
    animationLoop: true,
    itemWidth: 160,
    itemMargin: .5

	});
	
});
</script> 