$category_childs[$j] = array();
        }
        $category_childs[$j][] =& $category['child'][$key];
        $j = ++$j % $columns_max;
    }
    $res = 0;
    foreach ($category_childs as $items) {
        $res++;
        $item0 = array_shift($items);
        $items = $items;
        ?>
			<div class="megaii-item">
				<div class="megaii-item-inner">
					<div class="megaii-item-first">
						<?php 
        $img = SjMegaK2ItemsIIHelper::getK2Image($item0, $params);
        $img = ImageHelper::init($img)->src();
        if (is_file($img) && file_exists($img) || SjMegaK2ItemsIIHelper::isUrl($img)) {
            ?>
						<div class="item-image">
							<a href="<?php 
            echo $item0->link;
            ?>
" title="<?php 
            echo $item0->displaytitle;
            ?>
" <?php 
            echo SjMegaK2ItemsIIHelper::parseTarget($params->get('link_target'));
            ?>
 >
								<img alt="<?php 
    }
    ?>
							
							
						</div>
					</div>
				</div>
				<div class="megaii-item megaii-other">
					<div class="megaii-item-inner">
						<?php 
    if (!empty($items)) {
        ?>
						<ul class="megaii-other-item">
							<?php 
        foreach ($items as $item) {
            $img_other = SjMegaK2ItemsIIHelper::getK2Image($item, $params);
            ?>
							<li class="item-other">
								<div class="item-image">
									<a href="<?php 
            echo $item->link;
            ?>
" title="<?php 
            echo $item->displaytitle;
            ?>
" <?php 
            echo SjMegaK2ItemsIIHelper::parseTarget($params->get('link_target'));
            ?>
 >
										<?php 
            echo SjMegaK2ItemsIIHelper::imageTag($img_other);