<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:py="http://genshi.edgewall.org/"
      py:strip=""
      >

    <?python from utils import  latinize; from pprint import pprint;     ?>

	<div id="catlist" class="submenu" >
		<py:for each="ci in range(len(categories))"> 
		<py:if test="category_sizes[ci]>0 ">
		<py:with vars="cat=categories[ci]">
			<a href="#${latinize(cat)}">${cat.replace(' ', '&nbsp;')}</a> 
			<py:if test="cat != categories[-1]">|</py:if>
		</py:with></py:if></py:for>
	</div>

	<div id="proglist">
	<py:for each="cat_nr in range(len(categories))" >
	
		<py:if test="category_sizes[cat_nr] > 0">
		<py:with vars=" category_name = categories[cat_nr]; _catname= latinize(category_name); cat_size=category_sizes[cat_nr]; ">
		
			<h2  class="catname">
			<a id="${_catname}" name="${_catname}"></a>
				${category_name} <!--<span > (${cat_size}) </span>-->
			</h2>    
			
			<py:with vars="prog_count_end = category_sizes_cumulative[cat_nr]; prog_count_start = prog_count_end - cat_size"> <!-- prepair interval points -->
				<!--<span class="debug"> $prog_count_start : $prog_count_end </span>-->
			<py:for each="prog in programs[ prog_count_start : prog_count_end ]" >
				<?python #from pprint import pprint; pprint(prog); ?>
				
				<xi:include href="item.html" />
			</py:for>
			</py:with> 
			
		</py:with>
		</py:if>
	
	</py:for>  
	</div>



</html>
