<?xml version="1.0" encoding="ISO-8859-1" ?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
	xmlns:rf="http://schemas.roadintranet.org/road-faq-1">
     <xsl:include href="html.xsl"/>
   
    <xsl:include href="nav.xsl"/>
	<xsl:include href="banner.xsl"/>
    <xsl:variable name="topics" select="document('../xml/topics.xml')" />
    <xsl:variable name="root" select="/"/>
    <xsl:variable name="item-list"
        select="/rf:content/rf:topic[not(@hide)]/rf:section/rf:item[substring(@title,1,1) != '[']"/>    
    <!-- html output -->
	<xsl:template match="/">
	        <html>
	        <head>
	            <title>FAQ Items</title>
	            <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
	            <meta http-equiv="Content-Language" content="en-us"/>
	            <link rel="stylesheet" type="text/css" href="../css/road.css" />
	        </head>
	        <body>
	            <div id="page">		
	                <xsl:call-template name="banner"/>
	                <xsl:call-template name="nav"/>
	                <div id="content">
	                    <h2 id="TOP">FAQ Items</h2>
			    <div class="twocol">
			        <div class="col leftcol">
			            <ul>
			            <xsl:for-each
			                select="$item-list">
                                    <xsl:sort select="@title"/>
			                <xsl:if test="2*position() &lt; last()">
			                    &#xa;<li>
			                        <xsl:choose>
			                        <xsl:when test="contains(@title, ' -- ') ">
			                            <a href="{@file}#{@id}">
			                                <xsl:value-of
			                                    select="substring-before(@title, ' -- ') "/>
			                            </a> -- <xsl:value-of
			                                select="substring-after(@title, ' -- ' )"/>
			                        </xsl:when>
			                        <xsl:otherwise>
			                            <a href="{@file}#{@id}">
			                                <xsl:value-of select="@title"/>
			                            </a>
			                        </xsl:otherwise>
			                        </xsl:choose>
                                                                   </li>
			                </xsl:if>
			            </xsl:for-each>
			                </ul>
			        </div>
			        <div class="col rightcol">
			            <xsl:for-each
			                select="$item-list">
			                <xsl:sort select="@title"/>
			                <xsl:if test="2*position() >= last()">
			                    &#xa;<li>			                        <xsl:choose>
			                        <xsl:when test="contains(@title, ' -- ') ">
			                            <a href="{@file}#{@id}">
			                                <xsl:value-of
			                                    select="substring-before(@title, ' -- ') "/>
			                            </a> -- <xsl:value-of
			                                select="substring-after(@title, ' -- ' )"/>
			                        </xsl:when>
			                        <xsl:otherwise>
			                            <a href="{@file}#{@id}">
			                                <xsl:value-of select="@title"/>
			                            </a>
			                        </xsl:otherwise>
			                    </xsl:choose>
			                    </li>
			                </xsl:if>
			            </xsl:for-each>
			        </div>
			    </div>
			</div>
		</div>
	        </body>
	        </html>
    </xsl:template>
</xsl:stylesheet>



