<div class="sitemapbox clearfix">
<?php if(is_array($categories)){?>
<?php foreach ($categories as $key=>$c){?>
<div class="sec-categories clearfix"> <a class="main-category" href="<?php echo $c['href'];?>"><?php echo $c['name'];?></a>
	<ul>
		<?php foreach ($c['child'] as $k=>$v){?>
			<?php if($k<8){?>
				<li><a href="<?php echo $v['href'];?>"><?php echo $v['name'];?></a></li>
			<?php }?>
		<?php }?>
		<?php if($c['total']>7){?>
			<li><a class="more-link" rel="nofollow" onclick="hide_content(<?php echo ($key+1);?>)">More...</a></li>
		<?php }?>
	</ul>
</div>
<div id="temp-popup-content<?php echo ($key+1);?>" class="popup-content" style="display: none; z-index: 999999; left:25%; top:35%; position:fixed;_position:absolute;_top:expression(eval(document.documentElement.scrollTop+100));">
        <a class="popup-close" href="javascript:void(0);"></a>
        <h3><?php echo $c['name'];?></h3>
        <div>
            <ul>
            <?php foreach ($c['child'] as $key=>$v){?>
                <li><a href="<?php echo $v['href'];?>"><?php echo $v['name'];?></a></li>
            <?php }?>
            </ul>
        </div>
    </div>
<?php }?>
<?php }?>
</div>
<style type="text/css">
.sitemapbox{margin:20px 0 0 10px;}
.sec-categories {height:205px;float: left;overflow: hidden;padding-right: 15px;white-space: nowrap;width: 215px; margin-bottom:20px;}
.sec-categories a.main-category {color: #CB6800;font-size: 14px;font-weight: bold; font-family:Arial, Helvetica, sans-serif; display:block;}
.sec-categories dt, .sec-categories dd, .sec-categories a {white-space: normal;font-size:11px; color:#333;}
.sec-categories ul li a:hover{color:#FF6600;text-decoration:underline;}
.sec-categories ul {padding-bottom: 15px;}
.sec-categories li {list-style: none outside none;line-height:20px; text-indent:5px;}
#page .more-link:link {color: #0066CC;}
.more-link {background-position: 0 -80px;padding-left: 17px;}
.sec-caption, .more-link {background-image: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/ac_fold_unfold.jpg");background-repeat: no-repeat;}
.more-link {cursor: pointer;font-weight: bold;}
.more-categories {display: none;}
.popup-content {background: none repeat scroll 0 0 #FFFFFF;border: 1px solid #CCCCCC;position: fixed;width:800px;}
.popup-close {background: url("https://www.beststoreitems.com/catalog/template/beststoreitems/image/spr_we_buyer_list.png") no-repeat scroll 0 -1150px transparent;display: block;height: 19px;position: absolute;right: 10px;top: 7px;width: 19px;}
.popup-content h3 {background: none repeat scroll 0 0 #FEF7DB;color: #010103;font-size: 16px;height: 34px;line-height: 34px;margin: 1px;padding: 0 16px;}
.popup-content div {overflow: auto;padding:15px;}
.popup-content li {float: left;font-size: 13px;overflow: hidden;width: 255px; line-height:30px;}
.popup-content li a {white-space: nowrap;}
.popup-content li a:hover {color:#FF6600; text-decoration:underline;}
</style>
<script type="text/javascript">
$('.popup-close').click(function(){
	$('.popup-content').hide();
});
function hide_content(id){
	document.getElementById('temp-popup-content'+id).style.display='block';
	return false;
}
</script>