<?php 
function lioit_big_box($cat) { ?>
<?php
		global $data;
		global $post;
		$big_cat = stripslashes($data['bigbox_'.$cat]); 
		$category_id = get_cat_ID($big_cat);
		


		
		?>
<div class="newsBox<?php if($data[$cat.'_layout'] == 'bigboxs2'){ echo' newsBoxRight';}else{ echo'';}?>">
  <div class="newsBoxTop">
    <div class="newsBoxTitle"> <a href="<?php echo get_category_link($category_id); ?>">
      <h2><?php echo get_cat_name($category_id); ?></h2>
      </a> </div>
    <!--End Latest PostsTitle--> 
    <span class="titleArrow"></span> <a href="#" class="whiteRss"></a> </div>
  <!--End LatestPostsTop-->
  <div class="contentBox">
    <?php query_posts(array('showposts' => 1, 'cat' => $category_id )); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <div class="newsBoxPost">
      <div class="newsBoxPostThumb 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 
                          if(isset($post->ID))
                            {
                                   $img = catch_that_image($post->ID);
                            }
                          ?>
        <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"> <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=280&amp;h=200&amp;zc=1" alt="<?php the_title(); ?>" />
        <div class="carouselPostsMask"> <span class="page-link"></span> </div>
        </a> </div>
      <!--End LatestPostThumb-->
      <?php $type_badge = get_post_meta($post->ID, 'lioit_post_type', true);?>
      <h1 class="newsBoxPostTitle">
        <div class="<?php echo $type_badge; ?> articleType"></div>
        <a href="<?php the_permalink();?>">
        <?php the_title();?>
        </a></h1>
      <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('0 Comments','1 Comment','% Comments');?>
          </a></li>
      </ul>
      <!--End postMeta-->
      <p>
        <?php the_excerpt_max_charlength('220'); ?>
        ...</p>
    </div>
    <!--End NewsBoxPost-->
    <?php endwhile; ?>
    <?php  else:  ?>
    <!-- Else in here -->
    <?php  endif; ?>
    <?php wp_reset_query(); ?>
    <div class="newsBoxList">
      <?php query_posts(array('showposts' => 4,'offset' => 1, 'cat' => $category_id )); ?>
      <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <div class="newsBoxListPost">
        <div class="newsBoxListPostThumb 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); ?>
          <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"> <img src="<?php echo Lioit_URI; ?>/scripts/timthumb.php?src=<?php echo $img ?>&amp;w=70&amp;h=70&amp;zc=1" alt="<?php the_title(); ?>" /> </a> </div>
        <!--End newsBoxListPostThumb-->
        <div class="newsBoxListPostDetails">
          <h1 class="newsBoxListPostTitle"> 
          <a href="<?php the_permalink();?>">
          <?php $type_badge = get_post_meta($post->ID, 'lioit_post_type', true);?>
          <div class="<?php echo $type_badge; ?> articleType"></div>
            <?php the_title();?>
            </a></h1>
          <ul class="postMeta">
            <li class="postDate">
              <?php the_time('F d, Y'); ?>
            </li>
            <li class="postComments"><a href="<?php comments_link();?>">
              <?php comments_number('0 Comments','1 Comment','% Comments');?>
              </a></li>
          </ul>
          <!--End postMeta--> 
        </div>
        <!--End newsBoxListPostDetails--> 
      </div>
      <!--End newsBoxListPost-->
      <?php endwhile; ?>
      <?php  else:  ?>
      <!-- Else in here -->
      <?php  endif; ?>
      <?php wp_reset_query(); ?>
    </div>
    <!--End NewsBoxList--> 
  </div>
  <!--End ContentBox--> 
</div>
<!--End NewsBox-->
<?php
}

?>