<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
$this->load->view( $this->aSystemVar['template_viewer_root'] . '_header') ?>
					<!-- categories list -->

					<div id="categories">
						<h1><?= $this->lang->line('categories'); ?>&nbsp;<a href="<?=site_url('rss/0')?>"><img src="<?=base_url().'/views/_images/rss_feed_14.png'?>" /></a></h1>
						<div class="clearBoth"></div>
                        <?
							$i = 1;
							foreach( $data['CategoryList'] as $aCategory ):
						?>
							<div class="category">
							<?
                                if ( empty($aCategory['IconUrl']) )
								{
									$icon = $this->config->item('design_icon_url').'folder.jpg';
								}
								else
								{
									$icon = $aCategory['IconUrl'];
								}
							?>

							<a href="<?= site_url($this->config->item('uri_category').$aCategory['BaseName']) ?>"><img src="<?=$icon;?>" alt="" title="<?= $aCategory['Title']; ?>" class="cat_icon" /></a>
							<?= anchor( $this->config->item('uri_category') . $aCategory['BaseName'], $aCategory['Title'], ' class="title" title="' . $aCategory['Title'] .  '" ' ); ?>

								<? if( !empty($aCategory['subcategories']) ): ?>
									<div class="subcategory">
									<?
									$j = 1;
									$iSubCount = count($aCategory['subcategories']);
									foreach($aCategory['subcategories'] as $aSubCategory)
									{
										echo  anchor($this->config->item('uri_category') . $aSubCategory['BaseName'], $aSubCategory['Title']);
										if( $j >= 4 )
										{
											break;
										}
										else
										{
											if( $j < $iSubCount)
												echo ', ';
										}
										$j++;
									}
									?>
									</div>
								<? endif; ?>


							</div>
						<?
							if( 0 == $i%2 )
								echo '<div class="clearBoth"></div>';
							$i++;
							endforeach;
						?>
						<div class="clearBoth"></div>
					</div>
					<!-- end categories list -->
					<!-- news -->
					<? if( ! empty($data['NewsList']) ): ?>
					<div id="news">
						<h1><?= $this->lang->line('news'); ?></h1>
						<? foreach( $data['NewsList'] as $aNews ): ?>
							<div>
								<? $this->load->view($this->aSystemVar['template_viewer_root'] . 'design_items/news_box', $aNews); ?>
							</div>
						<? endforeach; ?>
					</div>
					<? endif; ?>
					<!-- end news -->
					<!-- featured posts -->
					<div id="featured">
						<h1><?= $this->lang->line('featured'); ?></h1>
						<div class="clearBoth"></div>
						<? foreach($data['FeaturedList'] as $aPost): ?>
						<?// print_r($aPost) ?>
							<div class="featured">
								<div class="thumb">
									<?
										if( empty($aPost['PicUrl']) ):
											$thumb = base_url() . $this->config->item('design_icon_url') . $this->config->item('thumb_no_post');
										else:
											$thumb = $aPost['PicUrl'];
										endif;
									?>
									<a href="<?=site_url($this->config->item('uri_post').$aPost['Id']);?>"><img src="<?= $thumb; ?>" alt="" title="<?= $aPost['Title']?>" /></a>
								</div>
								<div class="title">
									<?= anchor($this->config->item('uri_post') . $aPost['Id'], character_limiter($aPost['Title'], 20)); ?>
								</div>
							</div>
						<? endforeach; ?>
						<div class="clearBoth"></div>
					</div>
					<!-- end featured posts -->
					<!-- last posts -->
					<? if( isset($data['RecentList']) ):?>
						<div id="recent">
							<h1><?= $this->lang->line('recent_posts');?></h1>
							<? foreach($data['RecentList'] as $aPost): ?>
								<? $this->load->view($this->aSystemVar['template_viewer_root'] . 'design_items/post_box', $aPost);?>
							<? endforeach; ?>
						</div>
					<? endif;?>
					<!-- end lats posts -->
<? $this->load->view( $this->aSystemVar['template_viewer_root'] . '_footer') ?>