<script language="javascript">
	var idCurrentCategory={$idCurrentCategory|default:0};
</script>

{if $categoriesList}
	{foreach from=$categoriesList item=category key=key name=categoriesLoop}
		<div id="categoryDiv_{$category.id}"

			{if $category.id==$idCurrentCategory}class="tabSel"
			{else}class="tabBlur"{/if}

			onmouseover="$(this).addClassName('tabFocus');"
			onmouseout="$(this).removeClassName('tabFocus');"
			onclick="

				// switch clases
				if ( idCurrentCategory && $('categoryDiv_'+idCurrentCategory) )
					$('categoryDiv_'+idCurrentCategory).className='tabBlur';
				$(this).className='tabSel';
				idCurrentCategory={$category.id};

				// reload reports
				ajaxIframe('reportsListDiv', 'reportsList.php', 'idCategory={$category.id}&currentPage=0');

			"

		>
			{$category.name}

			{if $category.description}
				<div class="categoryDescription">{$category.description}</div>
			{/if}

		</div>

		{if !$smarty.foreach.categoriesLoop.last}
			<div class="categoriesEmptyDiv categoriesSpacer">&nbsp;</div>
		{/if}

	{/foreach}
{/if}

<div id="categoriesSpaceFiller" class="categoriesEmptyDiv"></div>