<input type="text" name="search" id="livesearchinput" class="searchbox" onfocus="this.value=''" onkeyup="loadKBArticles(event, this, true, '');" value="Search..." />
<p class="searchdesc"><?php echo $this->lang("Live article search - please enter 4 or more characters to begin.")." "; ?><span id="kb_wrap_searchingarticles" class="searchdesc" style="display:none;"><?php echo $this->lang("Searching..."); ?></span></p>
<div id="kb_wrap" style="padding-top:10px;"></div>
<div id="kb_wrap_buttons" style="display:none;" class="buttonsbox"><?php echo $this->lang("Couldn't find what you were looking for?"); ?>&nbsp;<a href="index.php?fuse=support&view=SubmitTicketForm"><?php echo $this->lang("Submit a Ticket"); ?></a></div>

<?php foreach ($this->categories as $category) {?>

<div class="<?php echo $category['categoryDivClass']; ?>">

	<div class="viewall right"><a href="index.php?fuse=knowledgebase&amp;view=KB_CategoriesView&amp;categoryId=<?php echo $category['categoryId']; ?>&amp;showall=1"><?php echo $this->lang("View all articles"); ?> &raquo;</a></div>
    <h3 class="cattitle"><img src="templates/<?php echo $this->gTemplateName; ?>/images/kb/folder.png" alt="icon" class="icon" />&nbsp;<a href="index.php?fuse=knowledgebase&amp;view=KB_CategoriesView&amp;categoryId=<?php echo $category['categoryId']; ?>&amp;showall=1"><?php echo $category['categoryName']; ?></a> <!--(<?php echo $category['categoryCounter']; ?>)--></h3>
    
	<ul class="catbox">
    
	<?php foreach ($category['articles'] as $article) { ?>
		<li><img src="templates/<?php echo $this->gTemplateName; ?>/images/public/icon_article.png" alt="icon" class="icon" /> <a href="index.php?fuse=knowledgebase&amp;view=KB_viewArticle&amp;articleId=<?php echo $article['id']; ?>"><?php echo $article['title']; ?></a></li>
	<?php } //end loop through articles ?>
    
    <?php if (count($category['articles'])==0) { ?>
    	<li class="none"><?php echo $this->lang("No Articles"); ?></li>
    <?php } //end if no articles ?>
    
    </ul>
    
</div>

<?php } //end for each ?>

<div class="clear"></div>

<?php if ( isset($this->searchedSubject) ) {?>
<script type="text/javascript">
    $('#livesearchinput').val('<?php echo $this->searchedSubject; ?>');
    loadKBArticles(null, document.getElementById('livesearchinput'), true, '');
</script>
<?php } ?>